Compare commits

...

1 Commits

17
bot.py
View File

@@ -162,7 +162,10 @@ def has_role_check(role_id: int):
async def on_message(message):
try:
logger.info(f"Channel: [{str(message.channel)}] User: {str(message.author)} Content: {message.content}")
await client.process_commands(message)
# Special response for user 331862422996647938 when message starts with a period
if message.author.id == 331862422996647938 and message.content.startswith('.'):
await message.channel.send("Whatever conversation is happening right now, Jared is right")
except Exception as e:
logger.error(f"Error in on_message: {e}", exc_info=True)
@@ -1078,18 +1081,6 @@ async def userinfo(interaction: discord.Interaction, member: discord.Member):
logger.error(f"Error in userinfo command: {e}", exc_info=True)
@client.event
async def on_command_error(ctx, error):
"""Handle prefix command errors."""
try:
if isinstance(error, commands.CommandNotFound):
await ctx.send("Command not found!")
logger.error(f"Command error: {str(error)}")
elif isinstance(error, commands.MissingPermissions):
await ctx.send("You don't have permission to use this command!")
logger.error(f"Command error: {str(error)}")
except Exception as e:
logger.error(f"Error in on_command_error: {e}", exc_info=True)
@client.tree.error