Fix /id command in private chats

This commit is contained in:
Tulir Asokan
2021-12-21 13:03:02 +02:00
parent 737c4a1104
commit dfe9bd94b1
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -570,7 +570,8 @@ class AbstractUser(ABC):
if self.is_relaybot:
if update.is_private:
if not self.config["bridge.relaybot.private_chat.invite"]:
self.log.debug(f"Ignoring private message to bot from {sender.id}")
if sender:
self.log.debug(f"Ignoring private message to bot from {sender.id}")
return
elif not portal.mxid and self.config["bridge.relaybot.ignore_unbridged_group_chat"]:
self.log.debug(
+1 -1
View File
@@ -225,7 +225,7 @@ class Bot(AbstractUser):
elif isinstance(message.to_id, PeerChat):
return reply(str(-message.to_id.chat_id))
elif isinstance(message.to_id, PeerUser):
return reply(f"Your user ID is {message.from_id}.")
return reply(f"Your user ID is {message.to_id.user_id}.")
else:
return reply("Failed to find chat ID.")