我有一条消息希望机器人发送,但是为了保持聊天状态整洁,我想删除调用该命令的消息:我该怎么做?
这是消息的当前代码:
if (message.content.toLowerCase().includes("<@botsnumberidhere> what are the numbers")) {
message.channel.send("This is good, real good.", {
file: "https://domainforimage.com/image0.jpg" // Or replace with FileOptions object
});
}
答案 0 :(得分:0)
您可以使用Message.delete()
删除邮件。请注意,这将告诉Discord您要删除该消息,但是您仍然可以访问以前存储的message
变量的属性。
if (message.content.toLowerCase().includes("<@botsnumberidhere> what are the numbers")) {
message.delete(); // You can put it here.
message.channel.send("This is good, real good.", {
file: "https://domainforimage.com/image0.jpg"
});
}