Skip to content

Commit

Permalink
fix panic
Browse files Browse the repository at this point in the history
  • Loading branch information
ikafly144 committed Sep 9, 2024
1 parent ff4c1ca commit c7c879a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bot/commands/message/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -748,12 +748,18 @@ func Command(c *components.Components) *generic.Command {
w = u.QueryWordSuffix().Where(wordsuffix.GuildIDIsNil()).FirstX(e)
}

webhookFlag := false
if w.Rule == wordsuffix.RuleWebhook {
c.GetLock("message_pin").Mutex(e.ChannelID).Lock()
webhookFlag = true
}

err = messageSuffixMessageCreateHandler(w, u, e, c)
c.GetLock("message_pin").Mutex(e.ChannelID).Unlock()

if webhookFlag {
c.GetLock("message_pin").Mutex(e.ChannelID).Unlock()
}

if err != nil {
return errors.NewError(err)
}
Expand Down

0 comments on commit c7c879a

Please sign in to comment.