Skip to content

Instantly share code, notes, and snippets.

@acollierr17
Last active May 9, 2019 22:38
Show Gist options
  • Select an option

  • Save acollierr17/6c705ed4b90fe5c7a73af7a0091ad6af to your computer and use it in GitHub Desktop.

Select an option

Save acollierr17/6c705ed4b90fe5c7a73af7a0091ad6af to your computer and use it in GitHub Desktop.

Revisions

  1. acollierr17 revised this gist May 9, 2019. 3 changed files with 3 additions and 5 deletions.
    2 changes: 1 addition & 1 deletion guildMemberAdd.js
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    const { serverStats: { guildID, totalUsersID, memberCountID, botCountID } } = require('../utils/serverStats'); // change to whatever path the serverStats.js file is located
    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;
    2 changes: 1 addition & 1 deletion guildMemberRemove.js
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    const { serverStats: { guildID, totalUsersID, memberCountID, botCountID } } = require('../utils/serverStats'); // change to whatever path the serverStats.js file is located
    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;
    4 changes: 1 addition & 3 deletions serverStats.js
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,6 @@
    const serverStats = {
    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
    };

    module.exports = { serverStats };
  2. acollierr17 revised this gist Jan 14, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion serverStats.js
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    const serverStats = {
    guildID: 'GUILD_ID',
    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
  3. acollierr17 revised this gist Jan 14, 2019. 2 changed files with 2 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion guildMemberAdd.js
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    const { serverStats: { guildID, totalUsersID, memberCountID, botCountID } } = require('../utils/utils');
    const { serverStats: { 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;
    2 changes: 1 addition & 1 deletion guildMemberRemove.js
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    const { serverStats: { guildID, totalUsersID, memberCountID, botCountID } } = require('../utils/utils');
    const { serverStats: { 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;
  4. acollierr17 revised this gist Nov 3, 2018. 2 changed files with 4 additions and 3 deletions.
    1 change: 1 addition & 0 deletions aServerStats
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    Posts server stats to specific voice channels!
    6 changes: 3 additions & 3 deletions serverStats.js
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,8 @@
    const serverStats = {
    guildID: 'GUILD_ID',
    totalUsersID: 'TOTAL_USERS_CHANNEL_ID', // ID for the channel where the total users should be. By default, set this: Total: 0
    memberCountID: 'MEMBERS_CHANNEL_ID', // ID for the channel where the member count should be. By default, set this: Members: 0
    botCountID: 'BOTS_CHANNEL_ID' // ID for the channel where the bot count should be. By default, set this: Bots: 0
    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
    };

    module.exports = { serverStats };
  5. acollierr17 created this gist Nov 3, 2018.
    8 changes: 8 additions & 0 deletions guildMemberAdd.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    const { serverStats: { guildID, totalUsersID, memberCountID, botCountID } } = require('../utils/utils');

    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}`);
    }
    8 changes: 8 additions & 0 deletions guildMemberRemove.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    const { serverStats: { guildID, totalUsersID, memberCountID, botCountID } } = require('../utils/utils');

    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}`);
    }
    8 changes: 8 additions & 0 deletions serverStats.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    const serverStats = {
    guildID: 'GUILD_ID',
    totalUsersID: 'TOTAL_USERS_CHANNEL_ID', // ID for the channel where the total users should be. By default, set this: Total: 0
    memberCountID: 'MEMBERS_CHANNEL_ID', // ID for the channel where the member count should be. By default, set this: Members: 0
    botCountID: 'BOTS_CHANNEL_ID' // ID for the channel where the bot count should be. By default, set this: Bots: 0
    };

    module.exports = { serverStats };