aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2020-10-17 01:52:35 -0400
committerRapptz <[email protected]>2020-10-17 01:52:35 -0400
commitb9e1bdf87e3a62f60ec58f339a6e6b9b65af2632 (patch)
tree3b5c4e1b9f850f90cc9b9b8a1811640c0423a1a9
parentEscape multi-line quotes properly (diff)
downloaddiscord.py-b9e1bdf87e3a62f60ec58f339a6e6b9b65af2632.tar.xz
discord.py-b9e1bdf87e3a62f60ec58f339a6e6b9b65af2632.zip
Properly insert at the end if position is not found when moving.
Fixes #5923
-rw-r--r--discord/abc.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/discord/abc.py b/discord/abc.py
index 0ac87d13..9dffb8d2 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)