在安装命令和事件处理程序之后,运行Bot让它登录时,我得到了错误。
错误:无法找到模块‘..functions/handleCommands.js’需要堆栈:
C:\Users\levan\Desktop\Discordbot\Bot \2命令handling\src\bot.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.req
我试图通过运行Discord.JS来安装npm install discord.js,它看起来很有效,但它没有。
我在运行index.js文件时会得到这个错误,但是它会给出一个错误,说明找不到discord.js。所以,我试着重新安装它:
PS G:\My Drive\coding\node.js\bot> npm install https://github.com/discordjs/discord.js.git
npm notice created a lockfile as package-lock.json. You should commit this file.
npm W
我最近开始为不和谐制作自己的机器人。现在我是NodeJS的新手,但不是Javascript。我已经安装了我所知道的机器人所需的所有软件包,但它仍然无法工作。我已经安装了: Nodemon和Discordie。现在我只收到这个错误:
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
C:\Users\Vade>npm run Spicii
> discord-bot-SpiciiBott@3.10.10 Spicii C:\Users\Vade
&
我一直在尝试在discord上创建一个机器人,当我使用"node bot.js“运行机器人时,它出现了错误。这是来自终端的完整对话。我安装了机器人的软件包,当我尝试运行机器人时,它显示它有一堆问题。 Last login: Fri Mar 27 15:21:31 on ttys000
Jeffreys-MacBook-Pro:~ kids$ cd
Jeffreys-MacBook-Pro:~ kids$ cd Documents
Jeffreys-MacBook-Pro:Documents kids$ cd DiscordBot
Jeffreys-MacBook-Pro:Discor
我正试图通过npm在我的主pc上成功安装画布,但现在我得到了一个很长的错误,我不知道如何修复。
以下是完整的错误:
npm ERR! gyp info spawn args ]
npm ERR! Package pixman-1 was not found in the pkg-config search path.
npm ERR! Perhaps you should add the directory containing `pixman-1.pc'
npm ERR! to the PKG_CONFIG_PATH environment variable
npm ERR! No
我正在尝试创建一个不和谐的机器人,但是每次我尝试运行youtube链接时都会收到这个错误。
Error: FFmpeg/avconv not found!
at Function.getInfo (C:\Users\-\discord-bot\node_modules\prism-media\src\core\FFmpeg.js:130:11)
at Function.create (C:\Users\-\discord-bot\node_modules\prism-media\src\core\FFmpeg.js:143:38)
at new FFmpeg (C:\U
我已经在heroku上部署了一个不和谐的音乐机器人,除了在语音通道中播放音乐之外,一切都可以工作,尽管当我在pc上运行我的代码时-一切都可以工作。输入npm list,我看到错误消息"npm ERR!peer dep missing: node-opus@^0.2.7,required by discord.js@11.5.1“。node-opus的问题,很明显,由于这个原因,bot无法播放音乐。当然,我已经使用npm init将这个库和其他库放入了package.json。我将package.json文件中的一段代码粘贴到下面。
我试着用npm,yarn,npm和yarn安装了所有这
我正在编码一个不和谐的机器人,发现了一个我无法解决的问题。
检查bot是否联机,以便在控制台中发送消息并显示丰富的内容
client.on("ready", () => {
console.log(`${client.user.username} is in the house!`);
client.user.setPresence({
status: 'online',
game: {
name: 'Cool kid the movie 2',
type: 'WATCHING
C:\Users\PC\Documents\bot> npm install discord.js
npm WARN tar EPERM: operation not permitted, open 'C:\Users\PC\Documents\bot\node_modules\.staging\setimmediate-ba27c7e7\LICENSE.txt'
npm WARN tar EPERM: operation not permitted, open 'C:\Users\PC\Documents\bot\node_modules\.staging\d
这是我在VSCode终端中不断收到的错误代码:
npm ERR! errno 1
npm ERR! discord-bot@1.0.0 start: `node index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the discord-bot@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete lo
我的Discrod.JS机器人在线,但没有响应。这是代码-
// require the discord.js module
const Discord = require('discord.js');
// create a new Discord client
const client = new Discord.Client();
// when the client is ready, run this code
// this event will only trigger one time after logging in
client.once('re
当我想使用discord时,我得到了这个错误输出: Error: ENOENT: no such file or directory, scandir './commands/'
←[90m at Object.readdirSync (fs.js:1021:3)←[39m
at Object.<anonymous> (C:\Users\DAA23\OneDrive\Desktop\bot\main.js:11:25)
←[90m at Module._compile (internal/modules/cjs/loader.js:1063:3
我到处寻找,几乎跟踪了所有的事情...我不明白为什么这种情况总是发生在我创建的Python包上。这不是一个简单的“安装依赖,你很好”,因为这是我自己的项目,我试图创建。 下面是我的文件结构: -jarvis-discord
--jarvis_discord_bot
---__init__.py
---jarvis.py
---config.py
---cogs
----__init__.py
----all the cogs are here 给出的错误: ++ PWD
line 3: PWD: command not found
export PYTHONPATH=
PYTHONPATH=
您好,我正在尝试发送一条自动消息到discord,但我一直收到以下错误:
bot.sendMessage is not a function
我不确定为什么会出现这个错误,下面是我的代码;
var Discord = require('discord.js');
var bot = new Discord.Client()
bot.on('ready', function() {
console.log(bot.user.username);
});
bot.on('message', function() {
if (mes