Skip to content

Commit

Permalink
make scope
Browse files Browse the repository at this point in the history
  • Loading branch information
ikafly144 committed Sep 9, 2024
1 parent c7c879a commit 78eaaeb
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions bot/commands/message/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -748,16 +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
}
{
webhookFlag := false
if w.Rule == wordsuffix.RuleWebhook {
c.GetLock("message_pin").Mutex(e.ChannelID).Lock()
webhookFlag = true
}

err = messageSuffixMessageCreateHandler(w, u, e, c)
err = messageSuffixMessageCreateHandler(w, u, e, c)

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

if err != nil {
Expand Down

0 comments on commit 78eaaeb

Please sign in to comment.