Jump to content
RAGE Multiplayer Community

How can i get info to Discord Bot


iproVi
 Share

Recommended Posts

I have a standalone discord bot written in .NET and it uses an API to retrieve game-server information.

My server exports data to an endpoint in JSON, then I use the bot to scan for updates to the game-server API endpoint via a request. This scan can either be timed or manually triggered. The bot hits the custom endpoint, authenticates with a header bearer, and uses the information to update player count etc on the bots active game. If you are able to build your bot directly into your game-server, then that may be another route to go down.

Link to comment
Share on other sites

1 hour ago, sparx said:

I have a standalone discord bot written in .NET and it uses an API to retrieve game-server information.

My server exports data to an endpoint in JSON, then I use the bot to scan for updates to the game-server API endpoint via a request. This scan can either be timed or manually triggered. The bot hits the custom endpoint, authenticates with a header bearer, and uses the information to update player count etc on the bots active game. If you are able to build your bot directly into your game-server, then that may be another route to go down.

why not jost use Discord.NET inside your server project....

Link to comment
Share on other sites

1 hour ago, fl1k said:

why not jost use Discord.NET inside your server project....

Good question.

I prefer to follow a micro-service architecture for most things I build. Practice loose coupling everywhere to minimize one component being too reliant on another. To be fair, if the bot is just completing tasks for the server, and that's it (posting to discord channels with logs, relaying messages etc) then it'll be fine to couple it to a server. Personal preference I guess :P

Edited by sparx
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...