There are 3 types in telethon:
All of three types have an ID attribute. Can i store them inside one column in database and make that column unique? Or there can be duplicate ids between these three types?
Yea you can do that. ID is a unique identifier in Telegram.
A simple way to check that is to take a look at sendMessage in Bot APIs. You can see that target chat is just recognized by its ID and it doesn't need any extra information about the type of that target chat.
users and normal chats(normal groups not supper group) have positive id. and channels (include supper groups and broadcast channels) have negative id (for example: -1001050484879). in some methods, telethon return channel id as positive number (for example 1050484879, remove -100 from first of id) you must add -100 at first of ids of channel then save them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With