[英]why my node.js discord.js bot is not sending files? (no errors) (can send messages)
So, I built a discord.js/node.js bot.所以,我构建了一个 discord.js/node.js 机器人。 and added a command '$t getmsg' what I have tried:
并添加了我尝试过的命令“$ t getmsg”:
what the bot should do:机器人应该做什么:
what it does:它能做什么:
the pice of code that should send the file:应该发送文件的代码片段:
message.channel.send("ALL SAVED MESSAGES. if you can't see any files, I don't have permission to upload.", {
files: [
"./messages/savedmessages.txt",
"./messages/messages.txt"
]
});
channel.send only takes a maximum of one argument, if you have multiple, as you do, you must pass them all as an object. channel.send 最多只接受一个参数,如果你有多个,你必须将它们全部作为 object 传递。 That is to say you must add your message to the object like so:
也就是说,您必须像这样将您的消息添加到 object 中:
message.channel.send({
content: "ALL SAVED MESSAGES. if you can't see any files, I don't have permission to upload.",
files: [
"./messages/savedmessages.txt",
"./messages/messages.txt"
]
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.