Node-telegram-bot-api: send message to group or channel

Created on 31 Jul 2017  路  7Comments  路  Source: yagop/node-telegram-bot-api

when i search about this topic in google, people says just send group or channel name insist of chatID
like this

sendMessage('@testGroup','message')

but it's not work .
how can i send message to a channel ro group by my bot
thanks

question

Most helpful comment

@milad145 bot.getChat('@username')

All 7 comments

use chat_id as first argument.
Like:

bot.sendMessage(-102324354, 'Hello World!');

@Assada
but how can i find channel ID?

@milad145 bot.getChat('@username')

Also, tgfancy supports sendMessage('@testGroup','message') out of the box.

tgfancy is basically node-telegram-bot-api on steroids.
tgfancy is a drop-in replacement!

@GingerPlusPlus
thanks, it was helpfull

Hi again,
i create a message with inlineKyboards
and one of keyboards is sendToAnother
is it possible when i click sendToAnother, i can choose user from my contacts
and bot get the member(or channel or group) id?

@milad145 Please create a new issue for this new query, to avoid much confusion for devs exploring issues.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mbrammer picture mbrammer  路  3Comments

Kasra-S picture Kasra-S  路  3Comments

Dohoon-Kim picture Dohoon-Kim  路  3Comments

jacopocappelli1989 picture jacopocappelli1989  路  4Comments

antonrifco picture antonrifco  路  3Comments