Coding help needed!

I made a discord bot today and need sash commands on everything, but i dont know how i make that! What i have on my bot is -Balance.js -Beg.js -Buy.js -Daily.js -Deposit.js -eaderboard.js -Pay.js -Profile.js -Removemoney.js -Rob.js -Roulette.js -Sell.js -Slots.js -Store.js -Store2.js -Weekly.js -whitdrwa.js -work.js Can anyone please help me out ❤️
56 Replies
d.js toolkit
d.js toolkit6mo 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!
d.js docs
d.js docs6mo ago
:guide: Creating Your Bot: Creating slash commands read more
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
Medusas
MedusasOP6mo ago
the problem is i dont understand how to do it
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
Medusas
MedusasOP6mo ago
its okey it shows how to do it, but as i said i dont understand it
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
Medusas
MedusasOP6mo ago
everything, i have never done it before
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
Medusas
MedusasOP6mo ago
i already did look at the guide
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
Medusas
MedusasOP6mo ago
what i need is help to make it, since i dont understand the guide at all
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
Medusas
MedusasOP6mo ago
so what should i call that group? so i can start try making it
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
Medusas
MedusasOP6mo ago
file in my console what should i call it?
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
Medusas
MedusasOP6mo ago
the main issue is to set up slash commands, thats where im stuck
d.js docs
d.js docs6mo ago
guide suggestion for @Kretakongen: :guide: Creating Your Bot: Registering slash commands read more
Medusas
MedusasOP6mo ago
what i tried now and it didnt work
TÆMBØ
TÆMBØ6mo ago
Can you elaborate on what you mean by "didn't work"?
d.js docs
d.js docs6mo ago
To share long code snippets, use a service like gist, sourcebin, pastebin, or similar instead of posting them as large code blocks or files.
Medusas
MedusasOP6mo ago
the console crash
TÆMBØ
TÆMBØ6mo ago
Did it say anything?
Medusas
MedusasOP6mo ago
let me add it, and send the error message :/home/container$ if [[ "${USER_UPLOAD}" != "1" ]] && [[ -n "${GIT_ADDRESS}" ]]; then if [[ ! -d ".git" ]]; then git init && git remote add origin "${GIT_ADDRESS}" && git fetch origin ${BRANCH:-main} && git reset --hard origin/${BRANCH:-main}; fi; if [[ "${AUTO_UPDATE}" == "1" ]]; then if [[ -n "${ACCESS_TOKEN}" ]] && [[ -n "${USERNAME}" ]]; then git remote set-url origin "https://${USERNAME}:${ACCESS_TOKEN}@$(echo ${GIT_ADDRESS} | sed -e 's#https://##')"; fi; git pull origin ${BRANCH:-$(git rev-parse --abbrev-ref HEAD)}; fi; fi; if [[ -n "${NODE_PACKAGES}" ]]; then npm install ${NODE_PACKAGES}; fi; if [[ -n "${UNNODE_PACKAGES}" ]]; then npm uninstall ${UNNODE_PACKAGES}; fi; if [[ -f "/home/container/package.json" ]]; then npm install; fi; clear; if [[ "${MAIN_FILE}" == bot.js deploy-commands.js ]]; then node "/home/container/${MAIN_FILE}" ${NODE_ARGS}; else ts-node --esm "/home/container/${MAIN_FILE}" ${NODE_ARGS}; fi /entrypoint.sh: eval: line 16: syntax error in conditional expression Zluqe: Server marked as offline... [Pterodactyl Daemon]: ---------- Detected server process in a crashed state! ---------- [Pterodactyl Daemon]: Exit code: 2 [Pterodactyl Daemon]: Out of memory: false [Pterodactyl Daemon]: Checking server disk space usage, this could take a few seconds... [Pterodactyl Daemon]: Updating process configuration files... [Pterodactyl Daemon]: Ensuring file permissions are set correctly, this could take a few seconds... Zluqe: Server marked as starting... [Pterodactyl Daemon]: Pulling Docker container image, this could take a few minutes to complete... [Pterodactyl Daemon]: Finished pulling Docker container image v21.7.3 :/home/container$ if [[ "${USER_UPLOAD}" != "1" ]] && [[ -n "${GIT_ADDRESS}" ]]; then if [[ ! -d ".git" ]]; then git init && git remote add origin "${GIT_ADDRESS}" && git fetch origin ${BRANCH:-main} && git reset --hard origin/${BRANCH:-main}; fi; if [[ "${AUTO_UPDATE}" == "1" ]]; then if [[ -n "${ACCESS_TOKEN}" ]] && [[ -n "${USERNAME}" ]]; then git remote set-url origin "https://${USERNAME}:${ACCESS_TOKEN}@$(echo ${GIT_ADDRESS} | sed -e 's#https://##')"; fi; git pull origin ${BRANCH:-$(git rev-parse --abbrev-ref HEAD)}; fi; fi; if [[ -n "${NODE_PACKAGES}" ]]; then npm install ${NODE_PACKAGES}; fi; if [[ -n "${UNNODE_PACKAGES}" ]]; then npm uninstall ${UNNODE_PACKAGES}; fi; if [[ -f "/home/container/package.json" ]]; then npm install; fi; clear; if [[ "${MAIN_FILE}" == bot.js deploy-commands.js ]]; then node "/home/container/${MAIN_FILE}" ${NODE_ARGS}; else ts-node --esm "/home/container/${MAIN_FILE}" ${NODE_ARGS}; fi /entrypoint.sh: eval: line 16: syntax error in conditional expression Zluqe: Server marked as offline... [Pterodactyl Daemon]: ---------- Detected server process in a crashed state! ---------- [Pterodactyl Daemon]: Exit code: 2 [Pterodactyl Daemon]: Out of memory: false [Pterodactyl Daemon]: Aborting automatic restart, last crash occurred less than 60 seconds ago. its the error message but when i remove it, the console work
Tomsoz
Tomsoz6mo ago
what host are you using, this says there is a syntax error in the entrypoint.sh which is defined by the host and cannot be changed by the user does it work if you run it on your local pc
Medusas
MedusasOP6mo ago
it works when i remove it im just trying to setup slash commands
Tomsoz
Tomsoz6mo ago
wait do you have 2 files in the startup files sectiob
Medusas
MedusasOP6mo ago
what you mean? i did renmane it cmd maybe that help?
Tomsoz
Tomsoz6mo ago
bot.js deploy-commands.js this is in the startup messgae you can only run one at a time not both
Medusas
MedusasOP6mo ago
okey, i have bot.js
Tomsoz
Tomsoz6mo ago
deploy commands is meant to be ran on your pc once to sync your commands to discord it doesn't need to run every single time the bot starts
Medusas
MedusasOP6mo ago
so how do i set it up? i know nothing about this
Tomsoz
Tomsoz6mo ago
run the deploy-commands.js file locally on your pc and remove it from the host startup files
Medusas
MedusasOP6mo ago
i get that, but how do i run it? thats what im asking youre talking to a noob here 🤣
TÆMBØ
TÆMBØ6mo ago
This seems like an issue with your host's environment and not the code you sent, so I'd consult their support for how to resolve this (unless what Tomsoz said is true, I don't know) Do you have Node.js installed? Do you know how to use it?
Medusas
MedusasOP6mo ago
it was they who sent me here so no i do not know how to use it
TÆMBØ
TÆMBØ6mo ago
I suggest reading some of the tutorials found in #resources in that case
Medusas
MedusasOP6mo ago
im close to give up
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
Medusas
MedusasOP6mo ago
im trying the best i can, and i dont get it
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
Medusas
MedusasOP6mo ago
the probem is still slash commands as i said 4 times now
Tomsoz
Tomsoz6mo ago
tbh you're better off learning the fundamentals of JavaScript and node it will help you understand this much better
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
Medusas
MedusasOP6mo ago
i get that, its just making me mad, because i dpnt understand anything about it
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
Medusas
MedusasOP6mo ago
what im trying to do is setup sash commmands, but every time i try to add the code to mhy bot console, the console crash but when i remove the code everything in the console works
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
Amgelo
Amgelo6mo ago
if you don't even know how to use node, how did you code the bot
Ashy
Ashy6mo ago
@Medusas? dont tell me you use bare javascript to make your bot. it's impossible i can help further if he actually sends the stacktrace, but something else is failing ok i'll come back when he provide the stacktrace
Medusas
MedusasOP6mo ago
thats what i did
Ashy
Ashy6mo ago
i can give you an example of node's stacktrace, what you provided is something non-node failing
TypeError: broski broski 123
at myFunction (/path/to/file.js:5:11)
at Object.<anonymous> (/path/to/file.js:10:1)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:23:47
TypeError: broski broski 123
at myFunction (/path/to/file.js:5:11)
at Object.<anonymous> (/path/to/file.js:10:1)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:23:47
Medusas
MedusasOP6mo ago
first i need to fix the code i messed up haha
Ashy
Ashy6mo ago
what are you using to run your bot? is it node.js or anything else? im asking about the environment tha run ur code node.js is an environment where u build stuff urself
Medusas
MedusasOP6mo ago
node.js

Did you find this page helpful?