A Discord bot that sends random memes from Reddit using the Meme API.
This project was my final project for the Codedex Python course, where I elaborated on each line of code to fully understand how APIs work and how to interact with Discord servers via Python.
Meme Bot is a fun Discord bot built with Python. It fetches memes from Reddit in real-time using the Meme API and posts them directly to your Discord server.
This project was inspired by the tutorial by Hong Jeon on Codedex, but I expanded the code by adding detailed comments to understand every part of the API interaction and bot functionality.
- Fetches random memes from Reddit using Meme API.
- Posts memes directly into a Discord server channel.
- Fully commented Python code for learning purposes.
- Lightweight and easy to set up.
- Clone the repository
git clone https://github.com/sbcxty/Meme-Bot.git
cd Meme-Bot
- Install Dependencies
py -3 -m pip install -U discord.py
python3 -m pip install requests
- Create a Discord bot
- Go to Discord Developer Portal
- Create a new application and bot
- Copy the bot token
- Enable Message Content Intent under Privileged Gateway Intents
- Go to OAuth2, select bot under OAuth2 URL Generator, and Send Messages under Bot Permissions
- Copy the Generated URL below and paste it on a new tab to invite the bot to your server.
- Set your bot token
- Install python-dotenv
pip install python-dotenv
- Create a .env file in the project root and input your token:
DISCORD_TOKEN=YOUR_BOT_TOKEN_HERE
- Run the bot
python bot.py
Once the bot is added to your server, type the following command in any text channel where it has permissions:
$memes
- Hong Jeon - Original tutorial for learning Discord bots with Python.
- Meme API Repository - API for fetching random memes from Reddit.
- My own elaboration and detailed comments to fully understand how the bot and API work.
-Made with ❤️ by Shekainah Bag-ao