Skip to content

Generates custom playing card set and creates a bot that draws them using a discord command

License

Notifications You must be signed in to change notification settings

pkopparla/discord-playing-cards-bot

Repository files navigation

discord-playing-cards-bot

Generates custom playing card set and creates a bot draws them using a discord command. Needs python 3.10. Usage:

  1. To generate the playing cards do python card_generator/generate_card.py all. Uses base images from the base_images directory, which use selected pieces from the EVMavericks collection.
  2. To launch the bot, do python discord_bot/main.py. Needs the authorization token to be passed in either as an environment variable or in a .env file.
  3. The bot looks for a command /draw followed by a number from 1 to 5. For invalid input it defaults to 1. The bot then generates an image with that number of randomly selected cards (with replacement, ie., one card can appear multiple times in each selection) from the collection and posts it in a response.
  4. The code is pretty light and was tested to work on a google cloud ec2-micro instance. Command list for reference:
  • gcloud compute scp --recurse ../discord-playing-cards-bot cardbot-vm:~
  • gcloud compute ssh cardbot-vm
  • sudo apt-get install pip
  • pip install -r requirements.txt
  • Add `export PATH="/home/kopparla/.local/bin:$PATH" to .bashrc
  • python3 discord_bot/main.py
  1. Docker setup, commands:
  • docker build -t cardbot .
  • docker run -it -v $(pwd):/workspace -w /workspace cardbot python discord_bot/main.py

About

Generates custom playing card set and creates a bot that draws them using a discord command

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published