Skip to content

Commit

Permalink
chore: fix get all referrals
Browse files Browse the repository at this point in the history
  • Loading branch information
kehiy committed Dec 7, 2023
1 parent 256cddb commit 2117aa8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion discord/discord.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func Start(cfg *config.Config, w *wallet.Wallet, ss *SafeStore, rs *ReferralStor
log.Printf("error creating Discord session: %v", err)
return nil, err
}
bot := &Bot{cfg: cfg, discordSession: dg, faucetWallet: w, store: ss, cm: cm}
bot := &Bot{cfg: cfg, discordSession: dg, faucetWallet: w, store: ss, cm: cm, referralStore: rs}

// Register the messageCreate func as a callback for MessageCreate events.
dg.AddHandler(bot.messageHandler)
Expand Down
5 changes: 1 addition & 4 deletions discord/referral.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,7 @@ func (rs *ReferralStore) GetAllReferrals() []*Referral {
rs.syncMap.Range(func(key, value any) bool {
referral, _ := value.(*Referral)
result = append(result, referral)
if value == nil {
return true
}
return false
return value == nil
})

return result
Expand Down

0 comments on commit 2117aa8

Please sign in to comment.