Send message to a telegram group with nodejs


telegram_msg.js script

Browse to and start a chat with botfather type / and create a new bot, get the bots api token

add the apitoken to line 8 of the telegram_msg.js script

Add your new bot to the group you want to message

Send a message you the group in the web interface.

Now we need to find the groups chatid,

Browse to:

replace XXX;YYYY with the api you received above

In the output you should see the chat id in the json return above:

now you can run

node telegram_msg.js <chatid> “testing”

and the message testing will get sent to the group

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s