Created
November 17, 2015 15:20
-
-
Save Loknar/c6758a224c7430c91dbf 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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
from slackclient import SlackClient | |
CHANNEL_ID = 'add_channel_id_here' | |
SLACKBOT_TOKEN = 'add_slackbot_token_here' | |
def slack_msg(msg, channel=CHANNEL_ID): | |
token = SLACKBOT_TOKEN | |
sc = SlackClient(token) | |
if sc.rtm_connect(): | |
sc.rtm_send_message(channel, msg) | |
else: | |
print 'Sending a slack message failed, invalid token?' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment