Skip to content

Instantly share code, notes, and snippets.

@Loknar
Created November 17, 2015 15:20
Show Gist options
  • Save Loknar/c6758a224c7430c91dbf to your computer and use it in GitHub Desktop.
Save Loknar/c6758a224c7430c91dbf to your computer and use it in GitHub Desktop.
#!/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