aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2021-11-30 11:36:15 +0000
committerGravatar Chris Lovering <[email protected]>2021-11-30 11:51:21 +0000
commit19eef3ed7135572ad52bbf145278efcdd142b0c0 (patch)
treea888b534df10ddff1bab3d0464f47bc338bae5af
parentAllow roles to be assignable over multiple months (diff)
Sort unavailable self-assignable roles to the end of the list
-rw-r--r--bot/exts/info/subscribe.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/bot/exts/info/subscribe.py b/bot/exts/info/subscribe.py
index 9b96e7ab2..d24e8716e 100644
--- a/bot/exts/info/subscribe.py
+++ b/bot/exts/info/subscribe.py
@@ -1,4 +1,5 @@
import calendar
+import operator
import typing as t
from dataclasses import dataclass
@@ -164,6 +165,8 @@ class Subscribe(commands.Cog):
name=discord_role.name,
)
)
+ # Sort unavailable roles to the end of the list
+ self.assignable_roles.sort(key=operator.methodcaller("is_currently_available"), reverse=True)
@commands.cooldown(1, 10, commands.BucketType.member)
@commands.command(name="subscribe")