Skip to content

Commit

Permalink
[Fix] fixed guild events
Browse files Browse the repository at this point in the history
  • Loading branch information
naseif committed Nov 27, 2021
1 parent 92608a7 commit 675f982
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
10 changes: 6 additions & 4 deletions events/guildCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ module.exports = {
return;
}
await registerSlashCommands(guild.client.user.id, guild.id);
const guilds = client.guilds.cache.map((guild) => guild.id);
client.user.setActivity(`Music in ${guilds.length} Servers!`, {
type: "PLAYING",
});
guild.client.user.setActivity(
`Music in ${guild.client.guilds.cache.size} Servers!`,
{
type: "PLAYING",
}
);
},
};
10 changes: 6 additions & 4 deletions events/guildDelete.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
module.exports = {
name: "guildDelete",
async execute(guild) {
const guilds = client.guilds.cache.map((guild) => guild.id);
client.user.setActivity(`Music in ${guilds.length} Servers!`, {
type: "PLAYING",
});
guild.client.user.setActivity(
`Music in ${guild.client.guilds.cache.size} Servers!`,
{
type: "PLAYING",
}
);
},
};
3 changes: 1 addition & 2 deletions events/ready.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ module.exports = {
}
});
console.log(`Ready! Logged in as ${client.user.tag}`);
const guilds = client.guilds.cache.map((guild) => guild.id);
client.user.setActivity(`Music in ${guilds.length} Servers!`, {
client.user.setActivity(`Music in ${client.guilds.cache.size} Servers!`, {
type: "PLAYING",
});
},
Expand Down

0 comments on commit 675f982

Please sign in to comment.