{"id":21356804,"url":"https://github.com/tirthajyoti-ghosh/slack-adder-bot","last_synced_at":"2026-04-16T04:33:29.559Z","repository":{"id":55514415,"uuid":"323446786","full_name":"tirthajyoti-ghosh/slack-adder-bot","owner":"tirthajyoti-ghosh","description":"A simple slack chatbot that adds two numbers. Eg: when the user types to the bot `234 + 123`, it responds back with `357`. Built with Ruby.","archived":false,"fork":false,"pushed_at":"2020-12-24T16:51:41.000Z","size":85,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"development","last_synced_at":"2025-03-16T05:42:47.144Z","etag":null,"topics":["mongodb","mongoid","ruby","slack-bot","slack-ruby-bot-server"],"latest_commit_sha":null,"homepage":"https://enigmatic-thicket-31440.herokuapp.com/","language":"Ruby","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/tirthajyoti-ghosh.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}},"created_at":"2020-12-21T21:00:55.000Z","updated_at":"2021-04-16T07:45:12.000Z","dependencies_parsed_at":"2022-08-15T02:10:36.271Z","dependency_job_id":null,"html_url":"https://github.com/tirthajyoti-ghosh/slack-adder-bot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tirthajyoti-ghosh/slack-adder-bot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tirthajyoti-ghosh%2Fslack-adder-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tirthajyoti-ghosh%2Fslack-adder-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tirthajyoti-ghosh%2Fslack-adder-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tirthajyoti-ghosh%2Fslack-adder-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tirthajyoti-ghosh","download_url":"https://codeload.github.com/tirthajyoti-ghosh/slack-adder-bot/tar.gz/refs/heads/development","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tirthajyoti-ghosh%2Fslack-adder-bot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31871668,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"online","status_checked_at":"2026-04-16T02:00:06.042Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["mongodb","mongoid","ruby","slack-bot","slack-ruby-bot-server"],"created_at":"2024-11-22T04:36:24.896Z","updated_at":"2026-04-16T04:33:29.541Z","avatar_url":"https://github.com/tirthajyoti-ghosh.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\n*** Thanks for checking out this README Template. If you have a suggestion that would\n*** make this better, please fork the repo and create a pull request or simply open\n*** an issue with the tag \"enhancement\".\n*** Thanks again! Now go create something AMAZING! :D\n--\u003e\n\n\n\n\n\n\u003c!-- PROJECT SHIELDS --\u003e\n\u003c!--\n*** I'm using markdown \"reference style\" links for readability.\n*** Reference links are enclosed in brackets [ ] instead of parentheses ( ).\n*** See the bottom of this document for the declaration of the reference variables\n*** for contributors-url, forks-url, etc. This is an optional, concise syntax you may use.\n*** https://www.markdownguide.org/basic-syntax/#reference-style-links\n--\u003e\n[![Contributors][contributors-shield]][contributors-url]\n[![Forks][forks-shield]][forks-url]\n[![Stargazers][stars-shield]][stars-url]\n[![Issues][issues-shield]][issues-url]\n[![License: MIT][license-shield]][license-url]\n[![LinkedIn][linkedin-shield]][linkedin-url]\n\n\n\n\u003c!-- PROJECT LOGO --\u003e\n\u003cbr /\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/tirthajyoti-ghosh/slack-adder-bot\"\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/57726348/103025447-d7454d00-4577-11eb-86cd-c887d68b014e.png\" alt=\"Logo\" width=\"80\" height=\"80\"\u003e\n  \u003c/a\u003e\n\n  \u003ch3 align=\"center\"\u003eSlack Adder Bot\u003c/h3\u003e\n\n  \u003cp align=\"center\"\u003e\n    A Slack bot that adds two numbers. Built with Ruby.\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/tirthajyoti-ghosh/slack-adder-bot\"\u003e\u003cstrong\u003eExplore the docs »\u003c/strong\u003e\u003c/a\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://www.loom.com/share/07050cd0480c4109b01ad411b9e92189\"\u003eVideo Demo\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/tirthajyoti-ghosh/slack-adder-bot/issues\"\u003eReport Bug\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/tirthajyoti-ghosh/slack-adder-bot/issues\"\u003eRequest Feature\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\n\u003c!-- TABLE OF CONTENTS --\u003e\n## Table of Contents\n\n* [About the Project](#about-the-project)\n  * [Built With](#built-with)\n* [Getting Started](#getting-started)\n  * [Prerequisites](#prerequisites)\n  * [Installation](#installation)\n  * [Setting Up Slack](#setting-up-slack)\n  * [Setting Up Web Hook](#setting-up-web-hook)\n* [Usage](#usage)\n* [Roadmap](#roadmap)\n* [Contributing](#contributing)\n* [License](#license)\n* [Contact](#contact)\n* [Acknowledgements](#acknowledgements)\n\n\u003c!-- ABOUT THE PROJECT --\u003e\n## About The Project\n\nA simple slack chat bot that adds two numbers. Eg: when the user types to the bot `234 + 123`, it responds back with `357`.\n\n![Screenshot](https://user-images.githubusercontent.com/57726348/103085343-6e0d1a80-4607-11eb-935e-55a5f1049725.png)\n\n### Built With\n\n* slack-ruby-bot-server\n* slack-ruby-bot-server-events\n* mongodb\n* mongoid\n\n## Live demo\n\n**IMPORTANT!** Checkout this video first - \u003chttps://www.loom.com/share/07050cd0480c4109b01ad411b9e92189\u003e\n\nDeployed to Heroku - \u003chttps://enigmatic-thicket-31440.herokuapp.com/\u003e\n\n\u003c!-- GETTING STARTED --\u003e\n## Getting Started\n\nTo get a local copy up and running follow these simple steps.\n\n### Prerequisites\n\n* MongoDB\n* Ruby\n* Admin access to a Slack Workspace.\n\n### Setting Up Slack\n\n1. Create a new Slack app from [here](https://api.slack.com/apps?new_app=1)\n\n2. Scroll down and you will find the **App Credentials** section. Take note of these four fields:\n\n    * Client ID\n    * Client Secret\n    * Signing Secret\n    * Verification Token\n\n    ![image](https://user-images.githubusercontent.com/57726348/102981481-05eb0580-452f-11eb-8f2f-97aa185f1f2b.jpg)\n\n    You will need these later.\n\n3. Go to **OAuth \u0026 Permissions**. You will find this option in the side bar.\n\n   ![image](https://user-images.githubusercontent.com/57726348/102981953-c375f880-452f-11eb-810b-b0dbd6ad0ca3.png)\n\n4. Scroll down to **Scopes** and add these 👇 scopes *one-by-one* to **Bot Token Scopes**:\n\n    * `users:read`\n    * `channels:read`\n    * `groups:read`\n    * `chat:write`\n    * `commands`\n    * `im:history`\n    * `incoming-webhook`\n\n    ![image)](https://user-images.githubusercontent.com/57726348/102985652-83b20f80-4535-11eb-95a6-0fc71d7d9b1b.png)\n\n5. Go to **Event Subscriptions**. You will find this option in the side bar. Then enable events.\n\n   ![image](https://user-images.githubusercontent.com/57726348/102985992-15ba1800-4536-11eb-8ef2-f04d2459b579.png)\n\n6. Click on **Subscribe to bot events**. Then click on the **Add Bot User Event** button. Then add `message.im` event.\n\n   ![image](https://user-images.githubusercontent.com/57726348/102986763-549c9d80-4537-11eb-804f-c5dd8195b400.png)\n\n   Everytime you send a direct message to the bot, the `message.im` event will be fired.\n\n7. Now you have to install this app to your workspace. Go to **Basic Information**. You will find this option in the side bar. Then click the **Install to Workspace** button.\n\n   ![image](https://user-images.githubusercontent.com/57726348/102987659-b4477880-4538-11eb-81b6-12a45bfd2284.png)\n\n8. In the next page, you will be asked to **Allow** the bot permissions. In the last permission (**Where should Example Bot post?**), select any channel.\n\n   ![image](https://user-images.githubusercontent.com/57726348/102988627-2f5d5e80-453a-11eb-904e-c29561dce9da.png)\n\n### Installation\n\n1. Clone this repository.\n\n   ```bash\n   git clone https://github.com/tirthajyoti-ghosh/slack-adder-bot.git\n   ```\n\n2. Create an `.env` file in the root directory. Then fill these 👇 with their respective values (client id, client secret, etc. from slack app). The values must be put after the `=` sign.\n\n   ```text\n   SLACK_CLIENT_ID=\n   SLACK_CLIENT_SECRET=\n   SLACK_SIGNING_SECRET=\n   SLACK_VERIFICATION_TOKEN=\n   ```\n\n3. Run `bundle install` and `foreman start` to boot the app.\n\n   ```bash\n   $ foreman start\n   07:44:47 web.1  | started with pid 59258\n   07:44:50 web.1  | * Listening on tcp://0.0.0.0:5000\n   ```\n\n### Setting Up Web Hook\n\n1. Since Slack won't send a POST request to `localhost`, we need to expose our local server through a public tunneling service. You can use [ngrok](https://ngrok.com/).\n\n   ```bash\n   $ ngrok http 5000\n   Forwarding https://ddfd97f80615.ngrok.io -\u003e http://localhost:5000\n   ```\n\n2. Go to **Event Subscriptions** in your Slack apps dashboard. You will find this option in the side bar. Then paste this URL in the **Request URL** field:\n\n   ```text\n   \u003cyour ngrok URL\u003e/api/slack/event\n\n   Eg.,\n\n   https://ddfd97f80615.ngrok.io/api/slack/event\n   ```\n\n   ![image](https://user-images.githubusercontent.com/57726348/103019463-e5da3700-456c-11eb-86c7-1163dfcebfad.png)\n\n3. Click on **Save Changes** if necessary.\n\n\u003c!-- USAGE EXAMPLES --\u003e\n## Usage\n\nStart a direct chat with the bot. The input must be in this format =\u003e `6+3`. If the input does not have two numbers and an addition symbol in between, respond back with a error message - \"Sorry, I didn't understand that. I only add numbers in this format. eg: 5+6 or 6+3\".\n\n![usage](https://user-images.githubusercontent.com/57726348/103031653-42951c00-4584-11eb-82c1-632c48962904.gif)\n\n\u003c!-- ROADMAP --\u003e\n## Roadmap\n\n* Add tests.\n\n\u003c!-- CONTRIBUTING --\u003e\n## Contributing\n\nContributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n\u003c!-- LICENSE --\u003e\n## License\n\nDistributed under the MIT License. See `LICENSE` for more information.\n\n\u003c!-- CONTACT --\u003e\n## Contact\n\n👤 **Tirthajyoti Ghosh**\n\n* Website: [ghosh.tech](https://ghosh.tech/)\n* GitHub - [@tirthajyoti-ghosh](https://github.com/tirthajyoti-ghosh)\n* Twitter - [@terrific_ghosh](https://twitter.com/terrific_ghosh)\n* LinkedIn - [@tirthajyoti-ghosh](https://www.linkedin.com/in/tirthajyoti-ghosh/)\n\nProject Link: [https://github.com/tirthajyoti-ghosh/slack-adder-bot](https://github.com/tirthajyoti-ghosh/slack-adder-bot)\n\n\u003c!-- ACKNOWLEDGEMENTS --\u003e\n## Acknowledgements\n\n* [slack-ruby-bot-server](https://github.com/slack-ruby/slack-ruby-bot-server)\n* [slack-ruby-bot-server-events](https://github.com/slack-ruby/slack-ruby-bot-server-events)\n* [slack-ruby-bot-server-events-sample](https://github.com/slack-ruby/slack-ruby-bot-server-events-sample)\n* README icon from Icons8\n\n\u003c!-- MARKDOWN LINKS \u0026 IMAGES --\u003e\n\u003c!-- https://www.markdownguide.org/basic-syntax/#reference-style-links --\u003e\n[contributors-shield]: https://img.shields.io/github/contributors/tirthajyoti-ghosh/slack-adder-bot.svg?style=flat-square\n[contributors-url]: https://github.com/tirthajyoti-ghosh/slack-adder-bot/graphs/contributors\n[forks-shield]: https://img.shields.io/github/forks/tirthajyoti-ghosh/slack-adder-bot.svg?style=flat-square\n[forks-url]: https://github.com/tirthajyoti-ghosh/slack-adder-bot/network/members\n[stars-shield]: https://img.shields.io/github/stars/tirthajyoti-ghosh/slack-adder-bot.svg?style=flat-square\n[stars-url]: https://github.com/tirthajyoti-ghosh/slack-adder-bot/stargazers\n[issues-shield]: https://img.shields.io/github/issues/tirthajyoti-ghosh/slack-adder-bot.svg?style=flat-square\n[issues-url]: https://github.com/tirthajyoti-ghosh/slack-adder-bot/issues\n[license-shield]: https://img.shields.io/badge/License-MIT-yellow.svg\n[license-url]: https://github.com/tirthajyoti-ghosh/slack-adder-bot/blob/development/LICENSE\n[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=flat-square\u0026logo=linkedin\u0026colorB=555\n[linkedin-url]: https://www.linkedin.com/in/tirthajyoti-ghosh/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftirthajyoti-ghosh%2Fslack-adder-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftirthajyoti-ghosh%2Fslack-adder-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftirthajyoti-ghosh%2Fslack-adder-bot/lists"}