yagop / node-telegram-bot-api

Telegram Bot API for NodeJS
MIT License
8.45k stars 1.53k forks source link

How to send message to group #829

Closed ssheduardo closed 2 years ago

ssheduardo commented 4 years ago

Hello, I have created a group and added to the bot as an administrator. How do I send a message to the bot to be displayed in the group?

sahanisejal commented 4 years ago

Haw to install Linux in Android

ssheduardo commented 4 years ago

@sahanisejal ????

pazone commented 4 years ago

Go to the start page of this repository and take a look at the Usage chapter. You can find this: bot.sendMessage(chatId, resp);

johnsonsalam commented 4 years ago

Haw to install Linux in Android

termux

2aviv20 commented 3 years ago

how do you found the "chatId" of gorup?

Seventty commented 3 years ago

how do you found the "chatId" of gorup?

The chat ID it's contained in the object message, the full tag is: message.chat.id

A reference command test should be:

bot.onText(/^\/test/, message => {
    bot.sendMessage(message.chat.id, "Hellow you, this is a test command");
});