mast / telegram-bot-api

First Telegram Bot API node.js library
http://mast.github.io/telegram-bot-api/
MIT License
245 stars 65 forks source link

Adding a bot to the group and let it send messages without user input #51

Closed tiborhercz closed 4 years ago

tiborhercz commented 6 years ago

I would like to have my bot within a group/or channel and let it send messages to the group or channel.

var api = new telegram({ token: 'MY_TOKEN_HERE', updates: { enabled: true } }); api.sendMessage({ chat_id:, text: 'test TEXT' })

Right now the bot is sending the messages to the bot itself but not in the group where I added it as an admin. I also already change the privacy settings of the bot so it can see all messages.

realestninja commented 6 years ago

Did you insert the groups chat ID? Its a negative number.

mast commented 4 years ago

Closing this issue. You need to use proper chat_id for that.