mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-19 18:16:34 +01:00
Fix some events
This commit is contained in:
parent
157cb900b2
commit
a0362c75c7
2 changed files with 6 additions and 2 deletions
|
@ -89,6 +89,8 @@ class Events(commands.Cog):
|
||||||
|
|
||||||
@commands.Cog.listener()
|
@commands.Cog.listener()
|
||||||
async def on_message(self, message: discord.Message):
|
async def on_message(self, message: discord.Message):
|
||||||
|
if not message.guild:
|
||||||
|
return
|
||||||
if message.channel.name == "pinboard":
|
if message.channel.name == "pinboard":
|
||||||
if message.type == discord.MessageType.pins_add:
|
if message.type == discord.MessageType.pins_add:
|
||||||
await message.delete(delay=0.01)
|
await message.delete(delay=0.01)
|
||||||
|
|
6
main.py
6
main.py
|
@ -37,8 +37,10 @@ async def on_application_command_error(ctx: discord.ApplicationContext, error: E
|
||||||
|
|
||||||
|
|
||||||
@bot.listen("on_command_error")
|
@bot.listen("on_command_error")
|
||||||
async def on_command_error(ctx: discord.ApplicationContext, error: Exception):
|
async def on_command_error(ctx: commands.Context, error: Exception):
|
||||||
await ctx.respond("Command Error: `%r`" % error)
|
if isinstance(error, commands.CommandNotFound):
|
||||||
|
return
|
||||||
|
await ctx.reply("Command Error: `%r`" % error)
|
||||||
raise error
|
raise error
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue