Skip to content

Commit

Permalink
Update handlers.go
Browse files Browse the repository at this point in the history
  • Loading branch information
XangelMusic authored Sep 18, 2024
1 parent 8164a2a commit 8d47ab4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions handlers/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,11 @@ func OnGuildBanAdd(b *bot.Bot) func(*discordgo.Session, *discordgo.GuildBanAdd)

func OnChannelDelete(b *bot.Bot) func(*discordgo.Session, *discordgo.ChannelDelete) {
return func(s *discordgo.Session, ch *discordgo.ChannelDelete) {
log := b.Log.With("channel_id", ch.ID, "guild_id", ch.GuildID)

guild, err := b.Store.Guild(b.Context, ch.GuildID)
if err != nil {
log.With("error", err).Warn("failed to find guild")
return
}

Expand All @@ -152,6 +155,10 @@ func OnChannelDelete(b *bot.Bot) func(*discordgo.Session, *discordgo.ChannelDele
guild.ID,
[]string{ch.ID},
)

if err != nil {
log.With("error", err).Warn("failed to delete art channel")
}
}
}
}
Expand Down

0 comments on commit 8d47ab4

Please sign in to comment.