Fix /id command in private chats
This commit is contained in:
@@ -570,7 +570,8 @@ class AbstractUser(ABC):
|
|||||||
if self.is_relaybot:
|
if self.is_relaybot:
|
||||||
if update.is_private:
|
if update.is_private:
|
||||||
if not self.config["bridge.relaybot.private_chat.invite"]:
|
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
|
return
|
||||||
elif not portal.mxid and self.config["bridge.relaybot.ignore_unbridged_group_chat"]:
|
elif not portal.mxid and self.config["bridge.relaybot.ignore_unbridged_group_chat"]:
|
||||||
self.log.debug(
|
self.log.debug(
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ class Bot(AbstractUser):
|
|||||||
elif isinstance(message.to_id, PeerChat):
|
elif isinstance(message.to_id, PeerChat):
|
||||||
return reply(str(-message.to_id.chat_id))
|
return reply(str(-message.to_id.chat_id))
|
||||||
elif isinstance(message.to_id, PeerUser):
|
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:
|
else:
|
||||||
return reply("Failed to find chat ID.")
|
return reply("Failed to find chat ID.")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user