Denty Mods OP
Denty Mods OP

Reputation: 11

can you get info about a discord.js bot on a website?

does anyone know if its possible to send command info (statistics info) to a website so i dont have to keep on editing my website about how many guilds my bot is in

Upvotes: 0

Views: 887

Answers (1)

Asplund
Asplund

Reputation: 2486

Yes this is possible. Let's assume your website is on server A and your discord bot is on server B.

The first option is to have B send a request to A:

B -> POST http request x amount of servers -> A validates the request and stores the payload in its database.

Here A has to listen to an endpoint for example "https://example.com/store-server-amount"

Remember to always serialize the data you receive and validate the request is from your bot and not someone else. You can send a password along with the payload in your url query

The second option is to have A ask B for information:

A -> GET http request -> B -> Returns x amount of servers -> A -> A stores the payload in its database.

Upvotes: 1

Related Questions