所以最近我收到了标题中的错误。我不确定是什么导致了这个问题,大约一周前它随机停止了机器人的工作。我已经完成了谷歌搜索,但仍然没有找到解决这个问题的正确方法。我已在完整错误的粘贴箱下方链接以及我当前使用的不和谐机器人的链接。我已经与该机器人的开发人员交谈过,目前正在使用它的人没有任何问题。这似乎是我这边的问题。如果有人可以帮助我解决这个问题,我将不胜感激。
https://github.com/yannickgloster/discord-10man
OSError: [WinError 121] The semaphore timeout period has expired
Run Code Online (Sandbox Code Playgroud)
帮我在有人时发送消息Boost The Server,例如这里有一些代码。请帮帮我,伙计们:)
bot.on('guildMemberUpdate', (oldMember, newMember) => {
if(oldMember.roles.size < newmember.roles.size) {
const fetchedLogs = await oldMember.guild.fetchAuditLogs({
limit: 1,
type: 'MEMBER_ROLE_UPDATE',
});
const roleAddLog = fetchedLogs.entries.first();
if (!roleAddLog ) return;
const { executor, target, extra } = kickLog;
console.log(`Role ${extra.name} added to ${<@target.id>} by ${<@executor.id>}`)
}
});
Run Code Online (Sandbox Code Playgroud) 突然之间,我在大多数交互中不断收到此错误,并且我的机器人只是发送“机器人正在思考......”。
\n[UnhandledRejection] DiscordAPIError: Unknown interaction\n at RequestHandler.execute (/Users/main/Desktop/Discordbots/gamerscavern/node_modules/discord.js/src/rest/RequestHandler.js:349:13)\n at processTicksAndRejections (node:internal/process/task_queues:96:5)\n at async RequestHandler.push (/Users/main/Desktop/Discordbots/gamerscavern/node_modules/discord.js/src/rest/RequestHandler.js:50:14)\n at async SelectMenuInteraction.reply (/Users/main/Desktop/Discordbots/gamerscavern/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:98:5)\nRun Code Online (Sandbox Code Playgroud)\n示例此帮助命令。interaction.update()当另一个用户与收集器和过滤器中的部件交互时,它会返回未知的交互。我不知道为什么会发生这种情况。正如所提到的,就在几个小时前,它还运行良好。
这是我的代码:
\n帮助命令:
\nconst {\n Client,\n Message,\n MessageEmbed,\n MessageActionRow,\n MessageSelectMenu,\n} = require(\'discord.js\');\n\nmodule.exports = {\n name: \'help\',\n description: \'List all of my commands or info about a specific command.\',\n aliases: [\'commands\'],\n usage: \'[command name]\',\n category: \'info\',\n cooldown: 3,\n /**\n *\n * @param {Client} client\n * @param {Message} message\n * @param {String[]} args\n */\n execute: async …Run Code Online (Sandbox Code Playgroud) 基本上,当我node .在命令提示符下运行时,不会输出任何内容。
我的代码:
const Discord = require("discord.js");
const client = new Discord.Client({ intents: ["GUILDS", "GUILD_MESSAGES"] });
client.on("ready", () => {
console.log(`Logged in as ${client.user.tag}`);
});
//My key is located here but I've taken it out for obvious reasons
client.login = "key";
Run Code Online (Sandbox Code Playgroud)