[fix]: Disable commands in channels w/o permissions

This commit is contained in:
Sweetbread 2023-05-15 20:19:03 +03:00
parent f8de6d54a2
commit c0f11b96e6

8
bot.py
View File

@ -451,4 +451,12 @@ async def change_prefix(ctx, prefix):
dump(prefs, f)
async def check(itr: discord.Interaction):
if not itr.channel.permissions_for(itr.guild.me).send_messages:
await itr.response.send_message("Commands are not allowed here", ephemeral=True)
return False
return True
bot.tree.interaction_check = check
bot.run(TOKEN)