Skip to content

Commit

Permalink
Merge pull request #6 from TeamPickle:fix-all-domestic-result
Browse files Browse the repository at this point in the history
fix: all domestic result
  • Loading branch information
cra1nbow authored Sep 7, 2022
2 parents e9d5bc8 + bac95f8 commit f143359
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions function/commands/status/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
func handleDomesticRegion(ctx context.Context, regionName string, boardData *coronaboard.CoronaBoardData) *api.InteractionResponse {
var status *coronaboard.DomesticNowStatus
for _, v := range boardData.StatDomesticNow {
if v.Region == regionName || (regionName == "전국" && v.Region == "합계") {
if v.Region == regionName {
status = &v
break
}
Expand Down Expand Up @@ -146,7 +146,7 @@ func handleDomestic(ctx context.Context, rawRequest discord.InteractionEvent) *a
}

func (c *StatusCommand) Handle(ctx context.Context, interaction *discord.CommandInteraction, rawRequest discord.InteractionEvent) *api.InteractionResponse {
if len(interaction.Options) == 0 {
if len(interaction.Options) == 0 || interaction.Options[0].String() == "전국" {
return handleDomestic(ctx, rawRequest)
}
return handleRegion(ctx, interaction.Options[0].String())
Expand Down

0 comments on commit f143359

Please sign in to comment.