Created
October 14, 2016 20:55
-
-
Save PJB3005/60b95edbfb297155421bc4a9bafede10 to your computer and use it in GitHub Desktop.
Discord Relay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
from __future__ import print_function | |
from flask import Blueprint, request, abort | |
from multiprocessing.connection import Client | |
discordrelay = Blueprint("discordrelay", __name__) | |
@discordrelay.route("/discord") | |
def relay(): | |
message = { | |
"id": "nudge", | |
"pass": request.args["pass"], | |
"admin": request.args.get("admin", "false") == "true", | |
"content": request.args["content"], | |
"ping": request.args.get("ping", "false") == "true" | |
} | |
client = Client(("localhost", 1679)) | |
client.send(message) | |
client.close() | |
return "Successfully sent the message to MoMMI." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment