这是一个创建于 728 天前的主题,其中的信息可能已经有所发展或是发生改变。
有没有大佬 开发过 discord 的 bot 啊,我总是遇到如下报错
<> node index.js
RequestAbortedError [AbortError]: Request aborted
at abort (/Users/cx/discord_bot/node_modules/undici/lib/api/abort-signal.js:10:18)
at self.<computed> (/Users/cx/discord_bot/node_modules/undici/lib/api/abort-signal.js:29:5)
at [nodejs.internal.kHybridDispatch] (node:internal/event_target:645:20)
at AbortSignal.dispatchEvent (node:internal/event_target:587:26)
at abortSignal (node:internal/abort_controller:292:10)
at AbortController.abort (node:internal/abort_controller:322:5)
at Timeout.<anonymous> (/Users/cx/discord_bot/node_modules/@discordjs/rest/dist/index.js:515:73)
at listOnTimeout (node:internal/timers:564:17)
at process.processTimers (node:internal/timers:507:7) {
code: 'UND_ERR_ABORTED'
}
代码如下:
const { Client, GatewayIntentBits } = require("discord.js");
const client = new Client({
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages]
});
const TOKEN =
"MTA0......";
client.on("ready", () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.login(TOKEN).catch(console.error);
求教
1 条回复 • 2023-05-11 23:36:47 +08:00