Skip to content

Commit

Permalink
added defered panic recover
Browse files Browse the repository at this point in the history
  • Loading branch information
ashishjh-bst committed Jun 28, 2024
1 parent 5febe79 commit f9602a1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions moderation/punishments.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,11 @@ func sendPunishDM(config *Config, dmMsg string, action ModlogAction, gs *dstate.
}

func KickUser(config *Config, guildID int64, channel *dstate.ChannelState, message *discordgo.Message, author *discordgo.User, reason string, user *discordgo.User, del int) error {
defer func() {
if r := recover(); r != nil {
logger.Infof("Recovered from panic: %#v", r)
}
}()
config, err := GetConfigIfNotSet(guildID, config)
if err != nil {
return common.ErrWithCaller(err)
Expand Down

1 comment on commit f9602a1

@silviaisnotok
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this outage is driving me crazy 😿

Please sign in to comment.