tfagaming / discordjs-v14-modmail-bot Goto Github PK
View Code? Open in Web Editor NEWA simple and advanced Discord ModMail bot.
License: MIT License
A simple and advanced Discord ModMail bot.
License: MIT License
Hey it keeps on saying this
Error: Cannot find module 'C:\Users\byoun\Downloads\DiscordJS-V14-ModMail-Bot-main\index.js'. Please verify that the package.json has a valid "main" entry
at tryPackage (node:internal/modules/cjs/loader:444:19)
at Module._findPath (node:internal/modules/cjs/loader:715:18)
at resolveMainPath (node:internal/modules/run_main:26:23)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:24)
at node:internal/main/run_main_module:28:49 {
code: 'MODULE_NOT_FOUND',
path: 'C:\Users\byoun\Downloads\DiscordJS-V14-ModMail-Bot-main\package.json',
requestPath: 'C:\Users\byoun\Downloads\DiscordJS-V14-ModMail-Bot-main'
}
i have tried everything can you help?
Promise {
TypeError: isJSONEncodable is not a function
at C:\Users\Crack\Downloads\DiscordJS-V14-ModMail-Bot-main\node_modules\discord.js\src\structures\MessagePayload.js:137:59
at Array.map ()
at MessagePayload.resolveBody (C:\Users\Crack\Downloads\DiscordJS-V14-ModMail-Bot-main\node_modules\discord.js\src\structures\MessagePayload.js:137:49)
at DMChannel.send (C:\Users\Crack\Downloads\DiscordJS-V14-ModMail-Bot-main\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:169:32)
at Message.reply (C:\Users\Crack\Downloads\DiscordJS-V14-ModMail-Bot-main\node_modules\discord.js\src\structures\Message.js:803:25)
at Client. (C:\Users\Crack\Downloads\DiscordJS-V14-ModMail-Bot-main\index.js:711:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
what does this man and hiw to rfix pls
I started the process by cloning the repo using git git clone https://github.com/TFAGaming/DiscordJS-V14-ModMail-Bot
Then I executed npm install
to get all the necessary modules and start the bot.
But it didn't work, here what I got :
root@something:/home/discord-modmail-bot# node -v
v19.7.0
root@something:/home/discord-modmail-bot# npm install
npm ERR! code 1
npm ERR! path /home/discord-modmail-bot/node_modules/better-sqlite3
npm ERR! command failed
npm ERR! command sh -c prebuild-install || npm run build-release
npm ERR! > [email protected] build-release
npm ERR! > node-gyp rebuild --release
npm ERR!
npm ERR! make: Entering directory '/home/discord-modmail-bot/node_modules/better-sqlite3/build'
npm ERR! TOUCH ba23eeee118cd63e16015df367567cb043fed872.intermediate
npm ERR! ACTION deps_sqlite3_gyp_locate_sqlite3_target_copy_builtin_sqlite3 ba23eeee118cd63e16015df367567cb043fed872.intermediate
npm ERR! TOUCH Release/obj.target/deps/locate_sqlite3.stamp
npm ERR! CC(target) Release/obj.target/sqlite3/gen/sqlite3/sqlite3.o
npm ERR! rm -f Release/obj.target/deps/sqlite3.a Release/obj.target/deps/sqlite3.a.ar-file-list; mkdir -p `dirname Release/obj.target/deps/sqlite3.a`
npm ERR! ar crs Release/obj.target/deps/sqlite3.a @Release/obj.target/deps/sqlite3.a.ar-file-list
npm ERR! COPY Release/sqlite3.a
npm ERR! CXX(target) Release/obj.target/better_sqlite3/src/better_sqlite3.o
npm ERR! rm ba23eeee118cd63e16015df367567cb043fed872.intermediate
npm ERR! make: Leaving directory '/home/discord-modmail-bot/node_modules/better-sqlite3/build'
npm ERR! prebuild-install warn install No prebuilt binaries found (target=19.7.0 runtime=node arch=x64 libc= platform=linux)
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | x64
npm ERR! gyp info find Python using Python version 3.8.10 found at "/usr/bin/python3"
npm ERR! gyp http GET https://nodejs.org/download/release/v19.7.0/node-v19.7.0-headers.tar.gz
npm ERR! gyp http 200 https://nodejs.org/download/release/v19.7.0/node-v19.7.0-headers.tar.gz
npm ERR! gyp http GET https://nodejs.org/download/release/v19.7.0/SHASUMS256.txt
npm ERR! gyp http 200 https://nodejs.org/download/release/v19.7.0/SHASUMS256.txt
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/root/.nvm/versions/node/v19.7.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'make',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/home/discord-modmail-bot/node_modules/better-sqlite3/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/root/.nvm/versions/node/v19.7.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/root/.cache/node-gyp/19.7.0/include/node/common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=/root/.cache/node-gyp/19.7.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/root/.nvm/versions/node/v19.7.0/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/root/.cache/node-gyp/19.7.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/home/discord-modmail-bot/node_modules/better-sqlite3',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! In file included from ./src/better_sqlite3.lzz:11,
npm ERR! from ../src/better_sqlite3.cpp:4:
npm ERR! /root/.cache/node-gyp/19.7.0/include/node/node.h:1182:51: warning: cast between incompatible function types from ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Context>)’ to ‘node::addon_context_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Context>, void*)’} [-Wcast-function-type]
npm ERR! 1182 | (node::addon_context_register_func) (regfunc), \
npm ERR! | ^
npm ERR! /root/.cache/node-gyp/19.7.0/include/node/node.h:1200:3: note: in expansion of macro ‘NODE_MODULE_CONTEXT_AWARE_X’
npm ERR! 1200 | NODE_MODULE_CONTEXT_AWARE_X(modname, regfunc, NULL, 0)
npm ERR! | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! /root/.cache/node-gyp/19.7.0/include/node/node.h:1231:3: note: in expansion of macro ‘NODE_MODULE_CONTEXT_AWARE’
npm ERR! 1231 | NODE_MODULE_CONTEXT_AWARE(NODE_GYP_MODULE_NAME, \
npm ERR! | ^~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! ./src/better_sqlite3.lzz:67:1: note: in expansion of macro ‘NODE_MODULE_INIT’
npm ERR! ./src/util/macros.lzz: In function ‘void SetPrototypeGetter(v8::Isolate*, v8::Local<v8::External>, v8::Local<v8::FunctionTemplate>, const char*, v8::AccessorGetterCallback)’:
npm ERR! ./src/util/macros.lzz:157:21: error: ‘v8::AccessorSignature’ has not been declared
npm ERR! ./src/util/binder.lzz: In static member function ‘static bool Binder::IsPlainObject(v8::Isolate*, v8::Local<v8::Object>)’:
npm ERR! ./src/util/binder.lzz:37:51: error: ‘class v8::Object’ has no member named ‘CreationContext’; did you mean ‘GetCreationContext’?
npm ERR! ./src/util/data.lzz: In function ‘v8::Local<v8::Value> Data::GetValueJS(v8::Isolate*, sqlite3_stmt*, int, bool)’:
npm ERR! ./src/util/data.lzz:73:92: warning: this statement may fall through [-Wimplicit-fallthrough=]
npm ERR! ./src/util/data.lzz:73:197: note: here
npm ERR! ./src/util/data.lzz: In function ‘v8::Local<v8::Value> Data::GetValueJS(v8::Isolate*, sqlite3_value*, bool)’:
npm ERR! ./src/util/data.lzz:77:81: warning: this statement may fall through [-Wimplicit-fallthrough=]
npm ERR! ./src/util/data.lzz:77:175: note: here
npm ERR! make: *** [better_sqlite3.target.mk:125: Release/obj.target/better_sqlite3/src/better_sqlite3.o] Error 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack at ChildProcess.onExit (/root/.nvm/versions/node/v19.7.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:203:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:512:28)
npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:293:12)
npm ERR! gyp ERR! System Linux 5.4.0-139-generic
npm ERR! gyp ERR! command "/root/.nvm/versions/node/v19.7.0/bin/node" "/root/.nvm/versions/node/v19.7.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
npm ERR! gyp ERR! cwd /home/discord-modmail-bot/node_modules/better-sqlite3
npm ERR! gyp ERR! node -v v19.7.0
npm ERR! gyp ERR! node-gyp -v v9.3.1
npm ERR! gyp ERR! not ok
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2023-03-01T14_01_50_058Z-debug-0.log
The only solution I found was using NVM (stands for Node Version Manager) and it was to switch version to the closest that T.F.A said was working.
Which in this case is v16.9.0, so I used nvm install 16.9.0
to get the right node version.
Then I used nvm alias default 16.9.0
to be sure that it would be using the right version to install the packages.
After running npm install
in the directory of my bot, it worked just fine.
The easiest thing for everyone, would be to have a wider range of support for latest nodejs version.
Although I can understand that the bot cannot be in every possible version of node.js so I would understand if it wasn't happening.
I'm also doing a french translation of the bot, I will create a new forked repo for it soon. Peace
Sorry, can you make the commands with prefix? , my bot broken bcs I host 2 code in 1 bot and try to scramble to register the slash command.
I have not edited any files apart from button.js
, and messageCreate.js
and slash commands register but the bot does not respond to them. I have troubleshooted everything possible (including scopes bot
and applications.commands
) with no fix. (stock files straight from this repo has the same issue)
Worth mentioning that everything else functions as intended apart from slash commands
This approach is bad for big bots
If you edit a message, does the new message get shown or will it still be the old message?
When i run npm run start it doesnt start like why and what the heck did you do
Hello,
Im trying to setup the bot on my vps, i have completed all config files but i have this error when i start the bot :
Unable to connect to the bot, this might be an invalid token or missing required intents! Error: Used disallowed intents at WebSocketShard.onClose (C:\Users\ipolo\Desktop\DiscordJS-V14-ModMail-Bot-8.0.0\node_modules\@discordjs\ws\dist\index.js:1132:18) at connection.onclose (C:\Users\ipolo\Desktop\DiscordJS-V14-ModMail-Bot-8.0.0\node_modules\@discordjs\ws\dist\index.js:676:17) at callListener (C:\Users\ipolo\Desktop\DiscordJS-V14-ModMail-Bot-8.0.0\node_modules\ws\lib\event-target.js:290:14) at WebSocket.onClose (C:\Users\ipolo\Desktop\DiscordJS-V14-ModMail-Bot-8.0.0\node_modules\ws\lib\event-target.js:220:9) at WebSocket.emit (node:events:514:28) at WebSocket.emitClose (C:\Users\ipolo\Desktop\DiscordJS-V14-ModMail-Bot-8.0.0\node_modules\ws\lib\websocket.js:260:10) at TLSSocket.socketOnClose (C:\Users\ipolo\Desktop\DiscordJS-V14-ModMail-Bot-8.0.0\node_modules\ws\lib\websocket.js:1272:15) at TLSSocket.emit (node:events:526:35) at node:net:323:12 at TCP.done (node:_tls_wrap:588:7)
Can you help please ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.