mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 12:04:51 +00:00
pyrofork: Refactor Message.link
Signed-off-by: wulan17 <wulan17@komodos.id>
This commit is contained in:
parent
969a2c0f55
commit
7c94fc8009
1 changed files with 7 additions and 2 deletions
|
|
@ -1314,9 +1314,14 @@ class Message(Object, Update):
|
|||
self.chat.type in (enums.ChatType.GROUP, enums.ChatType.SUPERGROUP, enums.ChatType.CHANNEL)
|
||||
and self.chat.username
|
||||
):
|
||||
if self.chat.type == enums.ChatType.SUPERGROUP and self.message_thread_id:
|
||||
return f"https://t.me/{self.chat.username}/{self.message_thread_id}/{self.id}"
|
||||
return f"https://t.me/{self.chat.username}/{self.id}"
|
||||
else:
|
||||
return f"https://t.me/c/{utils.get_channel_id(self.chat.id)}/{self.id}"
|
||||
if self.chat.type == enums.ChatType.PRIVATE:
|
||||
return f"tg://openmessage?user_id={self.from_user.id}&message_id={self.id}"
|
||||
if self.message_thread_id:
|
||||
return f"https://t.me/c/{utils.get_channel_id(self.chat.id)}/{self.message_thread_id}/{self.id}"
|
||||
return f"https://t.me/c/{utils.get_channel_id(self.chat.id)}/{self.id}"
|
||||
|
||||
@property
|
||||
def content(self) -> str:
|
||||
|
|
|
|||
Loading…
Reference in a new issue