Skip to content

NachoMemes/NachoMemes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

695 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code Style: Black

Overview

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

Run This Yourself

This bot is running on Python 3.10. Clone this repository and poetry install with Python >= 3.10.

Local Development

Without Docker

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:

  1. Setup a bot on the Discord Developers website
  2. Run the bot with either the "discord_token" filled in in config/creds.json or the $DISCORD_TOKEN environment variable set:
DISCORD_TOKEN=<TOKEN> python -m nachomemes.bot --debug --local

The --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.

With Docker

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.

Production

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.

Dependencies

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.

Meet the Team

Chris

Chris

Chief Code Breaker & Senior Tech Lead

"I guess I wrote it, but I have no idea what it does"

Cooper

Cooper

Senior Liason to Asia & Memechine Learning Engineer

"YOU SIGNED A BINDING ARBITRATION AGREEMENT FUCKO I OWN YOU NOW!"

Joe

Joe

Senior Python Hater & Lead Code Integrity Analyst

"tbh i know this sounds weird but i find im most productive yell-pair-programming"

Sam

Sam

Junior Apple Devotee & Lead Infrastructure Engineer

"I can't tell if pylint is actually running"

Version 1.0

Corey

Chief Sailor & Senior Meme Engineer

"Google something new every day"