[fix]: Disable commands in channels w/o permissions
This commit is contained in:
parent
f8de6d54a2
commit
c0f11b96e6
8
bot.py
8
bot.py
@ -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)
|
||||
|
Reference in New Issue
Block a user