mirror of
https://github.com/myned/modufur.git
synced 2024-11-01 13:02:38 +00:00
Ignore bot actions without permissions
This commit is contained in:
parent
977a8b1d1e
commit
534544d598
1 changed files with 10 additions and 6 deletions
16
run.py
16
run.py
|
@ -24,14 +24,18 @@ bot = lightbulb.BotApp(
|
|||
# Listener for global command exceptions
|
||||
@bot.listen(lightbulb.CommandErrorEvent)
|
||||
async def on_error(event):
|
||||
await bot.application.owner.send(c.error(event))
|
||||
match event.exception.__cause__ or event.exception:
|
||||
case hikari.ForbiddenError():
|
||||
pass
|
||||
case _:
|
||||
await bot.application.owner.send(c.error(event))
|
||||
|
||||
try:
|
||||
await event.context.respond(c.ERROR)
|
||||
except:
|
||||
await event.context.interaction.edit_initial_response(c.ERROR, components=None)
|
||||
try:
|
||||
await event.context.respond(c.ERROR, flags=hikari.MessageFlag.EPHEMERAL)
|
||||
except:
|
||||
await event.context.interaction.edit_initial_response(c.ERROR, components=None)
|
||||
|
||||
raise event.exception
|
||||
raise event.exception
|
||||
|
||||
|
||||
miru.load(bot)
|
||||
|
|
Loading…
Reference in a new issue