From d0a1348729afe3c6a5109e051c906395e4d9b04c Mon Sep 17 00:00:00 2001 From: Adam Reuben Date: Wed, 9 Nov 2022 18:25:09 +0300 Subject: [PATCH] change choice key --- main/main.go | 84 +++++++++++++++++++--------------------------------- 1 file changed, 30 insertions(+), 54 deletions(-) diff --git a/main/main.go b/main/main.go index 20739a4..7798aba 100644 --- a/main/main.go +++ b/main/main.go @@ -5,40 +5,24 @@ import "github.com/adamwreuben/GoBot" func main() { intents := make(map[string]interface{}) stories := make(map[string]interface{}) + // states := make(map[string]interface{}) //Create intents - intents["kujiunga"] = []string{ - "nataka kujiunga chama", - "kujiunga chama", - "jisali kwenye chama", - "sajili kwenye chama", - "niongeze kwenye chama", - } - - intents["lipa"] = []string{ - "lipa ada", - "nataka kulipa ada", - "nataka kutuma ada", - "lipia ada ya uanachama", - "lipia ada ya chama", - "tuma ada", - } - - intents["repoti"] = []string{ - "nataka repoti", - "nitumie report", - "naomba repoti ya mwezi huu", - "nataka repoti", - "repoti", - "repoti ipo wapi ya chama", - } - - intents["sheria"] = []string{ - "sheria za chama", - "sheria", - "sheria ni zipi", - "nataka sheria", - "naomba sheria", + intents["salam"] = []string{ + "mambo", + "vipi", + "upo poa", + "fresh", + "nambie", + "nakuona", + "salama", + "za asubuhi", + "za mchana", + "uko poa", + "niaje", + "hello", + "oya", + "kama kawa", } intents["cancel"] = []string{ @@ -51,10 +35,19 @@ func main() { //creating stories - stories["kujiunga"] = map[string]interface{}{ - "message": "Karibu sana , kujiunga na chama jaza taarifa kwenye fomu hii hapa chini\n\n https://www.google.com", - "choices": nil, - "next": nil, //nil means end + stories["salam"] = map[string]interface{}{ + "message": `Habari karibu sana TBC, sasa unaweza tuma ujumbe wako moja kwa moja kwenye kipindi ukipendacho`, + "salam_choices": []string{ + "1. Busati", + "2. Sasambu", + "3. Sekeseke", + "4. Millazo EP", + "5. Simela", + "6. Kinaganaga", + "7. Papaso", + "8. Ligi Kuu Tanzania", + }, + "next": nil, //nil means end } stories["cancel"] = map[string]interface{}{ @@ -63,23 +56,6 @@ func main() { "next": nil, } - stories["repoti"] = map[string]interface{}{ - "message": "https://firebasestorage.googleapis.com/v0/b/song-d1bd1.appspot.com/o/Reports%2FDebit%20Mandate_API%20Specification%20Document_Biller_v1.2.pdf?alt=media&token=9de278d6-c8ae-45a4-9a44-0db7f72bfd2b", - "choices": nil, - "next": nil, - } - - stories["lipa"] = map[string]interface{}{ - "message": "Lipa ada ya chama kupitia", - "lipa_choices": []string{ - "1. Airtel Money", - "2. Mpesa", - "3. Tigo Pesa", - }, - "next": nil, - "choice_fallback": "Sorry, lipia kwa mitandao iliyopo!", - } - stories["fallback"] = map[string]interface{}{ "message": "Sijaelewa unataka nini?", "choices": nil, @@ -87,7 +63,7 @@ func main() { } //Create GoBot instance - goBot := GoBot.NewGoBot(intents, stories) + goBot := GoBot.NewGoBot(intents, stories, nil) goBot.Playground() }