Answer the question
In order to leave comments, you need to log in
How to find the id of a group chat in telegram?
Hello.
I need a telegram bot to send messages to a group chat. As I understand it, for this you need to get its id. But how to do that?
I found out the IDs of single chats using "getUpdates" and successfully sent messages to them with "sendMessage". The same method, judging by the documentation, is suitable for sending messages to groups.
Answer the question
In order to leave comments, you need to log in
when someone writes to the chat, json comes to the web server with the bot (values do not exist):
{"update_id":6567567, "message":{"message_id":5112,"from":{"id": 2222222,},"chat":{"id":-33333333,"title":"dobry chat"},"date":1442350000,"text":"hello"}}
2222222 - id of the user who wrote the message
-33333333 - group-chat id
You can try adding @myidbot to the telegram group. It has the necessary commands to get the group and user ID.
For those who need to get their id or chat id in telegram, I suggest using the @m4n_idbot bot .
Write comments if you need more information :)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question