aboutsummaryrefslogtreecommitdiffstats
path: root/bot/seasons/christmas/adventofcode.py
diff options
context:
space:
mode:
authorGravatar sco1 <[email protected]>2019-03-05 16:28:12 -0500
committerGravatar sco1 <[email protected]>2019-03-05 16:28:12 -0500
commit134cd0e84740b79caaa2c2ed3cb6a302153d7046 (patch)
tree4db58def7d12f8eab8ae2a7144741f8537a31dfc /bot/seasons/christmas/adventofcode.py
parentAdd Cog inheritance to season loader (diff)
parentMerge pull request #129 from darthdelay/myvalenstate (diff)
Merge branch 'master' into dpy-cog-changes
Diffstat (limited to 'bot/seasons/christmas/adventofcode.py')
-rw-r--r--bot/seasons/christmas/adventofcode.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/bot/seasons/christmas/adventofcode.py b/bot/seasons/christmas/adventofcode.py
index d360ae5e..c74a6f25 100644
--- a/bot/seasons/christmas/adventofcode.py
+++ b/bot/seasons/christmas/adventofcode.py
@@ -205,14 +205,21 @@ class AdventOfCode(commands.Cog):
@adventofcode_group.command(name="join", aliases=("j",), brief="Learn how to join PyDis' private AoC leaderboard")
async def join_leaderboard(self, ctx: commands.Context):
"""
- Retrieve the link to join the PyDis AoC private leaderboard
+ DM the user the information for joining the PyDis AoC private leaderboard
"""
+ author = ctx.message.author
+ log.info(f"{author.name} ({author.id}) has requested the PyDis AoC leaderboard code")
+
info_str = (
"Head over to https://adventofcode.com/leaderboard/private "
f"with code `{AocConfig.leaderboard_join_code}` to join the PyDis private leaderboard!"
)
- await ctx.send(info_str)
+ try:
+ await author.send(info_str)
+ except discord.errors.Forbidden:
+ log.debug(f"{author.name} ({author.id}) has disabled DMs from server members")
+ await ctx.send(f":x: {author.mention}, please (temporarily) enable DMs to receive the join code")
@adventofcode_group.command(
name="leaderboard",