From 8feee318b7960113b20973e0cc17ecbbba0110c0 Mon Sep 17 00:00:00 2001 From: Carlosokumu Date: Wed, 18 Sep 2024 09:39:53 +0300 Subject: [PATCH] split symbol --- internal/handlers/ussd/menuhandler.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/internal/handlers/ussd/menuhandler.go b/internal/handlers/ussd/menuhandler.go index b01869b..3f468c3 100644 --- a/internal/handlers/ussd/menuhandler.go +++ b/internal/handlers/ussd/menuhandler.go @@ -123,12 +123,12 @@ func (h *Handlers) SetLanguage(ctx context.Context, sym string, input []byte) (r var res resource.Result sym, _ = h.st.Where() - - switch sym { - case "set_default": + code := strings.Split(sym, "_")[1] + switch code { + case "default": res.FlagSet = append(res.FlagSet, state.FLAG_LANG) res.Content = "eng" - case "set_swa": + case "swa": res.FlagSet = append(res.FlagSet, state.FLAG_LANG) res.Content = "swa" default: @@ -645,7 +645,6 @@ func (h *Handlers) QuitWithHelp(ctx context.Context, sym string, input []byte) ( return res, nil } - // VerifyYob verifies the length of the given input func (h *Handlers) VerifyYob(ctx context.Context, sym string, input []byte) (resource.Result, error) { var res resource.Result