Support replying directly to messages
This commit is contained in:
parent
6442469437
commit
812e3dc7a7
1 changed files with 35 additions and 1 deletions
|
|
@ -19,7 +19,12 @@ client.on('ready', () => {
|
|||
client.on('message', (msg) => {
|
||||
console.log('MESSAGE RECEIVED', msg);
|
||||
|
||||
if (msg.body == 'ping') {
|
||||
if (msg.body == 'ping reply') {
|
||||
// Send a new message as a reply to the current one
|
||||
msg.reply('pong');
|
||||
|
||||
} else if (msg.body == 'ping') {
|
||||
// Send a new message to the same chat
|
||||
client.sendMessage(msg.from, 'pong');
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue