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.
80 Replies
Project ID:
N/A
N/A
please share the repo so we can advise on the changes that you will need to make
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
im asking for the github repository, not a project invite
OH
GitHub
GitHub - danicathh/cccc
Contribute to danicathh/cccc development by creating an account on GitHub.
lmk if u can view it
I can, but this is a repo containing a single zip file
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
extract the contents of the zip file into the repo, because I'm assuming the zip file contains your project files
okay and what should i do after
let me know when done
okay
Okay
it should be done
should i remove the zip file
why do most files have no file extension?
wym?
this is the replitt code im trying to transfer
to railway
and this is your repo https://github.com/danicathh/cccc
everything that matters, doesnt have a file extension
how do i set it up then
name your files correctly
your files are missing their file extensions
do u have an example for me to see
like of one with file extensions
have a look at this, it shows what the files in github should be named https://replit.com/@FFAZemzi/TreasuredMutedDevelopers-1#index.js
should i just upload each files seperately then?
whatever works best for you, just the files need to be named the exact same in your repo as they are in the replit
Okay, do u have a good video for me to watch
and when im done ill ping u with the finished github
just rename the files
okay
keep them all in the same branch right?
yeah the main branch is fine
okay i renamed all the files
to match the zip ones
cool, can railway deploy it now?
let me check
yes it deployed!
Anything esle i should do
i mean, does it work?
i mean it says its deployed and completed
idk if i should add anything else for the discord bot
like the token, et
c
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
yes
idk where to add that tho
i have it tho
okay ill add the token
and
what abt the client ID
what about it?
where should i add it
does your code need it?
yes
how is your code supposed to read the client id?
oh yes do u know how to add mongo database or does that need to be seperate
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 replithey last thing!
it would say completed, and then crashes the next minute
probably can't run on the trial plan, you'd need to upgrade to hobby
weird i have the pro plan
you do?
yup
interesting, would you mind showing me that?
ye sure
what's the size of Mongo's volume?
Itβs like 512 mb
grow the volume
what do u mean by that and how should i do it
click the grow button in the volume's settings
its now 50gb and its still crashing
have you redeployed it?
its saying No such file or directory
maybe you want to go ahead and deploy a new mongo db
so i deployed a new one
and its saying this
what should o put
deploying a new mongo database would not ask you for that, you did something wrong
deploy a new mongo database from the + new menu
okay
is this where i connect it?
no
screaming
read this please
there's no need to modify anything there, doing so could break your database
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
theres documentation pages that i have linked, have you taken a look at them?
but environment variables should go into the service variables
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
any errors in the deploy logs?
No
MongoDB logs
Deploy logs for GitHub
I'm not sure why you said no? that's definitely an error
Yeah I didnβt see it
Though I tried to fix the error it listed
but again, your project structure is wrong, please reference your replit for the correct project structure
So Iβm not too sure how to fix it
Do you know what the Require stack means?
your project structure is wrong, please reference your replit for the correct project structure
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 errorthe warning tells you what to do to remove the the message