Trying to set up a NODEJS Discord bot, not sure how to do it?

Hi can anyone help me, im trying to get this done asap. I have the code used for the previous hosting service, but when i try to upload the code it wont deploy.
No description
80 Replies
Percy
Percyβ€’10mo ago
Project ID: N/A
Brody
Brodyβ€’10mo ago
please share the repo so we can advise on the changes that you will need to make
dani πŸ‡±πŸ‡§πŸ‡ΈπŸ‡Ύ
This is my first time using railway im not rlly sure how to set everything up im tying to watch videos but the deployment wont upload :/ or if there were a video for a step by step guide that would be good
Brody
Brodyβ€’10mo ago
im asking for the github repository, not a project invite
dani πŸ‡±πŸ‡§πŸ‡ΈπŸ‡Ύ
GitHub
GitHub - danicathh/cccc
Contribute to danicathh/cccc development by creating an account on GitHub.
dani πŸ‡±πŸ‡§πŸ‡ΈπŸ‡Ύ
lmk if u can view it
Brody
Brodyβ€’10mo ago
I can, but this is a repo containing a single zip file
dani πŸ‡±πŸ‡§πŸ‡ΈπŸ‡Ύ
Yeah im unsure how to seperate them into other files I used to use replitt premium until they changed it thats where my file came from
Brody
Brodyβ€’10mo ago
extract the contents of the zip file into the repo, because I'm assuming the zip file contains your project files
dani πŸ‡±πŸ‡§πŸ‡ΈπŸ‡Ύ
okay and what should i do after
Brody
Brodyβ€’10mo ago
let me know when done
dani πŸ‡±πŸ‡§πŸ‡ΈπŸ‡Ύ
okay Okay it should be done should i remove the zip file
Brody
Brodyβ€’10mo ago
why do most files have no file extension?
dani πŸ‡±πŸ‡§πŸ‡ΈπŸ‡Ύ
wym? this is the replitt code im trying to transfer to railway
Brody
Brodyβ€’10mo ago
and this is your repo https://github.com/danicathh/cccc everything that matters, doesnt have a file extension
dani πŸ‡±πŸ‡§πŸ‡ΈπŸ‡Ύ
how do i set it up then
Brody
Brodyβ€’10mo ago
name your files correctly your files are missing their file extensions
dani πŸ‡±πŸ‡§πŸ‡ΈπŸ‡Ύ
do u have an example for me to see like of one with file extensions
Brody
Brodyβ€’10mo ago
have a look at this, it shows what the files in github should be named https://replit.com/@FFAZemzi/TreasuredMutedDevelopers-1#index.js
dani πŸ‡±πŸ‡§πŸ‡ΈπŸ‡Ύ
should i just upload each files seperately then?
Brody
Brodyβ€’10mo ago
whatever works best for you, just the files need to be named the exact same in your repo as they are in the replit
dani πŸ‡±πŸ‡§πŸ‡ΈπŸ‡Ύ
Okay, do u have a good video for me to watch and when im done ill ping u with the finished github
Brody
Brodyβ€’10mo ago
just rename the files
dani πŸ‡±πŸ‡§πŸ‡ΈπŸ‡Ύ
okay keep them all in the same branch right?
Brody
Brodyβ€’10mo ago
yeah the main branch is fine
dani πŸ‡±πŸ‡§πŸ‡ΈπŸ‡Ύ
okay i renamed all the files to match the zip ones
Brody
Brodyβ€’10mo ago
cool, can railway deploy it now?
dani πŸ‡±πŸ‡§πŸ‡ΈπŸ‡Ύ
let me check yes it deployed! Anything esle i should do
Brody
Brodyβ€’10mo ago
i mean, does it work?
dani πŸ‡±πŸ‡§πŸ‡ΈπŸ‡Ύ
i mean it says its deployed and completed idk if i should add anything else for the discord bot like the token, et c
Brody
Brodyβ€’10mo ago
doesnt the code need a mongo database? yeah youd need to add the token for sure, add it in the service variables https://docs.railway.app/guides/variables#service-variables
dani πŸ‡±πŸ‡§πŸ‡ΈπŸ‡Ύ
yes idk where to add that tho i have it tho okay ill add the token and what abt the client ID
Brody
Brodyβ€’10mo ago
what about it?
dani πŸ‡±πŸ‡§πŸ‡ΈπŸ‡Ύ
where should i add it
Brody
Brodyβ€’10mo ago
does your code need it?
Brody
Brodyβ€’10mo ago
how is your code supposed to read the client id?
dani πŸ‡±πŸ‡§πŸ‡ΈπŸ‡Ύ
oh yes do u know how to add mongo database or does that need to be seperate
Brody
Brodyβ€’10mo ago
yeah you can add a mongo database to your project from the + new button in the top right of your project. make sure to use the autocomplete to setup the needed variables on your service https://docs.railway.app/guides/variables#autocomplete-dropdown yeah the file is named incorrectly and in the wrong folder structure, please reference the filenames and folder structure you have in your replit
dani πŸ‡±πŸ‡§πŸ‡ΈπŸ‡Ύ
hey last thing! it would say completed, and then crashes the next minute
Brody
Brodyβ€’10mo ago
probably can't run on the trial plan, you'd need to upgrade to hobby
dani πŸ‡±πŸ‡§πŸ‡ΈπŸ‡Ύ
weird i have the pro plan
Brody
Brodyβ€’10mo ago
you do?
Brody
Brodyβ€’10mo ago
interesting, would you mind showing me that?
Brody
Brodyβ€’10mo ago
what's the size of Mongo's volume?
dani πŸ‡±πŸ‡§πŸ‡ΈπŸ‡Ύ
It’s like 512 mb
Brody
Brodyβ€’10mo ago
grow the volume
dani πŸ‡±πŸ‡§πŸ‡ΈπŸ‡Ύ
what do u mean by that and how should i do it
Brody
Brodyβ€’10mo ago
click the grow button in the volume's settings
dani πŸ‡±πŸ‡§πŸ‡ΈπŸ‡Ύ
its now 50gb and its still crashing
Brody
Brodyβ€’10mo ago
have you redeployed it?
dani πŸ‡±πŸ‡§πŸ‡ΈπŸ‡Ύ
its saying No such file or directory
Brody
Brodyβ€’10mo ago
maybe you want to go ahead and deploy a new mongo db
dani πŸ‡±πŸ‡§πŸ‡ΈπŸ‡Ύ
so i deployed a new one
dani πŸ‡±πŸ‡§πŸ‡ΈπŸ‡Ύ
and its saying this
No description
dani πŸ‡±πŸ‡§πŸ‡ΈπŸ‡Ύ
what should o put
Brody
Brodyβ€’10mo ago
deploying a new mongo database would not ask you for that, you did something wrong deploy a new mongo database from the + new menu
dani πŸ‡±πŸ‡§πŸ‡ΈπŸ‡Ύ
is this where i connect it?
No description
Brody
Brodyβ€’10mo ago
no
dani πŸ‡±πŸ‡§πŸ‡ΈπŸ‡Ύ
screaming
Brody
Brodyβ€’10mo ago
read this please there's no need to modify anything there, doing so could break your database
dani πŸ‡±πŸ‡§πŸ‡ΈπŸ‡Ύ
okay So all my client id, connecting mongo db, and token should go in environmental or shared variables? There’s no videos n stuff abt them
Brody
Brodyβ€’10mo ago
theres documentation pages that i have linked, have you taken a look at them? but environment variables should go into the service variables
dani πŸ‡±πŸ‡§πŸ‡ΈπŸ‡Ύ
Okay so Everything is connected but the bot itself isn’t online I have all the service variables connected like Guild id, client id, mongo url, and the token The mongo db is working perfectly fine Same for the GitHub
Brody
Brodyβ€’10mo ago
any errors in the deploy logs?
dani πŸ‡±πŸ‡§πŸ‡ΈπŸ‡Ύ
MongoDB logs
No description
No description
dani πŸ‡±πŸ‡§πŸ‡ΈπŸ‡Ύ
Deploy logs for GitHub
No description
Brody
Brodyβ€’10mo ago
I'm not sure why you said no? that's definitely an error
dani πŸ‡±πŸ‡§πŸ‡ΈπŸ‡Ύ
Yeah I didn’t see it Though I tried to fix the error it listed
Brody
Brodyβ€’10mo ago
but again, your project structure is wrong, please reference your replit for the correct project structure
dani πŸ‡±πŸ‡§πŸ‡ΈπŸ‡Ύ
So I’m not too sure how to fix it Do you know what the Require stack means?
Brody
Brodyβ€’10mo ago
your project structure is wrong, please reference your replit for the correct project structure
dani πŸ‡±πŸ‡§πŸ‡ΈπŸ‡Ύ
Are u able to explain this (node:7) [MONGOOSE] DeprecationWarning: Mongoose: the strictQuery option will be switched back to false by default in Mongoose 7. Use mongoose.set('strictQuery', false); if you want to prepare for this change. Or use mongoose.set('strictQuery', true); to suppress this warning. (Use node --trace-deprecation ... to show where the warning was created) the bot is connected! i just would like to fix this error
Brody
Brodyβ€’10mo ago
the warning tells you what to do to remove the the message
Want results from more Discord servers?
Add your server