Last active
May 9, 2019 22:38
-
-
Save acollierr17/6c705ed4b90fe5c7a73af7a0091ad6af to your computer and use it in GitHub Desktop.
Server Stats! Set voice channels will update whenever a new member joins/leaves the guild. Make sure to update the guild and channel IDs in the serverStats.js file. Also make sure the channels for each stat is created and you have those channel IDs in the serverStats.js file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Posts server stats to specific voice channels! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { guildID, totalUsersID, memberCountID, botCountID } = require('../utils/serverStats'); // change to whatever path the serverStats.js file is located | |
module.exports = async (client, member) => { | |
if (member.guild.id !== guildID) return; | |
client.channels.get(totalUsersID).setName(`Total Users: ${member.guild.memberCount}`); | |
client.channels.get(memberCountID).setName(`Members: ${member.guild.members.filter(m => !m.user.bot).size}`); | |
client.channels.get(botCountID).setName(`Bots: ${member.guild.members.filter(m => m.user.bot).size}`); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { guildID, totalUsersID, memberCountID, botCountID } = require('../utils/serverStats'); // change to whatever path the serverStats.js file is located | |
module.exports = async (client, member) => { | |
if (member.guild.id !== guildID) return; | |
client.channels.get(totalUsersID).setName(`Total Users: ${member.guild.memberCount}`); | |
client.channels.get(memberCountID).setName(`Members: ${member.guild.members.filter(m => !m.user.bot).size}`); | |
client.channels.get(botCountID).setName(`Bots: ${member.guild.members.filter(m => m.user.bot).size}`); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
guildID: 'GUILD_ID', // ID for the guild/server | |
totalUsersID: 'TOTAL_USERS_CHANNEL_ID', // ID for the voice channel where the total users should be. By default, set this: Total: 0 | |
memberCountID: 'MEMBERS_CHANNEL_ID', // ID for the voice channel where the member count should be. By default, set this: Members: 0 | |
botCountID: 'BOTS_CHANNEL_ID' // ID for the voice channel where the bot count should be. By default, set this: Bots: 0 | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment