Skip to content

Commit

Permalink
plugins: (message-roles) Fix concurrency race in MessageTopCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
5HT2 committed Aug 5, 2023
1 parent 0c3c7b9 commit 7062e1b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plugins/message-roles/message-roles.go
Expand Up @@ -431,6 +431,9 @@ func MessageRolesConfigCommand(c bot.Command) error {
}

func MessageTopCommand(c bot.Command) error {
mutex.Lock()
defer mutex.Unlock()

if cfg, ok := p.Config.(config).GuildUsers[c.E.GuildID.String()]; ok {
topUsers := make([]string, 0)

Expand Down

0 comments on commit 7062e1b

Please sign in to comment.