diff options
| author | 2022-11-26 19:02:06 +0100 | |
|---|---|---|
| committer | 2022-11-26 19:02:06 +0100 | |
| commit | 579514077f9b3307dc4717af94d1f8cda595c74d (patch) | |
| tree | a9919428a7a3df6dd25fb3e89d7bdb4b04ba6976 | |
| parent | add the roles channel to the config (diff) | |
add the AllSelfAssignableRolesView and its corresponding ClaimAllSelfAssignableRolesButton button
Note that these are still dummy views & have no behavior
| -rw-r--r-- | bot/exts/info/subscribe.py | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/bot/exts/info/subscribe.py b/bot/exts/info/subscribe.py index 36304539f..4991f4a96 100644 --- a/bot/exts/info/subscribe.py +++ b/bot/exts/info/subscribe.py @@ -59,6 +59,27 @@ DELETE_MESSAGE_AFTER = 300 # Seconds log = get_logger(__name__) +class AllSelfAssignableRolesView(discord.ui.View): + """A view that'll hold one button allowing interactors to get all available self-assignable roles.""" + + def __init__(self): + super(AllSelfAssignableRolesView, self).__init__(timeout=None) + + +class ClaimAllSelfAssignableRolesButton(discord.ui.Button): + """A button that adds all self assignable roles to the interactor.""" + + CUSTOM_ID = "gotta-claim-them-all" + + def __init__(self): + super().__init__( + style=discord.ButtonStyle.success, + label="Assign me a", + custom_id=self.CUSTOM_ID, + row=1 + ) + + class RoleButtonView(discord.ui.View): """A list of SingleRoleButtons to show to the member.""" @@ -150,7 +171,6 @@ class Subscribe(commands.Cog): async def cog_load(self) -> None: """Initialise the cog by resolving the role IDs in ASSIGNABLE_ROLES to role names.""" await self.bot.wait_until_guild_available() - self.guild = self.bot.get_guild(constants.Guild.id) for role in ASSIGNABLE_ROLES: |