-
Notifications
You must be signed in to change notification settings - Fork 0
/
statsupdate.js
39 lines (38 loc) · 2.37 KB
/
statsupdate.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
module.exports = {
/*Client.setInterval(function() {
Client.statchannelsGuilds.fetchAll().then(guilds => {
guilds.forEach(guild => {
Client.statchannels.fetch(guild, { target: '.ms' }).then(ms => ms.setName('Member: ' + msg.guild.members.filter(m => !(m.user.bot)).size));
Client.statchannels.fetch(guild, { target: '.bs' }).then(bs => bs.setName('Bots: ' + msg.guild.members.filter(m => m.user.bot).size));
Client.statchannels.fetch(guild, { target: '.tcs' }).then(tcs => tcs.setName('Text channels: ' + msg.guild.channels.filter(c => c.type == 'text').size));
Client.statchannels.fetch(guild, { target: '.vcs' }).then(vcs => vcs.setName('Voice channels: ' + (msg.guild.channels.filter(c => c.type == 'voice').size - 3)));
});
})
}, 30);*/
async channel(guild, Client) {
var statchannels = Client.statchannels
statchannels.fetch(guild).then(isGuild => {
if (isGuild != null) {
if (Client.channels.find(c => c.name.startsWith('Text channels:')).type == 'voice') {
Client.channels.find(c => c.name.startsWith('Text channels:')).setName('Text channels: ' + Client.guilds.get(guild).guild.channels.filter(c => c.type == 'text').size);
}
if (Client.channels.find(c => c.name.startsWith('Voice channels:')).type == 'voice') {
Client.channels.find(c => c.name.startsWith('Voice channels:')).setName('Voice channels: ' + (Client.guilds.get(guild).channels.filter(c => c.type == 'voice').size - 3));
}
}
});
},
async member(guild, Client) {
var statchannels = Client.statchannels;
statchannels.fetch(guild).then(isGuild => {
if (isGuild != null) {
if (Client.channels.find(c => c.name.startsWith('Members:')).type == 'voice') {
Client.channels.find(c => c.name.startsWith('Members:')).setName('Members: ' + Client.guilds.get(guild).members.filter(m => !(m.user.bot)).size);
}
if (Client.channels.find(c => c.name.startsWith('Bots:')).type == 'voice') {
Client.channels.find(c => c.name.startsWith('Bots:')).setName('Bots: ' + Client.guilds.get(guild).members.filter(m => m.user.bot).size);
}
}
});
}
}