When working with Telegraf.js How can I find out the chat ID to send a message when adding a bot into a group?
const Telegraf = Require ('Telegraf')
Const Config = Require ('./config.json')
Const Bot = New Telegraf (Config.Token)
Bot.start (((CTX) = & gt; ctx.reply ('Welcome'))
Bot.help ((CTX) = & gt; ctx.reply ('Send Me a Sticker'))
Bot.ON ('new_chat_members', (CTX) = & gt; console.log (CTX.Message.New_Chat_members))
Bot.Hears ('Hi', (CTX) = & gt; ctx.reply ('Hey There'))
Bot.Hears (/ Buy / I, (CTX) = & gt; ctx.reply ('buy-buy'))
Bot.telegram.sendMessage (Chat.ID, 'SD')
Bot.startPolling ()
Answer 1, Authority 100%
Easy, you just need to pull out from the CTX object. It turns out like this:
ctx.message.chat.id