From b9e1bdf87e3a62f60ec58f339a6e6b9b65af2632 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sat, 17 Oct 2020 01:52:35 -0400 Subject: [PATCH] Properly insert at the end if position is not found when moving. Fixes #5923 --- discord/abc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/abc.py b/discord/abc.py index 0ac87d135..9dffb8d2e 100644 --- a/discord/abc.py +++ b/discord/abc.py @@ -227,7 +227,7 @@ class GuildChannel: # not there somehow lol return else: - index = next((i for i, c in enumerate(channels) if c.position >= position), -1) + index = next((i for i, c in enumerate(channels) if c.position >= position), len(channels)) # add ourselves at our designated position channels.insert(index, self)