How to check bot status (not the Discord status)

Hi, I currently use Railway to deploy my bot, and I'm wondering if there's a way I can implement some kind of endpoint that pings the bot or something that is able to tell if the bot is alive / running / listening normally. Thanks in advance!
10 Replies
d.js toolkit
d.js toolkit3w 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!
treble/luna
treble/luna3w ago
well the best way is just to run a ping command in discord and see any other ways arent related to djs
Jahir
JahirOP3w ago
I'd like to have the bot status in BetterStack so that's why I'm looking for an endpoint or something I can point to ... not sure if djs could expose something like that
treble/luna
treble/luna3w ago
not really no.
Jahir
JahirOP3w ago
is there a way to send a message to the bot outside of discord? like with a webhook or something?
treble/luna
treble/luna3w ago
no the only way to tell really is to just run an api in your code and make an endpoint with it that checks for status but afaik railway is one of those free hosters so you;re better off with a proper host so you dont have to worry about downtime much or just use a process manager
Jahir
JahirOP3w ago
could you guide me on how to achieve that? can i just put an express server along with the djs bot?
treble/luna
treble/luna3w ago
yes, but as told, not djs related #other-js-ts #useful-servers theres tons of guides on how to set up a simple express server
Jahir
JahirOP3w ago
thank you
MiKKey
MiKKey3w ago
a cheap vps is better than a free host then use pm2 so u can check your bot status

Did you find this page helpful?