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
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.
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.