def postMessage(message: str, channel: str=config.channel, attachments: List=[]) -> Optional[Mapping]:
""" Post a message to the specified slack channel """
if secrets.slackOauth:
slack = Slacker(secrets.slackOauth)
if channel:
resp = slack.chat.post_message(channel, message, attachments=attachments)
return resp.body
return None
评论列表
文章目录