Skip to content

Commit

Permalink
actually this whole statement was wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
Techbot121 authored and Meta Construct committed Dec 1, 2024
1 parent 0c2b953 commit b6c58e3
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions app/services/discord/modules/discord-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,12 @@ export default (bot: DiscordBot): void => {
) => {
console.log(`Event "${event.name}" ended! Removing roles...`);
const users = await GetParticipants(event);
if (users.length === 0) {
return;
if (users.length > 0) {
users.forEach(usr => {
if (usr.roles.cache.some(role => role.id === DiscordConfig.roles.event))
usr.roles.remove(DiscordConfig.roles.event);
});
}
users.forEach(usr => {
if (usr.roles.cache.some(role => role.id === DiscordConfig.roles.event))
usr.roles.remove(DiscordConfig.roles.event);
});
await event.guild?.setIcon(data.lastDiscordGuildIcon);
await bot.discord.user?.setAvatar(data.lastDiscordGuildIcon);
await bot.setNickname(data.lastDiscordNickName, event.name + " ended");
Expand Down

0 comments on commit b6c58e3

Please sign in to comment.