Created
November 27, 2017 00:23
-
-
Save miguelmota/8b8c9ec4a03634f0f02363959f2c83eb to your computer and use it in GitHub Desktop.
Slack post message in Python
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
import requests | |
token = 'xoxp-abc' | |
channel = 'some-channel' | |
text = 'hello' | |
bot_name = 'Bot' | |
payload = data = {'token': token, 'channel': channel, 'text': text, 'username': bot_name} | |
r = requests.post('https://slack.com/api/chat.postMessage', payload) | |
print(r.text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment