How to make script in website to show discord bot guilds

i created website from infinityhost.
im using discord bot from glitch vps.
i want to sent bot information to my site
like bot connected guilds amount

I don’t know what u mean by “site from other site” can u please elaborate?

Please read this and rephrase your question.

2 Likes

oh sorry i mean
i created website from infinityhost.
im using discord bot from glitch vps.
i want to sent bot information to my site
like bot connected guilds amount
like api but i dont know how to make api :smiley:

If u are using express then u can add endpoints using app.method() where method is the HTTP method in lowercase you want the endpoint to listen on. Then on your other website send a request to the endpoint u have set.

Also, why don’t u have everything in glitch?

This would be much easier if you host your website on the same project on Glitch. This would mean no API would be needed as you can just make the page as a response of a get or even use something like ejs to make a template with the variables included. Or you could just have your bot project have an embed using the methods mention and embed that into your site.

1 Like

I was gonna say the same thing when your bot runs make is open a port on the glitch projects ip/page and have your website request info from the glitch page

You can send GET request from nodejs to php (as php is only backend supported by infinityhost) and once it is received, you can update the data to JSON file. Meanwhile read the JSON file using normal Javascript within HTML and edit it content using DOMS.
I know it may sound greedy but can you hit the like button if it helped? am looking for custom domain.
THANKS!