/crosswordy

Crosswordy is a serverless Discord bot that provides crossword hints and answers using AWS Lambda and OpenAI. Perfect for help and memes alike!

Primary LanguagePythonMIT LicenseMIT

crosswordy

Crosswordy logo

Crosswordy is a serverless Discord bot that provides users with crossword hints or answers. You could use it for help, but it's mostly for memes. Uses OpenAI to generate the answers. It's surprisingly satisfying.

Examples

Given a hint, come up with a word:

Crosswordy logo Crosswordy logo

Given a word, come up with a hint:

Crosswordy logo Crosswordy logo

Setup & Deploy

To set up your own Crosswordy bot, follow these steps:

  1. Create a discord bot in the Discord Developer Portal.

  2. Deploy the Lambda using AWS SAM. You can get started with sam deploy --guided and follow the prompts. After you've deployed the lambda, you'll need to add the environment variables on aws console. Set these two variables:

DISCORD_PUBLIC_KEY="<YOUR DISCORD API KEY>"
OPENAI_API_KEY="<YOUR OPENAI API KEY>"
  1. Register the slash commands with the bot by copying the .env.example file to .env and filling in the values. Then run
pip install -r requirements.txt # get the requirements
python register_commands.py

The APP_ID, DISCORD_PUBLIC_KEY, BOT_TOKEN can be found in the Discord Developer Portal. The GUILD_ID is the ID of the server you want to add the bot to. You can find this by right clicking on the server name and clicking "Copy ID".

  1. Build and deploy the lambda with
sam build
sam deploy
  1. Finally, invite the bot to your server with the link provided by the Discord Developer Portal.