updated content match message with all possible matches and contextes
This commit is contained in:
parent
451412973c
commit
20c0e8b8d5
@ -132,11 +132,13 @@ async def main():
|
|||||||
context = message_content[start_pos:end_pos]
|
context = message_content[start_pos:end_pos]
|
||||||
words.append(word)
|
words.append(word)
|
||||||
contexts.append(context)
|
contexts.append(context)
|
||||||
await client.send_message(channel_id, f"Keyword Match: {', '.join(words)}\nContext: {', '.join(contexts)}")
|
break
|
||||||
await asyncio.sleep(0.1)
|
if words:
|
||||||
await event.message.forward_to(channel_id)
|
await client.send_message(channel_id, f"Keyword Match: {', '.join(words)}\nContext: {', '.join(contexts)}")
|
||||||
await asyncio.sleep(0.5)
|
await asyncio.sleep(0.1)
|
||||||
print(f'Forwarded Message: {message_content}')
|
await event.message.forward_to(channel_id)
|
||||||
|
await asyncio.sleep(0.5)
|
||||||
|
print(f'Forwarded Message: {message_content}')
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.error(f"Error in message handler: {e}")
|
logging.error(f"Error in message handler: {e}")
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user