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
- 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!well the best way is just to run a ping command in discord and see
any other ways arent related to djs
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
not really no.
is there a way to send a message to the bot outside of discord?
like with a webhook or something?
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
could you guide me on how to achieve that?
can i just put an express server along with the djs bot?
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
thank you
a cheap vps is better than a free host
then use pm2 so u can check your bot status