Don't break on missing perms

This commit is contained in:
Nexus 2023-12-05 12:14:17 +00:00
parent a151a43144
commit 14a6b62cb9
Signed by: nex
GPG key ID: 0FA334385D0B689F

View file

@ -39,6 +39,8 @@ class McDonaldsCog(commands.Cog):
@commands.user_command(name="Commercial Break")
async def commercial_break(self, ctx: discord.ApplicationContext, member: discord.Member):
await ctx.defer(ephemeral=True)
if not ctx.channel.permissions_for(ctx.me).manage_messages:
return await ctx.respond("I don't have permission to manage messages in this channel.", ephemeral=True)
if member.bot or member == ctx.user:
return await ctx.respond("No.", ephemeral=True)
if member in self.targets.keys():