Skip to content

Commit

Permalink
fix: dont disable webhooks for unavailable guilds
Browse files Browse the repository at this point in the history
  • Loading branch information
Snazzah committed Dec 14, 2024
1 parent 89f8a1a commit d3f262d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ export function onGuildJoin(guild: Eris.Guild) {
}

export async function onGuildLeave(guild: Eris.Guild) {
logger.info(`Left guild ${guild.name} (${guild.id})`);
logger.info(`Left guild ${guild.name} (${guild.id}, unavailable=${guild.unavailable})`);
// deactivate guild webhooks
await prisma.webhook.updateMany({
where: { guildID: guild.id },
data: { active: false }
});
if (!guild.unavailable)
await prisma.webhook.updateMany({
where: { guildID: guild.id },
data: { active: false }
});
}

interface WebhooksUpdateEvent {
Expand Down

0 comments on commit d3f262d

Please sign in to comment.