{"id":39706830,"url":"https://github.com/barrelmaker97/friendbot","last_synced_at":"2026-01-18T10:34:15.337Z","repository":{"id":35087570,"uuid":"202453147","full_name":"barrelmaker97/friendbot","owner":"barrelmaker97","description":"Markov-chain based chatbot which uses Slack messages as its corpus","archived":false,"fork":false,"pushed_at":"2025-12-16T13:02:53.000Z","size":662,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-20T03:18:22.032Z","etag":null,"topics":["chatbot","docker","markov-chain","python","redis","slack","wsgi"],"latest_commit_sha":null,"homepage":"","language":"Python","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/barrelmaker97.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-08-15T01:38:13.000Z","updated_at":"2025-12-16T13:02:50.000Z","dependencies_parsed_at":"2023-02-13T21:46:06.653Z","dependency_job_id":"acb4629e-4818-4813-b47a-0b1b798e64f0","html_url":"https://github.com/barrelmaker97/friendbot","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/barrelmaker97/friendbot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barrelmaker97%2Ffriendbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barrelmaker97%2Ffriendbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barrelmaker97%2Ffriendbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barrelmaker97%2Ffriendbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/barrelmaker97","download_url":"https://codeload.github.com/barrelmaker97/friendbot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barrelmaker97%2Ffriendbot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28534487,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T10:13:46.436Z","status":"ssl_error","status_checked_at":"2026-01-18T10:13:11.045Z","response_time":98,"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":["chatbot","docker","markov-chain","python","redis","slack","wsgi"],"created_at":"2026-01-18T10:34:14.897Z","updated_at":"2026-01-18T10:34:15.319Z","avatar_url":"https://github.com/barrelmaker97.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![codecov](https://codecov.io/gh/barrelmaker97/friendbot/branch/master/graph/badge.svg?token=l6jB2bxHzn)](https://codecov.io/gh/barrelmaker97/friendbot)\n[![CodeFactor](https://www.codefactor.io/repository/github/barrelmaker97/friendbot/badge/master)](https://www.codefactor.io/repository/github/barrelmaker97/friendbot/overview/master)\n\n# friendbot\nFriendbot is a Markov-chain based chatbot which uses Slack messages as its corpus. It reads in messages from a Slack data export, generates a corpus from them, and feeds this to a markov chain generator to naively simulate a conversation. It is built with [Flask](https://palletsprojects.com/p/flask/), served by [Gunicorn](https://gunicorn.org/), cached by [Redis](https://redis.io/), and run in Docker. The sentences which it generates can be accessed via an API which is designed to connect to the existing Slack API.\n\n## Installation\nDownload the `docker-compose.yaml` file (or clone this repo), and start by letting Friendbot know the location of your Slack export zip file by running\n```\nFB_EXPORT=\u003cpath to your Slack export\u003e docker-compose up -d\n```\n\n## Configuration\nAll config is done via environment variables, listed below:\n| Parameter                 | Description                                                                   | Default                      |\n|---------------------------|-------------------------------------------------------------------------------|------------------------------|\n| `FRIENDBOT_LOG_LEVEL`     | Friendbot's log level                                                         | `info`                       |\n| `FRIENDBOT_EXPORT_ZIP`    | Path (inside Friendbot) to zip file containing the Slack Export               | `/home/friendbot/export.zip` |\n| `FRIENDBOT_REDIS_HOST`    | Hostname of Redis instance used for cache                                     | `redis`                      |\n| `FRIENDBOT_REDIS_PORT`    | Port number of Redis instance used for cache                                  | `6379`                       |\n| `FRIENDBOT_SECRET_FILE`   | File containing a Signing Secret recieved from Slack, used to verify requests | `nil`                        |\n\n## API\n### /sentence\nThis endpoint accepts HTTP `POST` requests sentence generated using the export data. It reads the `text` key of the `POST`ed form and splits the value into arguments in the form of Slack channels `\u003c#CHANNEL\u003e` or users `\u003c@USER\u003e`. These are used to narrow the selection of messages Friendbot will read to generate its corpus. These arguments can be in any order and can also be left blank to include all channels/users. In most cases, responses from this endpoint will return a 200 status code, regardless of whether an error has occurred. This is because [Slack does not follow the HTTP spec](https://api.slack.com/slash-commands#responding_with_errors) and uses 200 to indicate that a request has been received even if an error occurs.\n\n### /action\nThis endpoint accepts HTTP `POST` requests in the form of `application/x-www-form-urlencoded`, extracts a JSON payload, sends a `POST` request to the Slack API based on the interaction that initiated the request, and returns a 200 status code. This provides the interactive component of Friendbot messages. These interactions consist of sending a generated sentence to the channel, shuffling to generate a new sentence, and cancelling sentence generation.\n\n### /metrics\nThis endpoint accepts HTTP `GET` requests and returns metrics about Friendbot in a format that can be consumed by Prometheus.\n\n### /health\nThis endpoint accepts HTTP `GET` requests and returns 200 as long as the application is healthy. Used for Docker healthchecking.\n\n## Requirements\n* Docker\n* Docker Compose\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarrelmaker97%2Ffriendbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbarrelmaker97%2Ffriendbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarrelmaker97%2Ffriendbot/lists"}