From b5b19ab844de394870bd3cfe793e482ebdaeaf92 Mon Sep 17 00:00:00 2001 From: Ringo Hoffmann Date: Tue, 5 Oct 2021 10:01:18 +0200 Subject: [PATCH] fix getbynameoptional return order --- options.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/options.go b/options.go index 2ca9bef..e6bbe88 100644 --- a/options.go +++ b/options.go @@ -30,7 +30,7 @@ func (co CommandOptions) Options(i int) CommandOptions { // name does not exist, the returned value for ok is false. // // This should be used for non-required options. -func (co CommandOptions) GetByNameOptional(name string) (ok bool, opt *discordgo.ApplicationCommandInteractionDataOption) { +func (co CommandOptions) GetByNameOptional(name string) (opt *discordgo.ApplicationCommandInteractionDataOption, ok bool) { for _, c := range co { if c.Name == name { ok = true @@ -45,6 +45,6 @@ func (co CommandOptions) GetByNameOptional(name string) (ok bool, opt *discordgo // // This should only be used on required options. func (co CommandOptions) GetByName(name string) (opt *discordgo.ApplicationCommandInteractionDataOption) { - _, opt = co.GetByNameOptional(name) + opt, _ = co.GetByNameOptional(name) return }