简体   繁体   中英

I don't understand what the code is suppose to do?

module.exports = (client, message, args) => { 
  message.reply("Pong!");
}

What is it replying to? I really don't understand what the code is supposed to do cause it say's "message.reply" but what message is it supposed to reply to?

The message string from which was sent in a channel,

For example, if you sent "Hey, I am sending this message in this discord channel", is message

module.exports = (client, "message", args) => { 
...
}

and the message variable in message.reply() is the message variable from the module.exports function above.

And when you put all of that together, message.reply("") would respond to the message that was sent in a channel with the arguments you put inside of .reply(""); .

Example:

message.reply("Replying to this message"); would reply to the message that was sent in a channel, with the string of "Replying to this message" .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM