fix: bot crashing whenever someone disabled DMs and warning

This commit is contained in:
Showdown76 2024-03-03 17:29:10 +01:00
parent 81be67064b
commit 518a567806
Signed by: showdown
GPG Key ID: 062A80AA93C13988
2 changed files with 7 additions and 4 deletions

View File

@ -28,9 +28,11 @@ async def time_to_bereal():
# Send message to all subscribers
for subscriber in subscribers:
try:
user = await app.fetch_user(subscriber.user_id)
await user.send(f"# :warning: Time to BeReal. :warning:\nCapture a BeReal and see what you friends are up to!\n<t:{t}:R>")
except:
pass
app.time_to_bereal = time_to_bereal

View File

@ -17,7 +17,8 @@ class SubscribeCommand(commands.Cog):
await interaction.response.send_message(
":information_source: You have been subscribed to **BeReal. notifications**\n\
:arrow_right: You will receive every day notifications whenever it's\
time to BeReal.\n:warning: You may unsubscribe at any time using `/unsubscribe`.",
time to BeReal.\n:warning: You may unsubscribe at any time using `/unsubscribe`.\n\
:red_circle: **Make sure you enabled DMs from this server!**",
ephemeral=True,
)
else: