I would like to color code my slack message using the 'good' (green) color code.
(我想使用“好”(绿色)颜色代码为我的闲暇消息添加颜色。)
I am using the python notifiers
module combined with "incoming webhooks". (我正在使用结合“传入的webhooks”的python notifiers
模块。)
I tried the following with no luck:
(我没有运气就尝试了以下方法:)
try1:
(尝试1:)
from notifiers import get_notifier
slack = get_notifier('slack')
slack._schema['properties']['attachments']['items']['properties']['color'] = 'good'
return slack.notify(message=msg,
webhook_url=slack_bot_url)
try2:
(try2:)
from notifiers import get_notifier
slack = get_notifier('slack')
return slack.notify(message=msg,
webhook_url=slack_bot_url, attachments=[{dict(color='good')}])
Any idea how can I send a color coded message to slack using the notifiers module?
(知道如何使用notifiers模块将颜色编码的消息发送到松弛状态吗?)
Resources:
(资源:)
ask by Yuval Atzmon translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…