BadMiss Bot

What?

BadMiss Bot is an internal app to the ACWP Slack designed to be triggered by ACWP Slack Users in the likely event of a BMD failure in the #bmd channel. The command will publish the quick video of OHH THAT'S A BAD MISS from the Mitchel and Webb Look snooker commentary scene.

How?

Triggered in Slack by using the /BadMiss command.

Technical

A Flask app served with uWSGI and Nginx hosted on legendary.industries/badmiss.

Code

Maintained by @legendarypatman on the ACWP Slack. Ping a DM or @ message if you have questions or issues or get my contact details from my about page.

badmiss.py

#!/usr/bin/env python

from flask import Flask, jsonify, request
import os
import dotenv

dotenv_path = os.path.join(os.path.dirname(__file__), '.env')
dotenv.load_dotenv(dotenv_path)
verification_token = os.environ['VERIFICATION_TOKEN']

app = Flask(__name__)

@app.route('/badmiss', methods=['POST'])
def badmiss():
    if request.form['token'] == verification_token:
        payload = {'text': 'Ohh that\'s a bad miss! \n https://youtu.be/OSMBhsyz1Bg'}
        return jsonify(payload)

if __name__ == '__main__':
    app.run()

Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.