skip to Main Content

At first i should emphasis that this is a question about telegram GROUP NOT CHANNEL.I need to get group id to send message via telgram api.
I have review this link .
using @rawDataBot needs to add bot to group, that is not possible most of the times. CuteGram does not login (does not send login code) .so i can say none of the proposed method works.

so is there a new method -except adding a bot to the group- to get telgram group ID ?

if the answer is no, i need to know if it is possible to send message to group by using group name?!

4

Answers


  1. You can get chat id throw object "chat"
    You can set middleware which handle new update
    Example on Node.JS: bot.on(‘text’, ctx => console.log(‘Chat id is:’, ctx.chat.id))
    P.S. group id and chat id are same

    Login or Signup to reply.
  2. if using a bot is acceptable, you can use @username_to_id_bot – no need to add it to a group, just send username or invite link and get the id

    Login or Signup to reply.
  3. the simplest way i found is

    • open web-telegram in a browser
    • right click on the group name on the left menu
    • click ‘inspect’ button
    • you will see the group id in the attribute data-peer-id="-xxxxxxxxxx" or peer="-xxxxxxxxxx"
    Login or Signup to reply.
  4. the easiest way is to add @chatBotRaw the bot will dump raw data, and you can copy their chat_id or anything else you need,

    Remember to remove the bot afterwards because it dumps raw data of every message sent/received in the group.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search