diff --git a/bot.py b/bot.py index d3c01b8..2059a0b 100644 --- a/bot.py +++ b/bot.py @@ -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}