slack.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:covart-web 作者: cyliang 项目源码 文件源码
def send_postponed(self, meeting, postponed_date, reason):
        text = "There will be *no* group meeting next week (%A, %b %d, %Y)"
        text = postponed_date.strftime(text) + ("%s.\n" % reason.lower())
        text += "The next group meeting has been postponed to "
        text += meeting.date.strftime("%A, %b %d, %Y. ")
        text += "Presenters will be %s." % get_text_list(
            map(unicode, meeting.presenters.all()), 'and'
        )

        attachments = [{
            "fallback": "Go %s for detail." % _url(meeting.get_absolute_url()),
            "actions": [{
                "type": "button",
                "text": "Detail",
                "url": _url(meeting.get_absolute_url()),
            }]
        }]

        return unicode(self("chat.postMessage",
            text=text,
            attachments=attachments,
            icon_url=_url(static('slack/presentation.png')),
            username='Meeting Bot',
        ))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号