A Telegram Bot to remember Harambe through replacing faces with his own.
You do this by messaging @BotFather in the Telegram app itself.
- Zip all of the contents of this repo (READ: the contents, not a single directory containing the contents).
- Choose
Upload a .ZIP file
in theCode
tab - Set your Telegram bot token as an environment variable
- Once your Lambda function is running on AWS, switch to the
Triggers
tab and copy your API Gateway URL. Paste it into the following command to register it as the webhook URL to which Telegram should post:
curl -XPOST https://api.telegram.org/botYOURTOKEN/setWebhook\?url\=YOURAPIGATEWAYURL
TODO: add instructions to run as a simple Flask app to poll as Dogefy Telegram Bot does
File/Directory | Character |
---|---|
harambe.png |
Faces are replaced with this image, and alpha layers are preserved. |
cascade.xml |
The OpenCV algorithm by which human faces are detected. This algorithm is hosted here. |
lambda.py |
This is where the logic happens. lambda_handler() is the function that the AWS Lambda function executes when telegram POSTs to the AWS API Gateway's webhook URL. |
cv2/ |
OpenCV wrapped in Python. Since OpenCV is native code, it is necessary to do pip install opencv-python on the environment in which it will run. The cv2 directory contained in this repo has been built by running [ip install opencv-python on an EC2 instance running Amazon Linux AMI, which is what AWS Lamba also runs. In other words, if you are running Harambify locally, you'll need to rebuild OpenCV on your machine. |
telebot/ |
[pyTelegramBotAPI], a Telegram Bot SDK for Python. pip install pyTelegramBotAPI . |
requests/ |
A dependency of pyTelegramBotAPI . |
- Scriptify the AWS Lambda deployment
- Add instructions for running locally on other platforms
- Pluralize the "1 people have honored Harambe" and perhaps pepper in some wit and rotate messages
- Fix a bug preventing multi-face detection
The face-swap code is essentially a fork of the Dogefy Telegram Bot.