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
|
@ -77,21 +77,18 @@ class MessageHandler:
|
||||||
if message.author.bot:
|
if message.author.bot:
|
||||||
return
|
return
|
||||||
|
|
||||||
# Skip command messages (they start with . usually)
|
# Look for and replace time patterns (only for non-command messages)
|
||||||
if message.content.startswith('.'):
|
if not message.content.startswith('.'):
|
||||||
return
|
original_content = message.content
|
||||||
|
modified_content = self.replace_time_patterns(original_content)
|
||||||
|
|
||||||
# Look for and replace time patterns
|
# If the content was modified, edit the original message
|
||||||
original_content = message.content
|
if modified_content != original_content:
|
||||||
modified_content = self.replace_time_patterns(original_content)
|
try:
|
||||||
|
await message.edit(content=modified_content)
|
||||||
# If the content was modified, edit the original message
|
except Exception as e:
|
||||||
if modified_content != original_content:
|
# If we don't have permission to edit, just ignore
|
||||||
try:
|
pass
|
||||||
await message.edit(content=modified_content)
|
|
||||||
except Exception as e:
|
|
||||||
# If we don't have permission to edit, just ignore
|
|
||||||
pass
|
|
||||||
|
|
||||||
# Handle special responses
|
# Handle special responses
|
||||||
for user_id, data in SPECIAL_RESPONSES.items():
|
for user_id, data in SPECIAL_RESPONSES.items():
|
||||||
|
|
1
tracked_channels.json
Normal file
1
tracked_channels.json
Normal file
|
@ -0,0 +1 @@
|
||||||
|
[]
|
Loading…
Reference in a new issue