This is a Discord bot to create memes with custom text on top of pre-loaded image templates. Use this to mess with your friends and meme quickly without ever leaving the chat.
Need help getting started? Try !help. Want to produce the same meme as sample-memes/bruh.png? Try:
/meme bruh "" / bruh
This bot is running on Python 3.10. Clone this repository and poetry install with Python >= 3.10.
The bot can be run in local development mode in order to test functionality without having to connect to AWS. In this mode, debug information will be printed and the bot will send images locally instead of uploading to AWS. Additionally, the images will be sent as images instead of embeds.
To setup local development mode you must do the following:
- Setup a bot on the Discord Developers website
- Run the bot with either the
"discord_token"filled in inconfig/creds.jsonor the$DISCORD_TOKENenvironment variable set:
DISCORD_TOKEN=<TOKEN> python -m nachomemes.bot --debug --localThe --local flag enforces a local template store (JSON) instead of using DynamoDB. The --debug flag will run the bot with verbose logging to make debugging easier.
The easiest way to run this locally is via docker. First create a creds.json file in the /config directory. If you are running locally only include the discord token. If you are running in AWS incude the relevant key, secret, and region (see Production). You can see the creds.json format in a later section. Then run docker-compose up.
Alternatively you can specify the same sections from the creds.json format as environment variables and make them available when running the Docker compose command.
Generate some keys (AWS and Discord), and put them in a config/creds.json file like so:
{
"access_key": <TOKEN>,
"secret": <TOKEN>,
"region": <REGION>,
"discord_token": <TOKEN>
}To add custom templates and layouts (i.e. photos and the textboxes that go over them) look into config/templates.json and config/layouts.json respectively. In the future the bot will support dynamic addition without editing these files.
Run python -m nachomemes.bot and you're off to meme like a lord.
Memes are created using a custom implementation. The render engine is dependent on Pillow to place formatted strings on source_images/. For an example look at test/test_render.py.
Chris
Chief Code Breaker & Senior Tech Lead
"I guess I wrote it, but I have no idea what it does"
Cooper
Senior Liason to Asia & Memechine Learning Engineer
"YOU SIGNED A BINDING ARBITRATION AGREEMENT FUCKO I OWN YOU NOW!"
Joe
Senior Python Hater & Lead Code Integrity Analyst
"tbh i know this sounds weird but i find im most productive yell-pair-programming"
Sam
Junior Apple Devotee & Lead Infrastructure Engineer
"I can't tell if pylint is actually running"
Corey
Chief Sailor & Senior Meme Engineer
"Google something new every day"