【发布时间】:2021-07-27 17:18:01
【问题描述】:
我希望机器人复制用户在输入消息后发送的号码,这是我的代码
client.on('message', (message) => {
// Command handler, seen previously
if (message.content === '#مسعف') {
message.channel
.awaitMessages((m) => m.author.id == message.author.id, { max: 1 })
.then((collected) => {
// only accept messages by the user who sent the command
// accept only 1 message, and return the promise after 30000ms = 30s
// first (and, in this case, only) message of the collection
if (message.content = 1 - 10000) {
message.channel.send(message.content);
}
});
}
});
我需要机器人发送用户输入的号码
【问题讨论】:
-
你觉得这个检查什么?
if (message.content = 1-10000) -
用户输入的数字1-10000? @ZsoltMeszaros
-
嘿@asdddd 我试图在下面为您提供答案。你有机会去看看吗?有意义吗?如果回答有用,请点击其左侧的点赞按钮(▲)。如果它回答了您的问题,请单击复选标记 (✓) 接受它。这样别人就知道你得到了帮助。另见What should I do when someone answers my question?
标签: javascript discord.js