Add logging to find potential peer type mistakes
This commit is contained in:
@@ -434,7 +434,6 @@ class AbstractUser(ABC):
|
||||
if isinstance(original_update, (UpdateEditMessage, UpdateEditChannelMessage)):
|
||||
return await portal.handle_telegram_edit(self, sender, update)
|
||||
|
||||
self.log.debug("Handling message %s to %s by %s", update, portal.tgid_log, user)
|
||||
return await portal.handle_telegram_message(self, sender, update)
|
||||
|
||||
# endregion
|
||||
|
||||
@@ -379,6 +379,10 @@ class BasePortal(ABC):
|
||||
return cls.from_db(db_portal)
|
||||
|
||||
if peer_type:
|
||||
cls.log.info(f"Creating portal for {peer_type} {tgid} (receiver {tg_receiver})")
|
||||
if peer_type == "chat":
|
||||
import traceback
|
||||
cls.log.info("Chat portal stack trace:\n" + "".join(traceback.format_stack()))
|
||||
portal = cls(tgid, peer_type=peer_type, tg_receiver=tg_receiver)
|
||||
portal.db_instance.insert()
|
||||
return portal
|
||||
|
||||
Reference in New Issue
Block a user