Skip to content

Latest commit

 

History

History
21 lines (16 loc) · 857 Bytes

README.md

File metadata and controls

21 lines (16 loc) · 857 Bytes

heic2jpg-bot

A simple Discord bot that looks for attachments with .heic or .heif extensions, converts them with heif-convert to a JPEG, and then uploads back onto discord. Deployed on Heroku.

I made this because my students on Discord often upload photos from Apple devices which are HEIF files, and Discord cannot preview these files, so I would either have to use an external program to view them or convert them manually to a JPEG.

Setup & Running:

The bot will look for the Discord token under the environment variable DISCORD_TOKEN. On linux:

$ export DISCORD_TOKEN=yourtokenhere
$ python3 -m pip install -r requirements.txt
$ sudo apt install libheif-examples
$ python3 bot.py

Notes

Procfile, Aptfile and runtime.txt are Heroku specific files, you do not need them to run/deploy the bot if you are not using Heroku.