因此,我正在开发一个discord.js,它使用discord.js,一个用于discord.js的node.js包装器。基本上,代码是这样工作的:
/*
A ping pong bot, whenever you send "ping", it replies "pong".
*/
// import the discord.js module
const Discord = require('discord.js');
// create an instance of a Discord Client, and call it bot
我在研究这个机器人。我使用了示例机器人中的ping模板,但当我使用命令时,它不起作用。
(node:5696) UnhandledPromiseRejectionWarning: ReferenceError: content is not defined
at Client.<anonymous> (D:\bipbot\index.js:18:5)
at Client.emit (events.js:210:5)
at MessageCreateHandler.handle (D:\bipbot\node_modules\discord.js\src\cl
你好,我正在尝试编写我的第一个机器人,特别是一个命令,让它给出它的ping和API的ping,但当我启动机器人时,我遇到了这个错误,我不知道如何修复它 waiting = await message.channel.send("Je calcule le ping...").catch(console.error);
^^^^^
SyntaxError: await is only valid in async function 目前的代码是: const Discord = require ("discord.j
我想尝试一个命令处理程序,但是我有一个错误。如果运行,ping,bot是响应,但如果运行,,则会得到一个错误,这是日志:
TypeError: Cannot read property 'execute' of undefined
at Client.<anonymous> (C:\Users\User\disbot\app.js:35:33)
at Client.emit (node:events:394:28)
at MessageCreateAction.handle (C:\Users\User\disbot\node_modules\discord.js\
我正在使用discord.js v12+,我试图编辑机器人发送的嵌入,但是得到了这个错误:
Uncaught Promise Error:
DiscordAPIError: Cannot edit a message authored by another user
at RequestHandler.execute (c:\Users\Kazzu\Desktop\ImmortusMC\node_modules\discord.js\src\rest\RequestHandler.js:170:25)
at processTicksAndRejections (interna
我正在学习制造一个不和谐的机器人,我遇到了一个我无法解决的错误.我试图用数组中的对象创建多个命令。在不使用数组的情况下,我只执行一个对象时,它就处于阻塞状态,但一旦创建了数组并插入了2个命令,它就会抛出以下错误:
I:\botDiscord\secondo-bot\node_modules\discord.js\src\rest\RequestHandler.js:350
throw new DiscordAPIError(data, res.status, request);
^
DiscordAPIError: Invalid Form Body
na