Answer the question
In order to leave comments, you need to log in
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);
}
}
}
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question