Skip to content

Commit

Permalink
fixed nilness issue
Browse files Browse the repository at this point in the history
  • Loading branch information
izikdepth committed Jan 31, 2024
1 parent 8a069c4 commit 5700353
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions discord/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,13 @@ func claimCommandHandler(db *DiscordBot, s *discordgo.Session, i *discordgo.Inte
command := fmt.Sprintf("claim %s %s %s", discordId, testnetAddr, mainnetAddr)

// Check if db or db.BotEngine is nil
if db == nil || db.BotEngine == nil {
msg := "db or bot engine is nil."
// if db == nil || db.BotEngine == nil {
// msg := "db or bot engine is nil."
// _, _ = s.ChannelMessageSend(i.ChannelID, msg)
// return
// }
if db.BotEngine == nil {
msg := "bot engine is nil."
_, _ = s.ChannelMessageSend(i.ChannelID, msg)
return
}
Expand Down Expand Up @@ -127,7 +132,6 @@ func claimerInfoCommandHandler(db *DiscordBot, s *discordgo.Session, i *discordg
if err != nil {
fmt.Println(err)
}

}

func nodeInfoCommandHandler(db *DiscordBot, s *discordgo.Session, i *discordgo.InteractionCreate) {
Expand Down

0 comments on commit 5700353

Please sign in to comment.