【发布时间】:2021-02-23 04:49:24
【问题描述】:
我目前正在为角色扮演栏编写一个不和谐机器人。当我告诉它时,我希望它关闭栏(即将发布权限仅限于我)。
代码如下:
const Discord = require("discord.js");
const bot = new Discord.Client();
bot.on("message", (message) => {
switch (message.content) {
case "Close down the bar for me":
if (message.author.discriminator == ) { // this isn't a typo i just haven't put it in for posting
message.postMessage("*Ushers people out, closes the cabinets, changes sign to closed, checks for stragglers, locks the doors, shuts the metal barriers, gets on motorbike and rides home*");
}
}
});
bot.login(''); // the token is meant to be here, I'm just not putting it on the internet!
我应该在 message.postMessage 之后添加什么来将默认聊天权限更改为不发帖?
【问题讨论】:
-
你到底想做什么,你得到什么错误?
-
正如我所说,我希望能够更改聊天的权限,这样没有人可以在上面发帖。我没有任何错误,因为我不知道从哪里开始。
-
你不是说
channel.sendMessage吗?
标签: javascript node.js discord