Implemented checking for dm privacy settings

main
Anorak_1 2023-08-01 22:35:23 +02:00
parent 678e912f13
commit 9cd5e8efa4
1 changed files with 8 additions and 1 deletions

9
bot.py
View File

@ -185,7 +185,14 @@ class ApplicationStartButtonView(discord.ui.View):
user = await interaction.user.create_dm()
embedd = discord.Embed(title=f'CreaTopia Application', description="Hey! Your application has started. You have 300 seconds to complete it.")
embedd.add_field(value=f'You can cancel the application by answering "cancel" to any of the questions', name="", inline=False)
await user.send(embed=embedd)
try:
await user.send(embed=embedd)
except discord.Forbidden:
interaction.response.send_message(content="Can't start application. Please allow direct messages from server members in your privacy settings.", ephemeral=True)
return
await interaction.response.send_message(content="Application started", ephemeral=True)
application = {'userId': interaction.user.id}