所以我做了一个不和谐的机器人,我在切分我修复的东西时遇到了问题。但现在我有一个不同的问题,使我的机器人无法运行。当我尝试运行它时,我得到了这个错误。
[WS => Manager] Manager was destroyed. Called by:
Error: MANAGER_DESTROYED
at WebSocketManager.destroy (/root/node_modules/discord.js/src/client/websocket/WebSocketManager.js:333:54)
at Client.destroy (/root/node_m
我在编写我的不和谐机器人代码时遇到了问题。每当我运行这段代码时: const Constants = require('discord.js/src/util/Constants.js')
Constants.DefaultOptions.ws.properties.$browser = `Discord iOS` 我一直收到这个错误。 Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './src/util/Constants.js' is not defined by \"export
node:v16.11.0 "discord.js": "^13.2.0" 我正在设置一个示例Discord.js机器人。 在this guide中,我要添加这一行: client.commands = new Collection(); Typescript然后抱怨:Property 'commands' does not exist on type 'Client<boolean>' This answer似乎和我想要的是一样的。然而,我仍然遇到了一些问题。如果我添加一个declare module "d
当我试图创建一个Discord.js命令处理程序时,我遇到了这个错误。我该如何解决这个问题呢?我检查了一下我的app.js,没有问题。 我的绑定代码: // Ignore all bots
if (message.author.bot) return;
// Ignore messages not starting with the prefix (in config.json)
if (message.content.indexOf(client.config.prefix) !== 0) return;
// Our standard argu
我是discord.js v14.0.3新手,尝试启动一个简单的命令,但是我遇到了一个错误。我检查了我的BOT_TOKEN,BOT_CLIENT_ID,GUILD_ID是有效的,我认为这个问题与那些令牌无关,我如何修复它?
错误消息
> node register.js
/register.js:11
(async () => {
^
TypeError: (intermediate value).setToken(...) is not a function
at Object.<anonymous> ....
我的代码
require("dote
在编写discord.js机器人代码时,我遇到了这个错误。
TypeError: message.guild.createRole is not a function
at Object.module.exports.run (/app/commands/myakish.js:7:36)
at Client.bot.on (/app/bot.js:70:7)
at Client.emit (events.js:189:13)
at MessageCreateAction.handle (/rbd/pnpm-volume/9ebd7b80-3cef-449a-8d
client.on("roleCreate", role => {
const channel = role.guild.channels.cache.find(ch => ch.name === "welcome");
const embed = new Discord.MessageEmbed()
.setColor("DEFAULT")
.setDescription(`A new role has been created\nPermissions List: ${role.permissions}`
因此,我做了这个踢命令,我完成了它的编码。现在我得到了这个错误,完全不知道如何修复它。我在网上搜索了一个小时,仍然不知道问题在哪里。
以下是错误:
TypeError: options.getMember is not a function
at Object.execute (/Users/Aplex/Documents/Aplel/Commands/Moderation/kick.js:32:32)
at Object.execute (/Users/Aplex/Documents/Aplel/Events/Interaction/interactionCreate.js:
“无法找到模块”内部/util/type是我遇到的错误,我正在尝试构建一个discord.js机器人并将其推到heroku
错误提示= A module may be missing from 'dependencies' in package.json
我需要的模块代码
require('dotenv').config();
const Discord = require('discord.js')
我的package.json依赖关系
"dependencies": {
"discord.js":
我想知道如何在discord.js中编写嵌入。这是我当前的代码:它没有功能。我收到警告:“在message.channel.send上没有定义消息”,我不知道如何解决这个问题。我希望你们能告诉我怎么解决这个问题。js
// Embeding the image in An Embeded message
const EmbededTweet = new MessageEmbed()
.setColor('0x00FF00')
.setTitle(`You made ${account} tweet this:`)
.set
我对discord.js编码非常陌生,我自己也有能力为我的discord.js机器人创建一个仪表板,但我遇到了这个问题,我不知道如何解决它,有人能帮我吗?如果你想要一些其他的文件,我会添加它们!有错误的代码:
MenuWrapper index.jsx
import React from 'react';
import { Link } from "react-router-dom";
export function MenuComponent( {
guilds,
}) {
我试图使用JSDoc来记录我正在制作的机器人的一些功能:
const Discord = require("discord.js");
/**
* Returns and empty embed with the bot's default settings
* @param u - The user that executed the command
* @returns {Discord.RichEmbed}
*/
exports.getDefaultEmbed = function(u) {
let embed = new Discord.Ric
所以我去启动了我的discord.js机器人,然后显示了这个错误。
throw new RangeError('BITFIELD_INVALID', bit);
^
RangeError [BITFIELD_INVALID]: Invalid bitfield flag or number: undefined.
at Function.resolve (/home/container/node_modules/discord.js/src/util/BitField.js:152:11)
at /home/container/node_modul
我一直收到这个错误
C:\WINDOWS\Temp\OneDrive\Documents\microsoft\node_modules\discord.js\src\client\Client.js:544
throw new TypeError('CLIENT_MISSING_INTENTS');
^
TypeError [CLIENT_MISSING_INTENTS]: Valid intents must be provided for the Client
但当我添加它时,它会显示客户端已声明
const Discord = require(
好了,我一直在开发一个机器人,它可以使用discord.js创建通道覆盖。我对discord.js比较陌生,但是我看了这个纪录片,似乎在更改覆盖时使用的正确方法是我在下面的代码中使用的方法,但我得到了一个错误消息,并且我完全不知道如何修复它。 if (command == 'lockdown') {
if (commandArgs == '') {
let channel = msg.channel;
let roles = msg.guild.roles;
console.log(roles);
let testRole = 7083847
我尝试在基于的“不和谐”上创建一个嵌入消息,并遇到了以下问题:
RangeError [EMBED_AUTHOR_NAME]: MessageEmbed author name must be a string.
at Function.verifyString (D:\Kien Thuc\IT\HTML CSS JAVASCRIPT\DiscordBot\node_modules\discord.js\src\util\Util.js:413:41)
at MessageEmbed.setAuthor (D:\Kien Thuc\IT\HTML CSS JAVASCRIPT\
我是typescript的新手,我发现要使用npm包,首先需要安装它的类型,比如 npm install --save @types/node-schedule 然而,我也在使用discord.js,但这不起作用 import * as Discord from 'discord.js'; 然后 npm install --save @types/discord.js
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@types%2fdiscord.js - Not fou
当试图让我的机器人删除一条消息时,我使用命令=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