Answer the question
In order to leave comments, you need to log in
How to force a bot to send a message to a channel?
I am writing a bot for a cart on a node. I use telegraph. I can't figure out how to get the bot to send a message to my channel
Answer the question
In order to leave comments, you need to log in
It doesn't really matter what you write on. in this case, you need to add the bot to the channel and make it an admin, with the ability to add posts. then send messages not to the bot but by channelId.
For example, on node.js you need to make a variable with the channel id, for example:
const Channelid = [channel id];
bot.onText( '/\/write (.+), (msg, match) => {
bot.sendMessage( Channelid, match [1] );
});
/write hello world!
The channel will only contain text.
And by the way, right, before that you need to add a bot to the channel and make it an admin
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question