{"id":25732777,"url":"https://github.com/kylelobo/Reddit-Bot","last_synced_at":"2025-02-26T04:01:48.021Z","repository":{"id":107360576,"uuid":"156134558","full_name":"race2infinity/Reddit-Bot","owner":"race2infinity","description":"🤖 Making a Reddit Bot using Python, Heroku and Heroku Postgres.","archived":false,"fork":false,"pushed_at":"2023-01-25T17:06:29.000Z","size":153,"stargazers_count":120,"open_issues_count":0,"forks_count":14,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-02-19T22:02:10.431Z","etag":null,"topics":["dictionary-bot","heroku","heroku-apps","heroku-buildpack","heroku-cli","heroku-connect","heroku-deployment","heroku-postgres","herokuapp","json","praw","praw-api","praw-reddit","pushshift","python","reddit","reddit-api","reddit-bot","redditbot"],"latest_commit_sha":null,"homepage":"https://www.reddit.com/user/Wordbook_Bot","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/race2infinity.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","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":"2018-11-04T23:17:19.000Z","updated_at":"2025-01-21T03:50:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"fcbddeaa-ca3e-4aa5-b540-68978b1e0e07","html_url":"https://github.com/race2infinity/Reddit-Bot","commit_stats":null,"previous_names":["race2infinity/reddit-bot","kylelobo/reddit-bot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/race2infinity%2FReddit-Bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/race2infinity%2FReddit-Bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/race2infinity%2FReddit-Bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/race2infinity%2FReddit-Bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/race2infinity","download_url":"https://codeload.github.com/race2infinity/Reddit-Bot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240788751,"owners_count":19857696,"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":["dictionary-bot","heroku","heroku-apps","heroku-buildpack","heroku-cli","heroku-connect","heroku-deployment","heroku-postgres","herokuapp","json","praw","praw-api","praw-reddit","pushshift","python","reddit","reddit-api","reddit-bot","redditbot"],"created_at":"2025-02-26T04:01:07.532Z","updated_at":"2025-02-26T04:01:47.982Z","avatar_url":"https://github.com/race2infinity.png","language":"Python","funding_links":[],"categories":["Bot Creation Services"],"sub_categories":["External Reddit Tools"],"readme":"# 🤖 Making a Reddit Bot using Python and Heroku\n\nThis repo teaches you how to:\n\n+ Make a Reddit Bot using the [PRAW](https://praw.readthedocs.io/en/latest/) (The Python Reddit API Wrapper) Python package\n+ Deploy your Reddit Bot on [Heroku](https://www.heroku.com/) - A platform as a service (PaaS) that enables developers to build, run, and operate applications entirely in the cloud\n+ Install \u0026 use [Heroku Postgres](https://devcenter.heroku.com/articles/heroku-postgresql)\n\n[![Tweet](https://img.shields.io/twitter/url/https/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Making%20a%20Reddit%20Bot%20using%20Python%20and%20Heroku\u0026url=https://github.com/kylelobo/Reddit-Bott)\n\nIn this repo, I have made a Wordbook Bot which gives the meaning of particular word / phrase in the English / Slang language.\n\n---\n\n## 📝 Index\n+ [Why was Wordbook Bot made?](#why_was_wordbook_bot_made)\n+ [Installation](#installation)\n+ [Deploying the Bot on Heroku (Platform that allows you to host your Bot)](#deploying_the_bot_on_heroku)\n  + [Installing Git](#installing_git)\n  + [Installing Heroku CLI](#installing_heroku_cli)\n  + [Getting Started](#getting_started)\n  + [Initializing a local git repository](#initializing_a_local_git_repository)\n  + [Creating a Remote Heroku](#creating_a_remote_heroku)\n  + [Changing your App name on Heroku](#changing_your_app_name_on_heroku)\n  + [Deploying code](#deploying_code)\n  + [After setting up repo on Heroku](#after_setting_up_repo_on_heroku)\n  + [Running the Bot](#running_the_bot)\n  + [Viewing output](#viewing_output)\n+ [Installing Heroku PostgreSQL](#installing_postgres)\n  + [Installing locally](#installing_postgres_locally)\n  + [Using the CLI](#using_the_cli)\n  + [Connecting in Python](#connecting_in_python)\n+ [How to use the Bot](#how_to_use_the_application)\n+ [How does the Bot work?](#how_does_the_bot_work)\n+ [Why didn't the Bot notice me?](#why_didnt_the_bot_notice_me)\n+ [Contributing](/.github/CONTRIBUTING.md)\n+ [Acknowledgements](#acknowledgements)\n\n## 🎈 Why was Wordbook Bot made? \u003ca name=\"why_was_wordbook_bot_made\"\u003e\u003c/a\u003e\nWordbook Bot was made to help Redditors:\n+ Quickly look up the meaning of an English / Slang word you see\n+ Find the right meaning of an English / Slang word\n+ Find examples of the use of a word in natural language\n\n## ⚙️ Installation \u003ca name=\"installation\"\u003e\u003c/a\u003e\n### Running Locally \u003ca name=\"running_locally\"\u003e\u003c/a\u003e\n#### Clone or Download the repository\n```\n$ git clone https://github.com/kylelobo/Reddit-Bot.git\n$ cd Reddit-Bot/Wordbook_Bot\n```\n\n#### Install Dependencies\n```\n$ sudo apt-get install python3.6\n$ sudo apt-get install pip3\n$ pip3 install praw --user\n$ pip3 install requests --user\n```\n\n#### Setting up Environment Variables\nAn app’s environment-specific configuration should be stored in environment variables (not in the app’s source code). This lets you modify each environment’s configuration in isolation, and prevents secure credentials from being stored in version control.\n\n💡 **Note:** Do not enter spaces before and after the \"=\" sign. Enter your values without the quotes (\" \").\n\nTo set variable only for current shell:\n```\nVARNAME=\"your value\"\n```\n\nTo set it for current shell and all processes started from current shell:\n```\nexport VARNAME=\"your value\"      # shorter, less portable version\n```\n\nTo set it permanently for all future bash sessions add such line to your ```.bashrc``` file in your ```$HOME``` directory.\n\nTo set it permanently, and system wide (all users, all processes) add ```set``` variable in ```/etc/environment```:\n```\nsudo -H gedit /etc/environment\n```\n\nThis file only accepts variable assignments like:\n```\nVARNAME=\"your value\"\n```\n\n**💡 Note:** Do not use the export keyword here.\n\nHere is the list of environment variables you need to set:\n```\n# Your Reddit ID \u0026 Pass\nreddit_username=\"your_reddit_username\"\nreddit_password=\"your_reddit_password\"\n\n# Reddit API ID \u0026 Key (which you can get from here: https://www.reddit.com/prefs/apps/)\nclient_id=\"your_client_id\"\nclient_secret=\"your_client_secret\"\n\n# Oxford Dictionary application ID \u0026 Key (which you can get from here: https://developer.oxforddictionaries.com/)\napp_id=\"your_app_id\"\napp_key=\"your_app_key\"\n```\n\n**💡 Note:** You need to logout from current user and login again so environment variables changes take place\n\nYou can check if your environment variables have been set by typing ```echo $var_name``` in terminal:\n```\n$ echo $reddit_username\nWordbook_Bot\n```\n\n#### Start the Bot\n```\n$ python3 wordbook_bot.py\n```\n\nYour bot should now be running.\n\n## 🚀 Deploying the Bot on Heroku (Platform that allows you to host your bot) \u003ca name=\"deploying_the_bot_on_heroku\"\u003e\u003c/a\u003e\n1. Firstly, make an account on [Heroku](https://www.heroku.com/).\n2. Make another directory and put all your python code in that, and make an empty file called ```__init__.py``` in it. 3. In your main directory, create two files: ```requirements.txt``` and ```runtime.txt```.\n4. The ```requirements.txt``` file should contain output of the command ```pip freeze \u003e requirements.txt```. If you're not using ```virtualenv```, you'll have delete all the lines with packages your code doesn't use.\n5. ```Runtime.txt``` just specifies which python version for Heroku to use. Mine just has the line \"python-3.6.7\" in it.\n\nNow it's time to set up your git repo to use it as a remote.\n\n### Installing Git \u003ca name=\"installing_git\"\u003e\u003c/a\u003e\n```\n$ sudo apt-get install git-all\n```\n\n### Installing Heroku CLI \u003ca name=\"installing_heroku_cli\"\u003e\u003c/a\u003e\n```\n$ sudo snap install --classic heroku\n```\n\n### Verifying your installation\n```\n$ heroku --version\nheroku/7.18.3 linux-x64 node-v10.12.0\n```\n\n### Getting Started \u003ca name=\"getting_started\"\u003e\u003c/a\u003e\n```\n$ heroku login\nEnter your Heroku credentials.\nEmail: kyle@example.com\nPassword (typing will be hidden):\nAuthentication successful.\n```\n\n### Initializing a local git repository \u003ca name=\"initializing_a_local_git_repository\"\u003e\u003c/a\u003e\n```\n# Change your directory to your base directory\n$ cd myapp\n$ git init\nInitialized empty Git repository in .git/\n$ git add .\n$ git commit -m \"My first commit\"\nCreated initial commit 5df2d09: My first commit\n44 files changed, 8393 insertions(+), 0 deletions(-)\ncreate mode 100644 README\ncreate mode 100644 Procfile\ncreate mode 100644 app/controllers/source_file\n  ...\n```\n\nYour app’s code is now tracked in a local Git repository. It has not yet been pushed to any remote servers.\n\n### Creating a Remote Heroku \u003ca name=\"creating_a_remote_heroku\"\u003e\u003c/a\u003e\n#### For a new Heroku App\nThe ```heroku create``` CLI command creates a new empty application on Heroku, along with an associated empty Git repository. If you run this command from your app’s root directory, the empty Heroku Git repository is automatically set as a remote for your local repository.\n```\n$ heroku create\nCreating app... done, ⬢ thawing-inlet-61413\nhttps://thawing-inlet-61413.herokuapp.com/ | https://git.heroku.com/thawing-inlet-61413.git\n```\n\nYou can use the ```git remote``` command to confirm that a remote named ```heroku``` has been set for your app:\n```\n$ git remote -v\nheroku  https://git.heroku.com/thawing-inlet-61413.git (fetch)\nheroku  https://git.heroku.com/thawing-inlet-61413.git (push)\n```\n\n#### For an existing Heroku App\nIf you have already created your Heroku app, you can easily add a remote to your local repository with the ```heroku git:remote``` command. All you need is your Heroku app’s name:\n```\n$ heroku git:remote -a thawing-inlet-61413\nset git remote heroku to https://git.heroku.com/thawing-inlet-61413.git\n```\n\n### Changing your App name on Heroku \u003ca name=\"changing_your_app_name_on_heroku\"\u003e\u003c/a\u003e\nYou can rename an app at any time with the ```heroku apps:rename command```. For example, to rename an app named “oldname” to “newname”, run the ```heroku apps:rename``` command from your app’s Git repository:\n```\n$ heroku apps:rename newname\nRenaming oldname to newname... done\nhttp://newname.herokuapp.com/ | git@herokuapp.com:newname.git\nGit remote heroku updated\n```\n\nYou can also rename an app from outside of its associated Git repository by including the ```--app``` option in the command:\n```\n$ heroku apps:rename newname --app oldname\nhttp://newname.herokuapp.com/ | git@herokuapp.com:newname.git\n```\n\n**💡 Note:** When you rename an app, it immediately becomes available at the new corresponding ```herokuapp.com``` subdomain (```newname.herokuapp.com```) and unavailable at the old one (```oldname.herokuapp.com```).\n\nIf you use the Heroku CLI to rename an app from inside it's associated Git repository, your local Heroku remote is updated automatically. However, other instances of the repository must update the remote’s details manually.\n\nYou can run the following commands to update the remote’s details in other repository instances:\n```\n$ git remote rm heroku\n$ heroku git:remote -a newname\n```\n\nReplace ```newname``` with the new name of the app, as specified in the ```rename``` command.\n\n### Deploying code \u003ca name=\"deploying_code\"\u003e\u003c/a\u003e\nTo deploy your app to Heroku, you typically use the ```git push``` command to push the code from your local repository’s ```master``` branch to your ```heroku``` remote, like so:\n```\n$ git push heroku master\nInitializing repository, done.\nupdating 'refs/heads/master'\n  ...\n```\n\nCode diffs, manual and auto deploys via GitHub are also possible. To use GitHub as a deployment method:\n```\nHeroku Dashboard \u003e Select your App \u003e Deploy \u003e Deployment Method \u003e Connect to GitHub \u003e App connected to GitHub \u003e Select your GitHub repo\n```\n\nThereafter, you can deploy code from your GitHub repo. If you have a local Git repo (if you have cloned your main GitHub repo), you will have to push your code to GitHub by using:\n```\n$ git push origin master\n```\n\n#### Deploying from a branch besides master\nIf you want to deploy code to Heroku from a non-```master``` branch of your local repository (for example, ```testbranch```), use the following syntax to ensure it is pushed to the remote’s ```master``` branch:\n```\n$ git push heroku testbranch:master\n```\n\n### After setting up repo on Heroku \u003ca name=\"after_setting_up_repo_on_heroku\"\u003e\u003c/a\u003e\nOnce you've got your repo set up on Heroku, there's two things you'll have to change:\n1. Can't use a prop (credentials) file for username / password anymore since it's untracked in your gitignore, so you'll have to set environmental variables.\n2. Heroku has an ephemeral File System, and you can't preserve generated files between runs (aka pickle caching isn't an option).\n\nTo solve 1), you'll have to set environmental variables. You can set it like this from terminal:\n```\n# Set heroku config/env variables\n$ heroku config:set reddit_username=\u003cyour_reddit_username\u003e\n$ heroku config:set reddit_password=\u003cyour_reddit_password\u003e\n$ heroku config:set client_id=\u003cyour_client_id\u003e\n$ heroku config:set client_secret=\u003cyour_client_secret\u003e\n\n# Confirm they're set with this command\n$ heroku config\n```\n\nAnd programmatically retrieve it in your code like this:\n```\n# Retrieve heroku env variables\nreddit_username = os.environ['reddit_username']\nreddit_password = os.environ['reddit_password']\nclient_id = os.environ['client_id']\nclient_secret = os.environ['client_secret']\n```\n\nTo solve 2), a temporary solution would be to save comments as soon as you reply to them. If a comment has been saved (use ```comment.saved``` to check), then don't reply to that comment. Else, reply to that comment and then save it. To save a comment, use:\n```\ncomment.save()\n```\n\nThis is a temporary solution because Reddit has a max cap of 1000 for the number of comments / posts you can save.\n\nA better solution would be to use a Database to store all the comment IDs. For this, you can use one of Heroku's many data storing / caching options. While most of these add-ons are free, they need you to verify yourself - by adding a credit card to your account.\n\nThe Heroku Postgres add-on however, does not require you to verify yourself. Heroku Postgres is a reliable and powerful database based on PostgreSQL. We'll be using the Heroku Postgres as the database for our Bot.\n\n## ⛏️ Installing Heroku PostgreSQL \u003ca name=\"installing_postgres\"\u003e\u003c/a\u003e\n### Installing locally \u003ca name=\"installing_postgres_locally\"\u003e\u003c/a\u003e\nInstall Postgres via your package manager. The actual package manager command you use will depend on your distribution. The following will work on Ubuntu, Debian, and other Debian-derived distributions:\n```\n$ sudo apt-get install postgresql\n```\n\nThe psql client will typically be installed in /usr/bin:\n```\n$ which psql\n/usr/bin/psql\n```\n\nStart the Postgres server:\n```\n$ sudo systemctl start postgresql\n```\n\nInstalling postgres using ```apt-get``` does not create a user role or a database.\n\nTo create a superuser role and a database for your personal user account:\n```\n$ sudo -u postgres createuser -s $(whoami)\n```\n\nChecking if you have correctly installed Postgres:\n```\n$ sudo -u postgres psql\npsql (10.6 (Ubuntu 10.6-1.pgdg16.04+1))\nType \"help\" for help.\n\npostgres=# \n```\n\n### Using the CLI \u003ca name=\"using_the_cli\"\u003e\u003c/a\u003e\nHeroku Postgres is integrated directly into the Heroku CLI and offers many helpful commands that simplify common database tasks.\n\nBut, to use it you need to provision Heroku Postgress to your app. This can be done by:\n```\nLog in to Heroku \u003e Heroku dashboard \u003e Choose your app \u003e Resources \u003e Add-ons \u003e Select Heroku Postgres \u003e Click on Provision\n```\n\nTo see all PostgreSQL databases provisioned by your application and the identifying characteristics of each (such as database size, status, number of tables, and PG version), use the ```heroku pg:info``` command:\n```\n$ heroku pg:info\n=== DATABASE_URL\nPlan:                  Hobby-dev\nStatus:                Available\nConnections:           2/20\nPG Version:            10.6\nCreated:               2018-11-09 17:12 UTC\nData Size:             7.8 MB\nTables:                1\nRows:                  1/10000 (In compliance)\nFork/Follow:           Unsupported\nRollback:              Unsupported\nContinuous Protection: Off\nAdd-on:                postgresql-clear-32269\n```\n\nTo establish a ```psql``` session with your remote database, use ```heroku pg:psql```.\n\n```psql``` is the _native PostgreSQL interactive terminal_ and is used to execute queries and issue commands to the connected database.\n\n**💡 Note:** You must have PostgreSQL [installed on your system](#installing_postgres_locally) to use ```heroku pg:psql```.\n```\n$ heroku pg:psql\n--\u003e Connecting to postgresql-clear-32269\npsql (10.6 (Ubuntu 10.6-1.pgdg16.04+1))\nSSL connection (protocol: TLSv1.2, cipher: DHE-RSA-AES256-SHA, bits: 256, compression: off)\nType \"help\" for help.\n\nwordbook-bot::DATABASE=\u003e \n```\n\n```pg:pull``` can be used to pull remote data from a Heroku Postgres database to a database on your local machine. The command looks like this:\n```\nheroku pg:pull HEROKU_POSTGRESQL_MAGENTA mylocaldb --app sushi\n```\n\nThis command creates a new local database named ```mylocaldb``` and then pulls data from the database at ```DATABASE_URL``` from the app ```sushi```. To prevent accidental data overwrites and loss, the local database *must not already exist*. You will be prompted to drop an already existing local database before proceeding.\n\nIf providing a Postgres user or password for your local DB is necessary, use the appropriate environment variables like so:\n```\n$ PGUSER=postgres PGPASSWORD=password heroku pg:pull HEROKU_POSTGRESQL_MAGENTA mylocaldb --app sushi\n```\n\n**💡 Note:** As with all ```pg:*``` commands, you can use shorthand database identifiers here. For example, to pull data from ```HEROKU_POSTGRESQL_RED``` on the app ```sushi```, you could run ```heroku pg:pull sushi::RED mylocaldb```.\n\n```pg:push``` pushes data from a local database into a remote Heroku Postgres database. The command looks like this:\n```\n$ heroku pg:push mylocaldb HEROKU_POSTGRESQL_MAGENTA --app sushi\n```\n\nThis command takes the local database ```mylocaldb``` and pushes it to the database at ```DATABASE_URL``` on the app ```sushi```. To prevent accidental data overwrites and loss, the remote database must be empty. You will be prompted to ```pg:reset``` a remote database that is not empty.\n\nUsage of the ```PGUSER``` and ```PGPASSWORD``` for your local database is also supported for ```pg:push```, just like for the ```pg:pull``` command.\n\nHeroku Postgres has a lot more Postgres commands, you can have a look at them [here](https://devcenter.heroku.com/articles/heroku-postgresql#provisioning-heroku-postgres).\n\n### Connecting in Python \u003ca name=\"connecting_in_python\"\u003e\u003c/a\u003e\nTo use PostgreSQL as your database in Python applications you will need to use the ```psycopg2``` package.\n```\n$ pip3 install psycopg2-binary\n```\n\nAnd use this package to connect to ```DATABASE_URL``` in your code.\n```\nimport os\nimport psycopg2\n\nDATABASE_URL = os.environ['DATABASE_URL']\n\nconn = psycopg2.connect(DATABASE_URL, sslmode='require')\n\n# Creating a cursor (a DB cursor is an abstraction, meant for data set traversal)\ncur = conn.cursor()\n\n# Executing your PostgreSQL query\ncur.execute(\"SELECT table_name from column_name\")\n\n# In order to make the changes to the database permanent, we now commit our changes\nconn.commit()\n\n# We have committed the necessary changes and can now close out our connection\ncur.close()\nconn.close()\n```\n\n#### Connecting with Django (If you are using Django)\nInstall the ```dj-database-url``` package using ```pip```.\n```\n$ pip3 install dj-database-url\n```\n\n**💡 Note:** Be sure to add ```psycopg2-binary``` and ```dj-database-url``` to your ```requirements.txt``` file as well.\n\nThen add the following to the bottom of ```settings.py```:\n```\nimport dj_database_url\nDATABASES['default'] = dj_database_url.config(conn_max_age=600, ssl_require=True)\n```\n\nThis will parse the values of the ```DATABASE_URL``` environment variable and convert them to something Django can understand.\n\n### Running the bot \u003ca name=\"running_the_bot\"\u003e\u003c/a\u003e\nAt this point, your bot is not yet running. You still need to:\n\n```Log in to Heroku \u003e Heroku dashboard \u003e Choose your app \u003e Resources \u003e Edit \u003e Enable worker \u003e Confirm```\n\n**💡 Note:** The free version of Heroku gives you ```550``` hours of dyno usage each month. \n\n### Viewing the output \u003ca name=\"viewing_output\"\u003e\u003c/a\u003e\nEverything the bot prints (including stacktraces when it crashes) goes to the Heroku log, which you can view with this command:\n```\nheroku logs\n```\n\nHowever, this displays only about 100 lines. In order to view the logs in real time, use the command:\n```\nheroku logs -t\n```\n\n## 💭 How to use the Bot \u003ca name=\"how_to_use_the_application\"\u003e\u003c/a\u003e\nTo use the bot, type:\n```\n!dict word\n```\nThe first part, i.e. \"!dict\" **is not** case sensitive.\n\nThe bot will then give you the Oxford Dictionary (or Urban Dictionary; if the word does not exist in the Oxford Dictionary) definition of the word as a comment reply.\n\n### Example: \u003ca name=\"example\"\u003e\u003c/a\u003e\n\n\u003e !dict what is love\n\n**Definition:**\n\nBaby, dont hurt me~\nDont hurt me~ no more.\n\n**Example:**\n\nDude1: Bruh, what is love?\nDude2: Baby, dont hurt me, dont hurt me- no more!\nDude1: dafuq?\n\n**Source:** https://www.urbandictionary.com/define.php?term=what%20is%20love\n\n---\n\n\u003csup\u003eBeep boop. I am a bot. If there are any issues, contact my [Master](https://www.reddit.com/message/compose/?to=PositivePlayer1\u0026subject=/u/Wordbook_Bot)\u003c/sup\u003e\n\n\u003csup\u003eWant to make a similar reddit bot? Check out: [GitHub](https://github.com/kylelobo/Reddit-Bot)\u003c/sup\u003e\n\n## 😯 How does the Bot work? \u003ca name=\"how_does_the_bot_work\"\u003e\u003c/a\u003e\n+ The bot first extracts the word from the comment and then fetches word definitions, part of speech, example and source from the Oxford Dictionary API.\n+ If the word does not exist in the Oxford Dictionary, the Oxford API then returns a 404 response upon which the bot then tries to fetch results form the Urban Dictionary API.\n+ The bot uses the Pushshift API to fetch comments, PRAW module to reply to comments and Heroku as a server.\n+ The entire bot is written in Python 3.6\n\n## ☹️ Why didn't the Bot notice me? \u003ca name=\"why_didnt_the_bot_notice_me\"\u003e\u003c/a\u003e\n+ Make sure you are calling the bot correctly. It is:\n\n  ``!dict word``\n\n  The first part, i.e. \"!dict\" **is not** case sensitive.\n\n+ The bot may be down due to maintenance. But, I'll try to keep the down-time as low as possible\n+ I might have ran out of dynos for the month ;__;\n\n## 🎉 Acknowledgements \u003ca name = \"acknowledgements\"\u003e\u003c/a\u003e\n1. [How To Make A reddit Bot](https://www.youtube.com/watch?v=krTUf7BpTc0) - _busterroni11_\n2. [A crash course in setting up your Python Reddit bot on Heroku](https://gist.github.com/ZacSweers/8595628) - _ZacSweers_\n3. [Deploying with Git](https://devcenter.heroku.com/articles/git) - _Heroku_\n4. [Tutorial - Create a reddit bot with python and Heroku ](http://amertune.blogspot.com/2014/04/tutorial-create-reddit-bot-with-python.html) - _amertune_\n5. [Heroku Postgres](https://devcenter.heroku.com/articles/heroku-postgresql) - _Heroku_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkylelobo%2FReddit-Bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkylelobo%2FReddit-Bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkylelobo%2FReddit-Bot/lists"}