def send_to_slack(message, config, channel='#general'):
"""
Sends a message to the ToR slack.
:param message: String; the message that is to be encoded
:param channel: String; channel option, defaults to general
:param config: the global config dict.
:return: None.
"""
if config.slack_api_key:
slackc = SlackClient(config.slack_api_key)
slackc.api_call(
'chat.postMessage',
channel=channel,
text=message
)
return
评论列表
文章目录