Last active
July 19, 2019 07:29
-
-
Save alessiamarcolini/cf215cbd86214dae01a4247798db4ca5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# ! pip install slackclient | |
# get your token: https://api.slack.com/custom-integrations/legacy-tokens | |
# composing messages: https://api.slack.com/messaging/composing | |
import os | |
from slack import WebClient | |
sc = WebClient(token='<your_token>', run_async=True) | |
sc.chat_postMessage(channel='#tasks-notifications', text='', icon_emoji=':smile:', username='') # username is the "sender" name | |
async def post_my_message(channel, msg): | |
await sc.chat_postMessage(channel=channel, text=msg) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment