diff options
author | 2018-12-10 17:30:01 -0500 | |
---|---|---|
committer | 2018-12-10 17:30:01 -0500 | |
commit | acde36e17e0a3365f5db7357d76b5a9c8ddc0ff2 (patch) | |
tree | ef1ab710213e15523953c8bc213ce6cc0c61c8d8 /bot/seasons/christmas/adventofcode.py | |
parent | Refactor aoc join to DM user with join code (diff) |
Add staff command to change AoC leaderboard join code
Diffstat (limited to 'bot/seasons/christmas/adventofcode.py')
-rw-r--r-- | bot/seasons/christmas/adventofcode.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/bot/seasons/christmas/adventofcode.py b/bot/seasons/christmas/adventofcode.py index b61e77c0..0d4fd966 100644 --- a/bot/seasons/christmas/adventofcode.py +++ b/bot/seasons/christmas/adventofcode.py @@ -13,7 +13,8 @@ from bs4 import BeautifulSoup from discord.ext import commands from pytz import timezone -from bot.constants import AdventOfCode as AocConfig, Colours, Emojis, Tokens +from bot.constants import AdventOfCode as AocConfig, Colours, Emojis, Roles, Tokens +from bot.decorators import with_role log = logging.getLogger(__name__) @@ -215,6 +216,20 @@ class AdventOfCode: f':x: {author.mention}, please (temporarily) enable DMs to receive the join code' ) + @with_role(Roles.admin, Roles.owner) + @adventofcode_group.command(name="changecode", hidden=True) + async def update_aoc_join_code(self, ctx: commands.Context, new_code: str): + """ + Staff command to update the AoC join code constant locally to allow for the code to be updated + on regeneration without having to redeploy the bot + """ + + author = ctx.message.author + log.info(f"{author.name} ({author.id}) has changed the PyDis AoC leaderboard code") + + global AOC_JOIN_CODE # Necessary (probably?) evil to update the code without redeploying + AOC_JOIN_CODE = new_code + @adventofcode_group.command( name="leaderboard", aliases=("board", "lb"), |