{"id":15689816,"url":"https://github.com/hbollon/gobot","last_synced_at":"2025-05-07T23:08:52.000Z","repository":{"id":57544447,"uuid":"284077074","full_name":"hbollon/gobot","owner":"hbollon","description":"🤖 Messenger chatbot using the Levenshtein distance algorithm for pattern matching. Easily configurable with yaml files. Use mux and yaml.v2.","archived":false,"fork":false,"pushed_at":"2020-08-29T15:16:47.000Z","size":46,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-07T23:08:45.984Z","etag":null,"topics":["algorithm","bot","chatbot","facebook","facebook-api","facebook-messenger","go","golang","levenshtein","levenshtein-distance","messenger","messenger-api","messenger-bot","messenger-chatbot","mux","pattern-matching","yaml"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hbollon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-31T16:08:46.000Z","updated_at":"2021-09-07T15:48:03.000Z","dependencies_parsed_at":"2022-08-27T05:13:16.054Z","dependency_job_id":null,"html_url":"https://github.com/hbollon/gobot","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hbollon%2Fgobot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hbollon%2Fgobot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hbollon%2Fgobot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hbollon%2Fgobot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hbollon","download_url":"https://codeload.github.com/hbollon/gobot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252968118,"owners_count":21833252,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["algorithm","bot","chatbot","facebook","facebook-api","facebook-messenger","go","golang","levenshtein","levenshtein-distance","messenger","messenger-api","messenger-bot","messenger-chatbot","mux","pattern-matching","yaml"],"created_at":"2024-10-03T18:04:37.804Z","updated_at":"2025-05-07T23:08:51.981Z","avatar_url":"https://github.com/hbollon.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eGobot : Messenger ChatBot Golang\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://goreportcard.com/report/github.com/hbollon/gobot\" target=\"_blank\"\u003e\n    \u003cimg alt=\"Go Report Card\" src=\"https://goreportcard.com/badge/github.com/hbollon/gobot\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/hbollon/gobot/blob/master/LICENSE\" target=\"_blank\"\u003e\n    \u003cimg alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003e Facebook Messenger chatbot using the Levenshtein distance algorithm for pattern matching. Use mux and yaml.v2.\n\n---\n\n## Table of Contents\n\n- [Requirements](#requirements)\n- [Presentation](#presentation)\n- [Features](#features)\n- [Installation](#installation)\n- [Customize chatbot responses](#customize-chatbot-responses)\n- [Author](#author)\n- [Contributing](#-contributing)\n- [License](#-license)\n\n\n---\n\n## Requirements\n- [Go](https://golang.org/doc/install)\n- Facebook account\n\n## Presentation\nThis chatbot was developed in order to manage efficiently any facebook page. It use Facebook API.\nGobot use Levenshtein distance algorithm for pattern matching to calculate a match percentage between the received message and templates defined in content.yml in order to be more flexible for the interlocutor instead of only responding to messages that match exactly.\nFor example, if you have set a minimal matching percentage of 40 % and defined patterns like this in content.yml :\n\n```yaml\ntemplates: \n- messages: [\"Hello\", \"Hi\"]\nresponse: \"Hi !\\nI'm GoBot chat bot ! :)\"\n- messages: [\"Who's your creator ?\"]\nresponse: \"I was build by @hbollon from Bits Please Inc. :)\\nMy source code is available on his Github : github.com/hbollon !\"\n\ndefault_response: \"Sorry, I don't understand your message... :/\\nPlease try again with different sentence or using more words.\"\n```\n\nAnd someone sends you \"Who's build you ?\"\nIt will match with \"Who's your creator ?\" and send back corresponding response !\nSame with \"Creator\" :)\n\nHowever, if it doesn't match with any template, it will send the **default_response**.\nYou can edit the minimal matching percentage in the config.yml file.\n\n## Features\n- Designed for Facebook Messenger ✨\n- Easily configurable through yaml files ✨\n- Efficient pattern matching with Levenshtein distance ✨\n- Customizable minimal matching percentage ✨\n\n## Installation\n### Clone\n- Firstly, clone this repo wherever you want using :\n```git \ngit clone https://github.com/hbollon/gobot\n```\n\n### Setup\n- Create an app on Facebook developer : https://developers.facebook.com/apps/\n\n- Add it Messenger product and configure your webhook by linking a Facebook page :\n\u003cimg align=\"center\" src=\"https://i.ibb.co/VWzZNZh/page.png\" alt=\"page\" border=\"0\" /\u003e\n\n- Configure your webhook Callback URL (You can use [Ngrok](https://ngrok.com/) to make public URL to your localhost for testing purpose), the Verify Token and subscribe to messages field:\n\u003cimg align=\"center\" src=\"https://i.ibb.co/NLHNFTB/webhook.png\" alt=\"webhook\" border=\"0\" /\u003e\n\n- Edit configs/config.yml file with your Messenger App credentials : \n```yaml\n# Facebook API config\napp_secret: \u003capp_secret\u003e # Secret key which can be found in the app settings on Facebook Developer dashboard\naccess_token: \u003cfacebook_app_token\u003e # Generated token on app Messenger product\nverify_token: \u003cwebhook_verify_key\u003e # Verify token of your webhook URL \n```\nYou can copy config.yml.exemple to config.yml and replace corresponding values.\n\n- Open bash in root project directory and run :\n```bash\ngo run cmd/gobot/*.go # Run program without build it\n# or\ngo build cmd/gobot/*.go \u0026\u0026 ./gobot # Build and run\n\n```\n\n## Customize chatbot responses\nIn order to modify the messages that your chatbot will recognize as well as the responses that it will send back, you just need to modify the content.yml file in the config folder.\n\nExemple:\n```yaml\ntemplates: \n    - messages: [\"Hello\", \"Hi\"]\n      response: \"Hi !\\nI'm GoBot chat bot ! :)\"\n    - messages: [\"Who's your creator ?\"]\n      response: \"I was build by @hbollon from Bits Please Inc. :)\\nMy source code is available on his Github : github.com/hbollon !\"\n\ndefault_response: \"Sorry, I don't understand your message... :/\\nPlease try again with different sentence or using more words.\"\n```\n\nA template is composed of **messages** which are the sentences on which the bot is based to try to understand the interlocutor via the Levenshtein algorithm. If the received message matches one of these messages (depending on the match threshold defined in config.yml) then the response contained in the **response** attribute will be sent to the user.\nIf received message don't match with any template, the bot will send back the **default_response**.\n\n## Author\n\n👤 **Hugo Bollon**\n\n* Github: [@hbollon](https://github.com/hbollon)\n* LinkedIn: [@Hugo Bollon](https://www.linkedin.com/in/hugo-bollon-68a2381a4/)\n\n## 🤝 Contributing\n\nContributions, issues and feature requests are welcome!\u003cbr /\u003eFeel free to check [issues page](https://github.com/hbollon/gobot/issues). \n\n## Show your support\n\nGive a ⭐️ if this project helped you!\n\n## 📝 License\n\nCopyright © 2020 [Hugo Bollon](https://github.com/hbollon).\u003cbr /\u003e\nThis project is [MIT License](https://github.com/hbollon/gobot/blob/master/LICENSE.md) licensed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhbollon%2Fgobot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhbollon%2Fgobot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhbollon%2Fgobot/lists"}