Telegram Chat ID vs Peer ID: Telethon Guide
Refer to the Telethon official documentation https://docs.telethon.dev/en/stable/concepts/chats-vs-channels.html ID is something like this 4011678806 2079829990 6702958858 If you use Forkgram on the desktop, you can see these IDs directly on the interface While Peer ID is like this: 460693903 -4016131921 -1002079829990 Numbers without a sign mean this is a user, a bot is a type of user. If the number has a minus sign in front, it is a private group. If the number has -100 in front, it is a channel, or a public group. When you use the web version of Telegram, you can find such IDs in the browser's address bar When using the Telethon framework, chat_id is the Peer ID. For example, @client.on(events.MessageEdited) @client.on(events.NewMessage()) async def on_greeting(event): real_id, peer_type = resolve_id(event.chat_id) # Convert to the official real id print(f"event.chat_id {event.chat_id}") print(f"real_id {real_id}") The command line prints someth...