MCPcopy Index your code
hub / github.com/CodeXBotz/File-Sharing-Bot / get_messages

Function get_messages

helper_func.py:41–61  ·  view source on GitHub ↗
(client, message_ids)

Source from the content-addressed store, hash-verified

39 return string
40
41async def get_messages(client, message_ids):
42 messages = []
43 total_messages = 0
44 while total_messages != len(message_ids):
45 temb_ids = message_ids[total_messages:total_messages+200]
46 try:
47 msgs = await client.get_messages(
48 chat_id=client.db_channel.id,
49 message_ids=temb_ids
50 )
51 except FloodWait as e:
52 await asyncio.sleep(e.x)
53 msgs = await client.get_messages(
54 chat_id=client.db_channel.id,
55 message_ids=temb_ids
56 )
57 except:
58 pass
59 total_messages += len(temb_ids)
60 messages.extend(msgs)
61 return messages
62
63async def get_message_id(client, message):
64 if message.forward_from_chat:

Callers 1

start_commandFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected