DiscordAPIError[30034]:已达到每日创建应用程序命令的最大次数(200)


DiscordAPIError[30034]: Max number of daily application command creates has been reached (200)
at SequentialHandler.runRequest (D:SetupsJulian-VNodeJSVSCode-DjsV14node_modules@discordjsrestdistlibhandlersSequentialHandler.cjs:293:15)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async SequentialHandler.queueRequest (D:SetupsJulian-VNodeJSVSCode-DjsV14node_modules@discordjsrestdistlibhandlersSequentialHandler.cjs:99:14)     
at async REST.request (D:SetupsJulian-VNodeJSVSCode-DjsV14node_modules@discordjsrestdistlibREST.cjs:52:22)
at async D:SetupsJulian-VNodeJSVSCode-DjsV14functionsutilitiesloadCommands.js:51:9 {
rawError: {
message: 'Max number of daily application command creates has been reached (200)',
code: 30034
},
code: 30034,
status: 400,
method: 'PUT',
url: 'https://discord.com/api/v10/applications/995949416273940623/commands',
requestBody: {
files: undefined,
json: ....

这是代码:

(async () => {
const { REST, Routes } = require('discord.js');
const rest = new REST({ version: '10' }).setToken(process.env.token);
console.log('nStarted refreshing application (/) commands.n');
await rest.put(Routes.applicationCommands(clientID), { body: slashArray });
console.log('nSuccessfully reloaded application (/) commands.n');
})();

我下一步可以尝试什么?它仍然适用于replit,但当我在vscode中运行时,它显示了这个错误。

Discord限制了您的速率,因为您只能添加这么多应用程序命令。你可以等到速率限制结束,也可以转到公会命令进行测试。新代码看起来是这样的:

(async () => {
const { REST, Routes } = require('discord.js');
const rest = new REST({ version: '10' }).setToken(process.env.token);
console.log('nStarted refreshing application (/) commands.n');
await rest.put(Routes.applicationGuildCommands(clientID, guildID), { body: slashArray });
console.log('nSuccessfully reloaded application (/) commands.n');
})();

此代码只会将斜杠命令添加到由guildID变量指定的公会中,这也只有在机器人有权在该公会上添加应用程序命令的情况下才有效。

相关内容

最新更新