aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2021-11-30 10:30:31 +0000
committerGravatar Chris Lovering <[email protected]>2021-11-30 11:40:44 +0000
commit8b109837e0cba62574ef4269e512d3fe23f6b37e (patch)
tree8987beb831bb5d0ae4f9fc60aecdede78db55eb9
parentUse new get_logger helper util (diff)
Delete the subscribe message after 5 minutes
-rw-r--r--bot/exts/info/subscribe.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/bot/exts/info/subscribe.py b/bot/exts/info/subscribe.py
index a2a0de976..17bb24dca 100644
--- a/bot/exts/info/subscribe.py
+++ b/bot/exts/info/subscribe.py
@@ -19,6 +19,7 @@ ASSIGNABLE_ROLES = (
(constants.Roles.advent_of_code, 12),
)
ITEMS_PER_ROW = 3
+DELETE_MESSAGE_AFTER = 300 # Seconds
log = get_logger(__name__)
@@ -128,7 +129,11 @@ class Subscribe(commands.Cog):
row = index // ITEMS_PER_ROW
button_view.add_item(SingleRoleButton(role, role in ctx.author.roles, row))
- await ctx.send("Click the buttons below to add or remove your roles!", view=button_view)
+ await ctx.send(
+ "Click the buttons below to add or remove your roles!",
+ view=button_view,
+ delete_after=DELETE_MESSAGE_AFTER,
+ )
# This cannot be static (must have a __func__ attribute).
async def cog_command_error(self, ctx: commands.Context, error: Exception) -> None: