R
Railwayβ€’3mo ago
Ashez

How would I use railway to run my discord bot with the command prompt shut

Im new to this type of stuff and the title is really what I need help with. Many thanks πŸ™πŸΎ
27 Replies
Percy
Percyβ€’3mo ago
Project ID: N/A
Ashez
AshezOPβ€’3mo ago
N/A I mean I don’t know my project ID atm. Like I said in new to this
josh
joshβ€’3mo ago
hi πŸ™‚ is your code in a github repo? or is it all local?
Ashez
AshezOPβ€’3mo ago
Github It’s the SkinPeek discord bot But made my own with things from GitHub
josh
joshβ€’3mo ago
you should be able to just deploy it from the web UI then
Ashez
AshezOPβ€’3mo ago
How would I do that again
josh
joshβ€’3mo ago
dashboard -> new
Ashez
AshezOPβ€’3mo ago
My main issue is the discord bot runs but only with the command prompt open. If the command prompt is closed the bot will stop working
josh
joshβ€’3mo ago
yeah so in a deployed environment, you won't need to worry about that. the reason why it stops on close is because it's just a process running inside of the terminal
Ashez
AshezOPβ€’3mo ago
So there is a way to prevent that
josh
joshβ€’3mo ago
not closing it
Ashez
AshezOPβ€’3mo ago
Oh
josh
joshβ€’3mo ago
or alternatively, just deploy it to a web host like railway if you need 24/7 access
Ashez
AshezOPβ€’3mo ago
Yes exactly Ok so On railway I go to dashboard -> new Or is that in github
josh
joshβ€’3mo ago
no you do it on railway you're just using a github repo as the data source for files to be deployed the reason why you can do it directly from github is because railway uses oauth2 from github to automatically authenticate you (github has a login gateway that developers can use programatically to be an "authorised application" for users who opt-in to allowing railway to access certain information in your gh account. although this doesn't stop malicious code, etc - but this is irrelevant at this point in time)
Ashez
AshezOPβ€’3mo ago
Is railway free to use?
josh
joshβ€’3mo ago
i think the trial plan is free yeah, but after that it's $5/month + usage
Ashez
AshezOPβ€’3mo ago
So I would have to pay to run my bot 24/7
Ashez
AshezOPβ€’3mo ago
So I would copy this
No description
Ashez
AshezOPβ€’3mo ago
And put it here
No description
josh
joshβ€’3mo ago
Yes that's correct. Costs are based on how much resource you use, so it's not a fixed amount. I will say though that obviously, the more compute/data you use, the more it'll cost Sorry I just wanted to quickly say - iirc the Hobby plan should come with $5 usage. If you're just using Railway for a Discord bot, it should come under the $5
Ashez
AshezOPβ€’3mo ago
This right?
No description
Ashez
AshezOPβ€’3mo ago
And use this towards one month
josh
joshβ€’3mo ago
Yes You're currently on the trial plan which comes with $5 free usage but after that you'll likely need to upgrade to Hobby tier
Ashez
AshezOPβ€’3mo ago
No description
MantisInABox
MantisInABoxβ€’3mo ago
This means you are on a limited trial, and cannot deploy code, only databases. To deploy code, you would need to upgrade to the hobby plan
Ashez
AshezOPβ€’3mo ago
Oh
Want results from more Discord servers?
Add your server