Connect Discord Bot on discord.js to site on Glitch

Hi, guys! Please, help me connecting my Discord bot to site on Glitch.

I don’t know what you mean, can you please elaborate?

How to display bot statistics on a site created on Glitch?

If you mean amount of Servers your bot is in you can have a API with endpoints like
/api/getamountofguilds and use express and discord.js and return the amount of guilds.

Edit: And then use AJAX on your website to get that amount.

Can I get an example code of this miracle?

I need about the same as on this site:

Node application:

const Discord = require("discord.js")
const Express = require("express")
const App = Express()
const Client = new Discord.Client()

App.get("/api/getguilds", (req, res) => {



HTML File:

    <p id="Guilds"></p>
       const Request = new XMLHttpRequest()
       Request.onreadystatechange = function() {
         if (this.readyState == 4 && this.status == 200) {
           document.getElementById("Guilds").innerHTML = this.responseText;
       };"GET", "/api/getguilds", true)

Thanks for the code. And if the site and the bot on different projects will work?

The Node application must be on the bots project and when the URL you GET to must be a full url (e.g

Edit: AJAX requires same origin

That is, it works, but instead of writing the path to the link to the project, right?“GET”, “”, true)

I forgot you need same origin for AJAX you must create a API on the websites node application to request from the bots project

Edit: Why don’t u have them both in the same project?

Is it possible to put both a bot and a site in one project?

Edit: I’m used hello-sqlite