def send_slack(self, attachments):
"""Sends a message to Slack"""
# Create a Slack bot instance
slack = Slacker(os.environ['SLACK_API_TOKEN'])
# Send a message to #general channel
self.log.info('sending a message to Slack')
slack.chat.post_message('#general',
text = ' ',
username = 'timetable',
icon_emoji = ':spiral_calendar_pad:',
attachments = attachments)
评论列表
文章目录