fix hs
This commit is contained in:
13
main.go
13
main.go
@ -355,8 +355,19 @@ func (h *handler) cmdHS(ctx context.Context, data cmdroute.CommandData) *api.Int
|
|||||||
return errorResponse(err)
|
return errorResponse(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
member := data.Event.Member
|
||||||
|
user := data.Event.User
|
||||||
|
|
||||||
|
var nameToSend string
|
||||||
|
|
||||||
|
if member != nil {
|
||||||
|
nameToSend = member.User.DisplayName
|
||||||
|
} else {
|
||||||
|
nameToSend = user.DisplayName
|
||||||
|
}
|
||||||
|
|
||||||
return &api.InteractionResponseData{
|
return &api.InteractionResponseData{
|
||||||
Content: option.NewNullableString(options.Arg + " was " + data.Event.User.DisplayName + "'s nickname in highschool!"),
|
Content: option.NewNullableString(options.Arg + " was " + nameToSend + "'s nickname in highschool!"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user