(client, message)
| 61 | return messages |
| 62 | |
| 63 | async def get_message_id(client, message): |
| 64 | if message.forward_from_chat: |
| 65 | if message.forward_from_chat.id == client.db_channel.id: |
| 66 | return message.forward_from_message_id |
| 67 | else: |
| 68 | return 0 |
| 69 | elif message.forward_sender_name: |
| 70 | return 0 |
| 71 | elif message.text: |
| 72 | pattern = "https://t.me/(?:c/)?(.*)/(\d+)" |
| 73 | matches = re.match(pattern,message.text) |
| 74 | if not matches: |
| 75 | return 0 |
| 76 | channel_id = matches.group(1) |
| 77 | msg_id = int(matches.group(2)) |
| 78 | if channel_id.isdigit(): |
| 79 | if f"-100{channel_id}" == str(client.db_channel.id): |
| 80 | return msg_id |
| 81 | else: |
| 82 | if channel_id == client.db_channel.username: |
| 83 | return msg_id |
| 84 | else: |
| 85 | return 0 |
| 86 | |
| 87 | |
| 88 | def get_readable_time(seconds: int) -> str: |
no outgoing calls
no test coverage detected