Discord.js V12 主题更改

3

我目前正在制作一个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"。 然而,它不会更新主题。主题仍然保持不变,并且没有更新。
1个回答

1

Discord最近更改了频道名称和主题的速率限制。 截至2020年5月28日,他们将编辑频道名称和主题的速率限制限制为每个频道每10分钟只能更新2次。他们曾经在他们的Discord开发者discord服务器中发布过此公告。


这是Discord关于速率限制的文档,根据您的设计可能会有所帮助:https://discord.com/developers/docs/topics/rate-limits - Alex Malcolm

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接