echobot: ignore info messages

This commit is contained in:
link2xt 2024-03-25 14:35:04 +00:00
parent 377121bdee
commit 75fcbd03ce

View File

@ -48,6 +48,9 @@ def on_group_name_changed(event):
@hooks.on(events.NewMessage(func=lambda e: not e.command)) @hooks.on(events.NewMessage(func=lambda e: not e.command))
def echo(event): def echo(event):
snapshot = event.message_snapshot snapshot = event.message_snapshot
if snapshot.is_info:
# Ignore info messages
return
if snapshot.text or snapshot.file: if snapshot.text or snapshot.file:
snapshot.chat.send_message(text=snapshot.text, file=snapshot.file) snapshot.chat.send_message(text=snapshot.text, file=snapshot.file)