File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -55,4 +55,28 @@ async def get_messages(client, message_ids):
5555 messages .extend (msgs )
5656 return messages
5757
58+ async def get_message_id (client , message ):
59+ if message .forward_from_chat :
60+ if first_message .forward_from_chat .id == client .db_channel .id :
61+ return first_message .forward_from_message_id
62+ else :
63+ return 0
64+ elif first_message .forward_sender_name :
65+ return 0
66+ elif first_message .text :
67+ pattern = "https://t.me/(?:c/)?(.*)/(\d+)"
68+ matches = re .match (pattern ,first_message .text )
69+ if not matches :
70+ return 0
71+ channel_id = matches .group (1 )
72+ msg_id = int (matches .group (2 ))
73+ if channel_id .isdigit ():
74+ if f"-100{ channel_id } " == str (client .db_channel .id ):
75+ return msg_id
76+ else :
77+ if channel_id == client .db_channel .username :
78+ return msg_id
79+ else :
80+ return 0
81+
5882subscribed = filters .create (is_subscribed )
You can’t perform that action at this time.
0 commit comments