Skip to content
This repository has been archived by the owner on Feb 8, 2019. It is now read-only.

Commit

Permalink
identation fixed and slack settings matched with settings not user pr…
Browse files Browse the repository at this point in the history
…ofile model
  • Loading branch information
leventyalcin committed Jun 1, 2014
1 parent 07d6c0a commit eebcbf8
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions notification/notifier/slack.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
from slacker import Slacker

class SlackNotifier:
def notify(self, notification):
slack = Slacker(notification.user_to_notify.profile.slack_apikey)
response = slack.chat.post_message(notification.user_to_notify.profile.slack_channel, notification.message)
if not response.error:
print "Slack message sent"
else:
print "Failed to send Slack message"

def __init__(self, config):
self.__config = config

def notify(self, notification):
slack = Slacker(self.__config['apikey'])
response = slack.chat.post_message(self.__config['channel'], notification.message)
if not response.error:
print "Slack message sent"
else:
print "Failed to send Slack message"

0 comments on commit eebcbf8

Please sign in to comment.