Open avamsi opened 2 years ago
Chat message could be formatted instead of being plain text -- https://developers.google.com/chat/api/reference/rest/v1/cards, https://developers.google.com/chat/api/guides/message-formats/cards but AFAICT, it doesn't support setting monospace text, which really sucks.
Hopefully one day it would, but for now, stashing the code here..
CardsV2: []*chat.CardWithId{{
Card: &chat.GoogleAppsCardV1Card{
Sections: []*chat.GoogleAppsCardV1Section{{
Widgets: []*chat.GoogleAppsCardV1Widget{
{
DecoratedText: &chat.GoogleAppsCardV1DecoratedText{
StartIcon: &chat.GoogleAppsCardV1Icon{
KnownIcon: "DOLLAR",
},
Text: msg,
WrapText: true,
},
},
{
DecoratedText: &chat.GoogleAppsCardV1DecoratedText{
StartIcon: &chat.GoogleAppsCardV1Icon{
KnownIcon: "CLOCK",
},
Text: msg,
WrapText: true,
},
},
},
}},
},
}},
msg was <font color="#ea9999">test</font>
..