i whant to have membercount on a website as a live thing
I would reccomend looking into discord APIs or discord widgets.
any docs or something for me?
not that, i whant like
Members: 501
like the youtube sub count thing but with discord server members
You could use discord APIs to build something like that.
ohk? humn ok. illl try
i just need some API’s, but cant find
This has stuff for the guild.
thanks, ill go check it out
Check the member count section.
<a href="http://statcord.com/discord" target="_blank">
<img src="https://discordapp.com/api/guilds/608711879858192479/embed.png" alt="Discord" height="30">
</a>
Make sure to put your Discord Invite & Your Discord ID in the right places.
ok. ill try to use this!!!
but is it possible to get all, not only the online?
Not via Discord themselves. You’d have to manually connect with Discord’s API to get all users.
how do i do this? Any NPM package or something?
You could make a Discord bot that checks every few minutes or so.
I’m not aware of any NPM modules but thats cause I normally use the Discord Bot Method.
can you send a example code? im kinda new to coding websites
I’ve got nothing I can really show to help you there.
i got no idea how im guna do this
Okay i think i may be able to help
If you click server settings you can enable a widget and copy and paste the code into your website (i started coding a week ago so i may be a bit wrong)
But it will take a bit to enable the widget and only displays online members,voice channels and Does not update on new member as far as i know
i hope i helped you
you can also get a JSON API that you can use to do it let me get back to you on that
Okay so i am not sure how to do it sadly but i am sure you may be able to think of something
using the JSON API
const express = require("express");
const app = express();
app.get("/servers", function(req, res) {
res.send({"servers": client.guilds.size});
})
in your main file. (like bot.js/app.js)
After that use jquery/ajax (or another service) to get your projectname.glitch.me/servers and use javascript to edit your element.
@anonn so to clearify we are talking about a website
i think you may be on to something tho
He could use a Discord bot to fetch Guild sizes and update it to a website
on occasion by using web requests on a repeating timer
(i have no clue how to do it so i can not help you there)