Skip to content

Commit

Permalink
feat(parser): do not respond with errors in 8ball command
Browse files Browse the repository at this point in the history
  • Loading branch information
Satont committed Sep 5, 2023
1 parent c7cb6a9 commit b31b158
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apps/parser/internal/commands/games/8ball.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ var EightBall = &types.DefaultCommand{
parseCtx.Channel.ID,
).First(&entity).Error; err != nil {
return &types.CommandsHandlerResult{
Result: []string{"Seems like 8ball not configured"},
Result: []string{},
}
}

var parsedSettings model.EightBallSettings
if err := json.Unmarshal(entity.Settings, &parsedSettings); err != nil {
return &types.CommandsHandlerResult{
Result: []string{"Seems like 8ball not configured"},
Result: []string{},
}
}

if !parsedSettings.Enabled {
return &types.CommandsHandlerResult{
Result: []string{"Seems like 8ball not enabled"},
Result: []string{},
}
}

Expand Down

0 comments on commit b31b158

Please sign in to comment.