Fix some events

This commit is contained in:
nex 2022-10-30 16:05:54 +00:00
parent 157cb900b2
commit a0362c75c7
2 changed files with 6 additions and 2 deletions

View file

@ -89,6 +89,8 @@ class Events(commands.Cog):
@commands.Cog.listener()
async def on_message(self, message: discord.Message):
if not message.guild:
return
if message.channel.name == "pinboard":
if message.type == discord.MessageType.pins_add:
await message.delete(delay=0.01)

View file

@ -37,8 +37,10 @@ async def on_application_command_error(ctx: discord.ApplicationContext, error: E
@bot.listen("on_command_error")
async def on_command_error(ctx: discord.ApplicationContext, error: Exception):
await ctx.respond("Command Error: `%r`" % error)
async def on_command_error(ctx: commands.Context, error: Exception):
if isinstance(error, commands.CommandNotFound):
return
await ctx.reply("Command Error: `%r`" % error)
raise error