S
S
soofftt912015-08-31 22:46:09
Telegram
soofftt91, 2015-08-31 22:46:09

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

3 answer(s)
I
indalive, 2015-09-16
@soofftt91

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

D
danforth, 2017-10-25
@danforth

You can try adding @myidbot to the telegram group. It has the necessary commands to get the group and user ID.

M
Maksim Novikov, 2020-05-21
@mixerok95

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 question

Ask a Question

731 491 924 answers to any question