G
G
GGatsby2018-10-28 17:54:49
Node.js
GGatsby, 2018-10-28 17:54:49

How to stop telegram bot function?

Have a function

bot.on('text', (ctx) => {
   console.log(ctx.message.text)
})

How to stop its execution so that it stops listening to what the user enters

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Shumov, 2018-10-28
@inoise

You have a handler. There are 2 parts - sending the event and handling the event.
If you want to disable processing, then just remove this block of code and restart the bot (or if it does nothing else, then interrupt the process altogether)
If you want not to receive traffic, then remove the address of your bot where it was configured

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question