{"id":37087880,"url":"https://github.com/adamwreuben/gobot","last_synced_at":"2026-01-14T10:48:27.277Z","repository":{"id":62894170,"uuid":"563076162","full_name":"adamwreuben/GoBot","owner":"adamwreuben","description":"Build Chat Bots fast and easy.","archived":false,"fork":false,"pushed_at":"2023-04-10T06:35:48.000Z","size":296,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-21T18:09:48.761Z","etag":null,"topics":["chat","chatbot","chatbot-framework","sarufi","sarufi-laravel","sarufi-php","sarufi-sdk","telegram-bot","telegram-bot-api","whatapp-bot"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adamwreuben.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-07T21:20:06.000Z","updated_at":"2024-01-02T19:19:52.000Z","dependencies_parsed_at":"2024-06-20T16:32:09.194Z","dependency_job_id":"456de4fe-01fe-4cf2-8bce-293e423e1fc5","html_url":"https://github.com/adamwreuben/GoBot","commit_stats":{"total_commits":69,"total_committers":1,"mean_commits":69.0,"dds":0.0,"last_synced_commit":"460fe855610a02bf50f281e1975c6b7073860264"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/adamwreuben/GoBot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamwreuben%2FGoBot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamwreuben%2FGoBot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamwreuben%2FGoBot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamwreuben%2FGoBot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adamwreuben","download_url":"https://codeload.github.com/adamwreuben/GoBot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamwreuben%2FGoBot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28417716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chat","chatbot","chatbot-framework","sarufi","sarufi-laravel","sarufi-php","sarufi-sdk","telegram-bot","telegram-bot-api","whatapp-bot"],"created_at":"2026-01-14T10:48:26.642Z","updated_at":"2026-01-14T10:48:27.271Z","avatar_url":"https://github.com/adamwreuben.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"GoBot\n=======\n![GoPesa](https://storage.googleapis.com/gopherizeme.appspot.com/gophers/11fa3afd6080dae6903dc359e42990d68657e17a.png)\n\n``GoBot`` is a Go library for building chat bots super fast and easily similar to Sarufu.io but without AI. \n[![Made in Tanzania](https://img.shields.io/badge/made%20in-tanzania-008751.svg?style=flat-square)](https://github.com/Tanzania-Developers-Community/made-in-tanzania)\n\n\n# Why I made GoBot\n\nIt’s no longer about a race car, it’s a boat. And steering a boat requires too much damn planning and patience, So if ``GoBot`` succeeds, it really never was me, it’s the people there who can drive boats (open community). As I am with the world, I am a cheerleader.\n\nDoing all this is just a hobby, is just a way to write some open source infrastructure so I’m not doing nothing. It’s not the future.\n\n``Lets make our open community safe``\n\n\n\nGoBot Terminology\n====================\n\n``Intent``  Is a user's intention or goal when interacting with a chatbot. For example, if a user asks a chatbot a question, the intent of the user is to get an answer to the question. If a user asks a chatbot to order food, the intent of the user is to order food.\n\n``Stories`` Is conversation between a user and a chatbot. Stories is the one that controls the flow of conversation.\n\n\n\n## Installation\n\nSimply install with the `go get` command:\n```\ngo get github.com/adamwreuben/GoBot@v0.0.6\n```\nThen import it to your main package as:\n```\npackage main\n\nimport (\n\tgobot \"github.com/adamwreuben/GoBot\"\n)\n```\n\n## Uninstallation\nSimply uninstall with the `go get` command:\n```\ngo get github.com/adamwreuben/GoBot@none\n```\n\n# Usage\nFirst you need to create ``Intent`` and ``stories`` variable of type ``map[string]interface{}`` inside your ``main.go`` as follows:\n```\nintents := make(map[string]interface{})\nstories := make(map[string]interface{})\n\n```\n\n# GoBot story types\n``echo`` - This is the default story that echo back to user\n\nExample of ``echo`` story below:\n```\nstories[\"greeting\"] = map[string]interface{}{\n\t\t\"message\": []string{\n\t\t\t\"Welcom to Pizza plaza, what can i help you\",\n\t\t\t\"Hello, welcome, what can i do for you?\",\n\t\t},\n\t\t\"type\": \"echo\", //GoBot stories must have types\n\t\t\"next\": nil,\n\t}\n\n```\n\n\n\n``form`` - This is the story that ask user a couple of questions and save it in memory\nExample of ``form`` story below:\n```\nstories[\"registration\"] = map[string]interface{}{\n\t\t\"message\": \"Welcome to Pizza social club\",\n\t\t\"type\":    \"form\",\n\t\t\"sajili_form\": GoBot.GoBotForm{\n\t\t\tHeader: \"Please answer the following question to register you, to our club!\",\n\t\t\tForm: []GoBot.Form{\n\t\t\t\t{\n\t\t\t\t\tVariable: \"name\",\n\t\t\t\t\tHint:     \"Your full name\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tVariable: \"age\",\n\t\t\t\t\tHint:     \"Your age?\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tIntentAction:   intents[\"send\"].([]string),\n\t\t\tIntentCancel:   intents[\"cancel\"].([]string),\n\t\t\tConfirmMessage: \"Do you confirm that you have provided, real information\",\n\t\t\tActionMessage:  \"Thanks, your information has been sent!\",\n\t\t\tCancelMessage:  \"Sorry, answer all questions needed!\",\n\t\t},\n\t\t\"next\": nil,\n\t}\n\n```\n\n\n``choices`` - This is the story where user has to select one choice out of many options\nExample of ``choices`` story below:\n```\nstories[\"order\"] = map[string]interface{}{\n\t\t\"message\": `Please choose pizza you want?`,\n\t\t\"order_choices\": GoBot.GoBotChoice{ // Note here key of story is written in this format key_name_choices\n\t\t\tHeader:               \"The following is our menu\\n1. Cheese Pizza\\n2. Chicken Pizza\\n3.Sausage Pizza\\n\\n#Please select our choice\",\n\t\t\tSuccessChoiceMessage: \"Thanks for choosing, your order is being processed\",\n\t\t\tErrorChoiceMessage:   \"Sorry the choice you selected, is not present by now!\",\n\t\t\tChoices: []string{\n\t\t\t\t\"Cheese Pizza\",\n\t\t\t\t\"Chicken Pizza\",\n\t\t\t\t\"Sausage Pizza\",\n\t\t\t},\n\t\t\tIntentAction: intents[\"action\"].([]string),\n\t\t\tIntentCancel: intents[\"cancel\"].([]string),\n\t\t},\n\t\t\"type\": \"choices\", // type of choices\n\t\t\"next\": nil, //nil means end\n\t}\n\n```\n\n\n``input`` - This is the story that save user answer in memory GoBot Instance\nExample of ``input`` story below:\n```\nstories[\"order_number\"] = map[string]interface{}{\n\t\t\"message\": \"Unapenda team gani?\",\n\t\t\"type\":    \"input\",\n\t\t\"order_number_input\": GoBot.GoBotInput{\n\t\t\tHeader: \"How many do you want?\",\n\t\t\tForm: GoBot.Form{\n\t\t\t\tVariable: \"size\",\n\t\t\t\tHint:     \"How many pizza do you want?\",\n\t\t\t},\n\t\t\tIntentAction:        intents[\"action\"].([]string),\n\t\t\tIntentCancel:        intents[\"cancel\"].([]string),\n\t\t\tSuccessInputMessage: \"#Thanks your order is being processed\\n#OrderId: 23434\",\n\t\t\tErrorInputMessage:   \"Please tell me, how many pizza do you want?\",\n\t\t},\n\t\t\"next\": nil,\n\t}\n\n```\n\n\n## Creating Intents\nThen start creating intent, by providing key to intents as intent name as follows, In this demo we will create an ordering pizza chatbot, The followings are its intents.\n\n```\nintents[\"greeting\"] = []string{\n\t\t\"hello\",\n\t\t\"hi\",\n\t\t\"how are you\",\n\t\t\"morning\",\n\t\t\"afternoon\",\n\t\t\"evening\",\n\t}\n\n\tintents[\"order\"] = []string{\n\t\t\"order pizza\",\n\t\t\"i want pizza\",\n\t\t\"i want piza\",\n\t\t\"i want piz\",\n\t\t\"give me piza\",\n\t\t\"give me pizza\",\n\t\t\"pizza\",\n\t\t\"piza\",\n\t\t\"piz\",\n\t}\n\n\tintents[\"menu\"] = []string{\n\t\t\"what pizza do you have\",\n\t\t\"menu\",\n\t\t\"menu please\",\n\t}\n\n\tintents[\"action\"] = []string{\n\t\t\"yes\",\n\t\t\"i want this\",\n\t\t\"order this\",\n\t\t\"bring now\",\n\t\t\"give me this\",\n\t\t\"give me\",\n\t\t\"yes please\",\n\t\t\"alright\",\n\t\t\"okay\",\n\t}\n\n\tintents[\"cancel\"] = []string{\n\t\t\"stop\",\n\t\t\"cancel\",\n\t}\n\n```\n\nFrom above we have create 3 intents namely ``greets``,   ``cancel``,  ``order_pizza``\n\n## Creating stories (Dialog flow)\nCreating stories is simple, make sure that the ``Key name of the intent`` matches the ``key name of the story``, by doing so GoBot we know exactly which intent corresponds to what story.\n\nExample of stories according to our ordering pizza chatbot\n\n```\nstories[\"greeting\"] = map[string]interface{}{\n\t\t\"message\": []string{\n\t\t\t\"Welcom to Pizza plaza, what can i help you\",\n\t\t\t\"Hello, welcome, what can i do for you?\",\n\t\t},\n\t\t\"type\": \"echo\",\n\t\t\"next\": nil,\n\t}\n\n\t//Order pizza choice\n\tstories[\"order\"] = map[string]interface{}{\n\t\t\"message\": `Please choose pizza you want?`,\n\t\t\"order_choices\": GoBot.GoBotChoice{\n\t\t\tHeader:               \"The following is our menu\\n1. Cheese Pizza\\n2. Chicken Pizza\\n3.Sausage Pizza\\n\\n#Please select our choice\",\n\t\t\tSuccessChoiceMessage: \"Thanks for choosing, your order is being processed\",\n\t\t\tErrorChoiceMessage:   \"Sorry the choice you selected, is not present by now!\",\n\t\t\tChoices: []string{\n\t\t\t\t\"Cheese Pizza\",\n\t\t\t\t\"Chicken Pizza\",\n\t\t\t\t\"Sausage Pizza\",\n\t\t\t},\n\t\t\tIntentAction: intents[\"action\"].([]string),\n\t\t\tIntentCancel: intents[\"cancel\"].([]string),\n\t\t},\n\t\t\"type\": \"choices\",\n\t\t\"next\": \"order_number\", //nil means end\n\t}\n\n\tstories[\"order_number\"] = map[string]interface{}{\n\t\t\"message\": \"Unapenda team gani?\",\n\t\t\"type\":    \"input\",\n\t\t\"order_number_input\": GoBot.GoBotInput{\n\t\t\tHeader: \"How many do you want?\",\n\t\t\tForm: GoBot.Form{\n\t\t\t\tVariable: \"size\",\n\t\t\t\tHint:     \"How many pizza do you want?\",\n\t\t\t},\n\t\t\tIntentAction:        intents[\"action\"].([]string),\n\t\t\tIntentCancel:        intents[\"cancel\"].([]string),\n\t\t\tSuccessInputMessage: \"#Thanks your order is being processed\\n#OrderId: 23434\",\n\t\t\tErrorInputMessage:   \"Please tell me, how many pizza do you want?\",\n\t\t},\n\t\t\"next\": nil,\n\t}\n\n\t//story for menu\n\tstories[\"menu\"] = map[string]interface{}{\n\t\t\"message\": \"The following is our menu,\\n\\n 1. Cheese Pizza\\n2. Chicken Pizza\\n3.Sausage Pizza\\n\\n #Welcome\",\n\t\t\"type\":    \"echo\",\n\t\t\"next\":    nil,\n\t}\n\n\t//Defaults one... These are like Addons to GoBot so as it can cancel any action\n\tstories[\"cancel\"] = map[string]interface{}{\n\t\t\"message\": \"I gotch you, welcome again\",\n\t\t\"type\":    \"echo\",\n\t\t\"next\":    nil,\n\t}\n\n\tstories[\"fallback\"] = map[string]interface{}{\n\t\t\"message\": []string{\n\t\t\t\"Hello, I didn't understand you?,\",\n\t\t\t\"Sorry, I didn't get what you want!\",\n\t\t},\n\t\t\"type\": \"echo\",\n\t\t\"next\": nil,\n\t}\n\n```\n\nBut also if you want you stories to answer user in random way, you do this. For example here, when the use type bye, GoBot should respond with words like ``Karibu tena`` or ``Bye, welcome again`` etc... To do so u need to use ``[]string struct`` other than ``string``\n\nConsider an example below\n\n```\nstories[\"goodbye\"] = map[string]interface{}{\n\t\t\"message\": []string{\n\t\t\t\"Karibu tena\",\n\t\t\t\"Bye, welcome again\",\n\t\t},\n\t\t\"choices\": nil,\n\t\t\"next\":    nil,\n\t}\n\n```\n\n``NB`` The following must be provided as ``AddOns`` to GoBot to ensure it can cancel execution when the user type ``Intents from cancel intent``\nFrom above stories, the following are Special stories key which are recognized by ``GoBot`` which are ``cancel`` - which is responsible to cancel any excution of the bot. and ``fallback`` - This is a default answer ``GoBot`` Gives when it doesn't understand the user intent.\n\n## Understanding story keys\n```\nIf key are not provided, GoBot will assume all keys are nil\n```\nAs you can see story has following keys\n1. message - This is the response, which will be sent by GoBot.\n2. next - This link another story.\n3. choices - This acts as creating list of options to choose for (For example in our example Pizza type has choice)\n4. choice_fallback - Is what ``GoBot`` will say when user entered choices that are not present.\n\n\n## Linking intents with stories\n```\ngoBot := GoBot.NewGoBot(intents, stories)\n\n```\n\n## PlayGround\nThis is a commandline playground of your created GoBot\n```\ngoBot.Playground()\n\n```\n\n## Chatting with GoBot\n```\nkey, response := goBot.Chat(\"hello\") --\u003e Chat(your message)\nfmt.Println(key, response)\n\n```\n\n# Integration with WhatsApp\n```\nIn progress\n```\n\n# Integration with Telegram\nIntegrating with Telegram, to create its chat bot we will use this awosome Open Source Library from [Golang-Tanzania](https://github.com/Golang-Tanzania/Group-Bot).\n\n```\nIn Progress\n\n```\n\n\n## Authors\n\nThis package is authored and maintained by [who can drive boats](https://github.com/community)\n\n## License\n\nMIT License\n\nCopyright (c) 2022 Adam Reuben\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamwreuben%2Fgobot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamwreuben%2Fgobot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamwreuben%2Fgobot/lists"}