{"id":24618244,"url":"https://github.com/matthewbub/reddit-slackbot","last_synced_at":"2026-05-08T10:33:00.831Z","repository":{"id":49102011,"uuid":"380063706","full_name":"matthewbub/reddit-slackbot","owner":"matthewbub","description":"Reddit integrated into Slack as a message bot","archived":false,"fork":false,"pushed_at":"2022-11-18T01:38:27.000Z","size":3139,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-02T08:17:19.419Z","etag":null,"topics":["slack","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/matthewbub.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":"2021-06-24T22:22:26.000Z","updated_at":"2022-11-18T01:38:30.000Z","dependencies_parsed_at":"2023-01-22T05:47:06.908Z","dependency_job_id":null,"html_url":"https://github.com/matthewbub/reddit-slackbot","commit_stats":null,"previous_names":["matthewbub/reddit-slackbot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/matthewbub/reddit-slackbot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewbub%2Freddit-slackbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewbub%2Freddit-slackbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewbub%2Freddit-slackbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewbub%2Freddit-slackbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matthewbub","download_url":"https://codeload.github.com/matthewbub/reddit-slackbot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewbub%2Freddit-slackbot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264175377,"owners_count":23568451,"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":["slack","typescript"],"created_at":"2025-01-24T23:51:22.739Z","updated_at":"2026-05-08T10:32:55.801Z","avatar_url":"https://github.com/matthewbub.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Reddit Slack bot\n\n![MIT License](https://img.shields.io/badge/License-MIT-green.svg)\n\nBrowse through the most popular safe-for-work subreddits directly from \u003cs\u003eany\u003c/s\u003e the \u003ca href=\"https://join.slack.com/t/ghstsolutions/shared_invite/zt-s0jyi58m-SU2Gr9XMKUTnJbUcEiAXoQ\"\u003eGhst Solutions Slack Workspace\u003c/a\u003e. This application is licensed under MIT. All 3rd party data is sourced directly from Reddit. \n\n\u003e This application was built to experiment with Slacks Bolt library. It is simply a fun proof of concept. \n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./public/demo.gif\" /\u003e\n\u003c/p\u003e\n\nPreview live @ \u003ca href=\"https://join.slack.com/t/ghstsolutions/shared_invite/zt-s0jyi58m-SU2Gr9XMKUTnJbUcEiAXoQ\"\u003eGhst Solutions Slack Workspace\u003c/a\u003e\n\n## Slash Commands\nCommand Name | Optional parameters | Description \n---          |  ---                | ---\n/reddit      | r/any-subreddit     | The quickest way to browse is via the `/reddit` command. If no parameters are passed, the bot will display the reddit home page. If a valid parameter is passed, the bot will attempt to fetch or throw `\"Whoops. Something went wrong\"`.\n\n## Local Setup\n\nThis app runs locally on [ngrok](https://ngrok.com/download). Let's summarize what we will need to do to get started.\n\n- [Set environmental variables](#set-environmental-variables)\n- [Start ngrok server](#start-ngrok-server)\n- [Start express app](#start-express-app)\n- [Frequent reasons this process might fail](#frequent-reasons-this-process-might-fail)\n\n### Set environmental variables\n\nCreate the `.env.local` file. We can start by renaming the `.env.example` to match the dotenv declaration. \n\n```sh\n# rename .env.example to .env.local\nmv .env.example .env.local\n```\n\n### Start ngrok server\n\n```sh\n~/ngrok http 3009\n```\n\nOnce the ngrok server is online we will need to update the URLs we plan on using via https://api.slack.com/apps. _We are going to refer to `https://e6829b5713d5.ngrok.io` as the base URL for this example. Keep in mind you will be assigned a unique temporary ngrok URL when running the above command_\n\n\n- [ ] **Features \u003e Slash Commands**\n  - `/reddit` | https://e6829b5713d5.ngrok.io/slack/events\n- [ ] **Features \u003e Event Subscriptions \u003e Request URL** \n  - https://e6829b5713d5.ngrok.io/slack/events\n- [ ] **Features \u003e Interactivity \u0026 Shortcuts \u003e Request URL** \n  - https://e6829b5713d5.ngrok.io/slack/events\n\nLet's also take a moment to verify the credentials used here also match the local database url used in the .env.example file. Once we've built the local database, we are ready to start the Bolt app.\n\n### Start the Bolt app \n\n**What is Bolt?** For our understanding and general context, Bolt is a wrapper that sits on top of an Express server, used to Slack applications.\n\nNow we are ready to set up our source code. Assuming we have **set our environmental variables** this should be a quick and painless process. \n\n```sh\n# install project dependencies\nnpm install\n\n# we ignore /dist by default\n# let's build that\nnpm run build \n\n# start the Bolt app\nnpm run start\n```\n\nAt this point we should be presented with the standard `app listening on http://localhost:3009` message in the terminal. This is a great point to begin testing your Slack connections.\n\n\u003cdetails\u003e\n    \u003csummary\u003eFrequent reasons this process might fail\u003c/summary\u003e\n\n  \n  \n  \n\n\n### Frequent reasons this process might fail\n\n- **Your environmental variables aren't being read by dotenv.**  \n\nCheck out the [./lib/index.ts](./lib/index.ts) file and verify that your `.env.local` file matches the absolute path specified in the `dotenv.config()` method.\n\n```ts\nconst path = require('path');\n// ...\n// Configures local environment\nrequire('dotenv').config({path: path.resolve(__dirname, \"../.env.local\")});\n\n// DEBUGGING\nconsole.log(path.resolve(__dirname, \"../.env.local\"));\n```\n\n- **Slack App does not have required permissions**\n- **Ngrok server shut down and needs to be restarted** \nBy default the ngrok URL is active for 2 hours at which point it will automatically timeout. When we reset the ngrok server we will need to update the base URL as defined in the [Start ngrok server](#start-ngrok-server) section. \n\nThis can be easily identify as the root issue to most unexpected errors. Be sure to keep an eye on your ngrok server throughout development.\n\n- **[Slash Commands] Reddit Bot needs to be invited to the channel** \nFound this to be the case when migrating to @slack/bolt. [This thread on Stack Overflow](https://stackoverflow.com/questions/60198159/slack-api-conversations-history-returns-error-not-in-channel) helped provide a solution. \n  \n\u003c/details\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthewbub%2Freddit-slackbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatthewbub%2Freddit-slackbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthewbub%2Freddit-slackbot/lists"}