简体   繁体   English

我不明白代码应该做什么?

[英]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?我真的不明白代码应该做什么,因为它说的是“message.reply”,但它应该回复什么消息?

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例如,如果您发送“嘿,我正在这个 discord 频道发送此消息”,则message

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

and the message variable in message.reply() is the message variable from the module.exports function above.message.reply()中的message变量就是上面module.exports function 中的message变量。

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("");当您将所有这些放在一起时, message.reply("")将使用您放在.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" .将回复频道中发送的消息,字符串为"Replying to this message"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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