Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ijsbol/webcord
Want to display your Discord servers member count on your website? Here.
https://github.com/ijsbol/webcord
Last synced: 2 days ago
JSON representation
Want to display your Discord servers member count on your website? Here.
- Host: GitHub
- URL: https://github.com/ijsbol/webcord
- Owner: ijsbol
- License: apache-2.0
- Created: 2020-07-15T13:59:59.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-02-02T21:27:15.000Z (almost 3 years ago)
- Last Synced: 2025-01-01T00:25:52.565Z (8 days ago)
- Language: PHP
- Size: 8.79 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Webcord
If you want to display the number of people on your website, click here.
## Authors
Scrumpy - Project LeadAlphaDev - the guy who made the readme.md
## Usage
**Refer to the membercount.php file for more.**
Make sure to put the bot token in for authorization and replace the Discord Server ID -
```html
[
"method" => "GET",
"header" => 'Authorization: Bot PUT_YOUR_DISCORD_BOT_TOKEN_HERE'
]
];$context = stream_context_create($opts);
$file = file_get_contents('https://discordapp.com/api/guilds/DISCORD_SERVER_ID?with_counts=true', false, $context);
$file = json_decode($file, true);
$membercount = intval($file["approximate_member_count"]);
?>
```Example usage down below.
```html
[
"method" => "GET",
"header" => 'Authorization: Bot PUT_YOUR_DISCORD_BOT_TOKEN_HERE'
]
];$context = stream_context_create($opts);
$file = file_get_contents('https://discordapp.com/api/guilds/DISCORD_SERVER_ID?with_counts=true', false, $context);
$file = json_decode($file, true);
$membercount = intval($file["approximate_member_count"]);
?>```