diff --git a/bot/commands/message/message.go b/bot/commands/message/message.go index b1afe3fd..bcb6b9da 100644 --- a/bot/commands/message/message.go +++ b/bot/commands/message/message.go @@ -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) }