add author icon
This commit is contained in:
parent
a2a6a9892e
commit
60bb897613
1 changed files with 19 additions and 0 deletions
|
|
@ -21,6 +21,24 @@ icons = {
|
||||||
'resolved': ':white_check_mark:'
|
'resolved': ':white_check_mark:'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
'''
|
||||||
|
Example message:
|
||||||
|
|
||||||
|
{
|
||||||
|
"text": "Example message",
|
||||||
|
"attachments": [
|
||||||
|
{
|
||||||
|
"title": "Rocket.Chat",
|
||||||
|
"title_link": "https://rocket.chat",
|
||||||
|
"text": "Rocket.Chat, the best open source chat",
|
||||||
|
"image_url": "/images/integration-attachment-example.png",
|
||||||
|
"color": "#764FA5"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
'''
|
||||||
|
|
||||||
|
|
||||||
'''
|
'''
|
||||||
Example attachment:
|
Example attachment:
|
||||||
|
|
||||||
|
|
@ -147,6 +165,7 @@ def send_alert_message(channel, alert):
|
||||||
"message_link": alert.get('generatorURL', '#'), # link for timestamp, mandatory to display timestamp
|
"message_link": alert.get('generatorURL', '#'), # link for timestamp, mandatory to display timestamp
|
||||||
"collapsed": True, # collapse details by default
|
"collapsed": True, # collapse details by default
|
||||||
"author_name": alert['labels'].get('instance', 'unknown'),
|
"author_name": alert['labels'].get('instance', 'unknown'),
|
||||||
|
"author_icon": "https://rocket.cccv.de/emoji-custom/molli.png",
|
||||||
"title": alert['annotations']['title'],
|
"title": alert['annotations']['title'],
|
||||||
"fields": [{"short": True, "title": key, "value": value} for key, value in alert['labels'].items() if
|
"fields": [{"short": True, "title": key, "value": value} for key, value in alert['labels'].items() if
|
||||||
key not in label_ignore_fields]
|
key not in label_ignore_fields]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue