【发布时间】:2021-04-17 11:08:11
【问题描述】:
我目前正在开发一个将消息固定在文本文件中以绕过不和谐服务器中的消息 pin 限制的机器人,我的系统通过让用户使用 -pin 回复消息来工作,它将保存该消息和文本文件中的消息作者。问题是我不知道如何获取回复消息的内容和该消息的作者。任何帮助将不胜感激。
if(command === 'pin'){
message.channel.send('Ok, pinning that. Use -seepins to see all the pins.'),
//i have no clue how to get the message that was replied to please help let pinned =
//im begging you please i have no idea let pinnedauthor = message.
fs.writeFile('messages.txt', pinned + ' written by ' + pinnedauthor + '\n', (err) => {
if (err) throw err;
});
}
这是我目前拥有的。我只需要找出如何获得第一段中提到的两件事,它应该可以工作。
感谢您的帮助,感谢您阅读本文。
【问题讨论】:
标签: discord discord.js