Created
February 13, 2017 16:55
-
-
Save looneym/dda1ea93fb854ef33f95656937416578 to your computer and use it in GitHub Desktop.
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
from slackclient import SlackClient | |
from flask import Flask, request | |
# Slack config | |
BOT_TOKEN = os.environ['BOTKEY'] | |
CHANNEL_NAME = "intercom-event-notifications" | |
app = Flask(__name__) | |
@app.route('/', methods=['POST']) | |
def get_body(): | |
req = request.get_data() | |
# process the request here and extract whatver info you need for the slack message | |
message_to_slack(message) | |
return req | |
def message_to_slack(message) | |
sc = SlackClient(BOT_TOKEN) | |
sc.rtm_connect() | |
sc.rtm_send_message(CHANNEL_NAME, message ) | |
if __name__ == '__main__': | |
app.run(debug=True, port=5000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment