Need help with Economy system using slash commands and redis database

Im trying to make a command called give-items that only members with admin permission can use, when
6 Replies
d.js toolkit
d.js toolkit11mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
NNKtv28
NNKtv2811mo ago
when loading the slash commands i get this error:
(node:24) Warning: Accessing non-existent property 'redis' of module exports inside circular dependency
at emitCircularRequireWarning (node:internal/modules/cjs/loader:755:11)
at Object.get (node:internal/modules/cjs/loader:771:5)
at Object.<anonymous> (/home/container/handlers/itemHelper.js:2:9)
at Module._compile (node:internal/modules/cjs/loader:1159:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
at Module.load (node:internal/modules/cjs/loader:1037:32)
at Module._load (node:internal/modules/cjs/loader:878:12)
at Module.require (node:internal/modules/cjs/loader:1061:19)
at require (node:internal/modules/cjs/helpers:103:18)
at Object.<anonymous> (/home/container/commands/Administration/give-item.js:3:28)
Database initialized.
Logged in as Custom bot order - Arsh#8722.
(node:24) Warning: Accessing non-existent property 'redis' of module exports inside circular dependency
at emitCircularRequireWarning (node:internal/modules/cjs/loader:755:11)
at Object.get (node:internal/modules/cjs/loader:771:5)
at Object.<anonymous> (/home/container/handlers/itemHelper.js:2:9)
at Module._compile (node:internal/modules/cjs/loader:1159:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
at Module.load (node:internal/modules/cjs/loader:1037:32)
at Module._load (node:internal/modules/cjs/loader:878:12)
at Module.require (node:internal/modules/cjs/loader:1061:19)
at require (node:internal/modules/cjs/helpers:103:18)
at Object.<anonymous> (/home/container/commands/Administration/give-item.js:3:28)
Database initialized.
Logged in as Custom bot order - Arsh#8722.
it tryed to access the redis database that i initialize in the index.js file when loading the bot and it says it cant access the property redis index.js code:
NNKtv28
NNKtv2811mo ago
Gist
index.js
GitHub Gist: instantly share code, notes, and snippets.
NNKtv28
NNKtv2811mo ago
Gist
give-item.js
GitHub Gist: instantly share code, notes, and snippets.
NNKtv28
NNKtv2811mo ago
Gist
itemHelper.js
GitHub Gist: instantly share code, notes, and snippets.
NNKtv28
NNKtv2811mo ago
file system:
home/container/
↪index.js
↪.env
↪config.json
↪globals.js

↪ events
↪ ready.js
↪ interactionCreate.js

↪commands
↪ Administration
↪ give-item.js
↪ Shop
↪ Fun
↪ etc

↪helpers
↪ itemHelper.js

home/container/
↪index.js
↪.env
↪config.json
↪globals.js

↪ events
↪ ready.js
↪ interactionCreate.js

↪commands
↪ Administration
↪ give-item.js
↪ Shop
↪ Fun
↪ etc

↪helpers
↪ itemHelper.js