我是一个新的制造Discord.js机器人,我一直收到这样的错误:机器人现在在线!
HIT
C:\Users\kerix\Desktop\MrMiner\bot\index.js:20
let commandMethod = commands.get(name);
^
ReferenceError: commands is not defined
at Client.<anonymous> (C:\Users\kerix\Desktop\MrMiner\bot\index.js:20:25)
at Clien
当我添加"wiezienie.send ("test");“函数时,我开始弹出一个错误。我的错误是: TypeError: Cannot read property 'send' of undefined
at Object.run (C:\Users\User\Desktop\ZukBot-master\src\commands\warn.command.js:63:19)
at Client.<anonymous> (C:\Users\User\Desktop\ZukBot-master\src\handlers\com
我正在使用discord.js,我有一个代码,如果有人在https://top.gg上投票给我的机器人,机器人将发送一条消息,但它得到了这个错误 Web process failed to bind to $PORT within 60 seconds of launch 下面是我的代码: const Discord = require('discord.js')
const bot = new Discord.Client();
const DBL = require('dblapi.js');
const dbl = new DBL(process.en
在Discord.Js 12版本之前,我的用户验证功能是这样的:
if (!discord.guilds.get(guilds_id).member(user_id).hasPermission("ADMINISTRATOR")) return `you are not an admin!`
现在从Discord.Js 12版本。她不再为我工作了。
我试图用新的discord.js版本编写一个机器人,但是当我尝试登录时,它会提示我这个错误
/home/max/Schreibtisch/Discord Bots/Perplex/node_modules/discord.js/src/util/Util.js:279
if (!Object.hasOwn(given, key) || given[key] === undefined) {
^
TypeError: Object.hasOwn is not a function
at mergeDefault (/home/max/Schrei
我不断地发现错误:
for(i=0; i<num; i++){
^
ReferenceError: i is not defined
at Client.<anonymous> (/home/runner/Ploatjs/dist/index.js:52:18)
at Client.emit (node:events:402:35)
at Client.emit (node:domain:475:12)
at MessageCreateAction.handle (/home/runner/Ploatjs/node_modules/d
我在node.js上用JSON作为数据库(我知道我可能不应该对数据库使用JSON,但我现在不想设置一个实际的数据库)编写一个简单的discord.js,其中只有一个命令"!click“。当你在行会中点击“!”时,它会检查你的不和谐id在数据库中是否有点击,如果你没有点击值设置为1,如果你点击,那么你的clicks+=1。问题是当我检查用户是否有undefined点击。在使用if(data[personid].clicks === undefined)进行检查时,我得到了TypeError: Cannot read property 'MyDiscordId' of un
当试图让我的机器人删除一条消息时,我使用命令=m p "some song"得到了这个错误:
DiscordAPIError: Unknown Message
at RequestHandler.execute (C:\poe-sieglind\node_modules\discord.js\src\rest\RequestHandler.js:298:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async RequestHandler.push
你好,我对覆盖类型有问题。
我想要覆盖一个从libary中添加属性到其他库的类型的类型,行是:
在我的代码中,我声明如下:
declare module 'discord.js' {
export interface Message {
util?: KopekUtil;
}
}
KopekUtil正在扩展CommandUtil,我得到的错误是:
TS2717: Subsequent property declarations must have the same type. Property 'util' must be of
我正在与Node.js和discord.js制造一个不和谐的机器人。我输入节点index.js,它说:
const client = new Discord.Client({
^
SyntaxError: Identifier 'client' has already been declared
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1033:15)
at Module._compile