R
R
Roma Gorbunov2021-05-01 20:46:30
Node.js
Roma Gorbunov, 2021-05-01 20:46:30

How can I make the bot send me a message that I sent to him?

bot.on('message', async msg => {
    let prefix = '*'
    if (msg.content.toLowerCase().startsWith(prefix)) {
      let m = msg.content.slice(prefix.length);
      for (let cname in commands) {
        if (m.startsWith(cname)) {
          let args = m.slice(cname.length).split(' ').filter(Boolean);
          commands[cname].run(bot, msg, args);
        }
      }
    }
  })

this function needs to be redone for telegram (telegraf)
thanks in advance to everyone for the help

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question