我目前正在制作一个Discord机器人,可以让你主持“西蒙说”活动!然而,目前我遇到了一个问题:
如果你执行, ss startevent (开始新事件的命令),我运行以下代码:
if (args[0].toLowerCase() === "startevent") {
if (permissionLevel(message.member) < 4) return message.channel.send("**Error:** You don't have permission to do this!");
var ssChannel = message.guild.channels.cache.find(ch => ch.name === "simon-says");
if (!(ssChannel)) return message.channel.send("**Error:** Couldn't find the Simon Says channel!");
if (!(eventStatus(ssChannel) === "Inactive")) return message.channel.send("**Error:** There is already an event active!");
// ssChannel.updateOverwrite(message.guild.roles.cache.find(role => role.name === "Verified"), {
// SEND_MESSAGES: false,
// VIEW_CHANNEL: true,
// READ_MESSAGE_HISTORY: true
// });
var startingTopic = updateStatus(ssChannel, "Starting");
ssChannel.setTopic(startingTopic);
ssChannel.setTopic("**DEBUG**");
message.channel.send("**Succesfully started a new Simon Says event!**");
ssChannel.send(`Starting a new **Simon Says** event in **5 minutes**! To enter the event, go to <#703168301634945097> and type: **${prefix}ss enter**!`);
setTimeout(function () {
ssChannel.send(`Starting a new **Simon Says** event in **1 minute**! To enter the event, go to <#703168301634945097> and type: **${prefix}ss enter**!`);
setTimeout(function () {
ssChannel.updateOverwrite(message.guild.roles.cache.find(role => role.name === "SS: Participant"), {
SEND_MESSAGES: true,
VIEW_CHANNEL: true,
READ_MESSAGE_HISTORY: true
});
ssChannel.updateOverwrite(message.guild.roles.cache.find(role => role.name === "Verified"), {
SEND_MESSAGES: false,
VIEW_CHANNEL: false,
READ_MESSAGE_HISTORY: false
});
var activeTopic = updateStatus(ssChannel, "Active");
ssChannel.setTopic(activeTopic);
ssChannel.send(`The **Simon Says** event has started! You can now talk!`);
ssChannel.send("[<@&787000309108965418>]")
}, 60000)
}, 240000)
}
所以,你可以看到我更新了频道的主题,为了调试,我甚至将其更改为"DEBUG"。 然而,它不会更新主题。主题仍然保持不变,并且没有更新。