Telethon: message id is not unique

Created on 30 Oct 2019  路  3Comments  路  Source: LonamiWebs/Telethon

here is docs about message_id
https://python-telegram-bot.readthedocs.io/en/stable/telegram.message.html

message_id

Unique message identifier inside this chat.
Type:   int

from_user

Optional. Sender.
Type:   telegram.User

But it is not unique message in different group or channel
My mongo data set:
/* 1 */
{
"_id" : ObjectId("5c07e632d24c3b1b55c6f637"),
"id" : 250,
"channel_id" : 11xxxx757,
"data" : null,
"date" : ISODate("2019-09-09T16:23:46.000Z"),
"from_id" : 907857165,
"is_bot" : "not_bot",
"username" : "name one"
}

/* 2 /
{
"_id" : ObjectId("5c0dca41ce0964062477507d"),
"id" : 250,
"channel_id" : 0,
"data" : "FreeGroup Just tweeted
********data",
"date" : ISODate("2018-12-05T22:51:26.000Z"),
"from_id" : null,
"is_bot" : "default_is_not_bot",
"username" : "default_username"
}
How to get unique id in different group or channel

Most helpful comment

Every channel has message IDs starting from 1, and these are the same for all accounts within every channel.

In private chats and small group chats, every account has its own message counter so message IDs will generally differ between accounts there.

All 3 comments

  1. You linked to Python-Telegram-Bot's documentation, which is completely different from Telethon.
  2. This issues it not related to Telethon.
  3. Message IDs are unique per channel and otherwise unique per account. Different channels will obviously share the same IDs, but they're unique within the channel.

Thx, Message IDs are unique per channel and otherwise unique per account. Different channels will obviously share the same IDs, but they're unique within the channel.
They are unique or not within the channel in a month ?

Every channel has message IDs starting from 1, and these are the same for all accounts within every channel.

In private chats and small group chats, every account has its own message counter so message IDs will generally differ between accounts there.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

saharokk picture saharokk  路  3Comments

Lerbytech picture Lerbytech  路  5Comments

mircoianese picture mircoianese  路  3Comments

justxor picture justxor  路  4Comments

aminhyper picture aminhyper  路  3Comments