diff --git a/discord/discord.go b/discord/discord.go index 4d9b4d5d..e379d606 100644 --- a/discord/discord.go +++ b/discord/discord.go @@ -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) diff --git a/discord/referral.go b/discord/referral.go index 563e00bc..7c56a8c1 100644 --- a/discord/referral.go +++ b/discord/referral.go @@ -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