fixed the message handler ignoring messages, there could still be a problem with commands not working properly
This commit is contained in:
parent
ff4418f834
commit
1a9863dc5e
|
@ -76,28 +76,25 @@ class MessageHandler:
|
|||
# Skip bot messages
|
||||
if message.author.bot:
|
||||
return
|
||||
|
||||
# Skip command messages (they start with . usually)
|
||||
if message.content.startswith('.'):
|
||||
return
|
||||
|
||||
# Look for and replace time patterns
|
||||
original_content = message.content
|
||||
modified_content = self.replace_time_patterns(original_content)
|
||||
|
||||
# If the content was modified, edit the original message
|
||||
if modified_content != original_content:
|
||||
try:
|
||||
await message.edit(content=modified_content)
|
||||
except Exception as e:
|
||||
# If we don't have permission to edit, just ignore
|
||||
pass
|
||||
|
||||
# Look for and replace time patterns (only for non-command messages)
|
||||
if not message.content.startswith('.'):
|
||||
original_content = message.content
|
||||
modified_content = self.replace_time_patterns(original_content)
|
||||
|
||||
# If the content was modified, edit the original message
|
||||
if modified_content != original_content:
|
||||
try:
|
||||
await message.edit(content=modified_content)
|
||||
except Exception as e:
|
||||
# If we don't have permission to edit, just ignore
|
||||
pass
|
||||
|
||||
# Handle special responses
|
||||
for user_id, data in SPECIAL_RESPONSES.items():
|
||||
if message.author.id == user_id and data["trigger"] in message.content:
|
||||
await message.reply(data["response"])
|
||||
|
||||
|
||||
# Handle automatic reactions
|
||||
if message.channel.id in self.bot.horsin:
|
||||
await message.add_reaction("🐴")
|
||||
|
@ -111,7 +108,7 @@ class MessageHandler:
|
|||
await message.delete()
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
# Handle DM if in AFK mode
|
||||
if isinstance(message.channel, discord.DMChannel) and message.author != self.bot.user:
|
||||
await self.afk_commands.handle_afk_dm(message)
|
||||
|
|
1
tracked_channels.json
Normal file
1
tracked_channels.json
Normal file
|
@ -0,0 +1 @@
|
|||
[]
|
Loading…
Reference in a new issue