def _post(self, message):
"""Post message to Slack"""
key = self.GetConfigEntryWithDefault("SlackAPIKey", None)
if not key:
return
channel = self.GetConfigEntryWithDefault("SlackChannel", None)
if not channel:
return
as_user = self.GetBooleanConfigEntryWithDefault("SlackAsUser", True)
as_user = bool(as_user)
from slacker import Slacker
slack = Slacker(key)
# Post to slack
slack.chat.post_message(channel,
message,
as_user=as_user)
评论列表
文章目录