Skip to content

Commit

Permalink
Render more from a Slack attachment
Browse files Browse the repository at this point in the history
  • Loading branch information
cdupuis committed Aug 24, 2018
1 parent 3cbf391 commit f1f366a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/sdm/ui/ConsoleMessageClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,18 @@ export class ConsoleMessageClient implements MessageClient, SlackMessageClient {
await this.writeToChannel(channel, msg.text);
}
(msg.attachments || []).forEach(async att => {
let text = "";
if (!!att.author_name) {
text += `__${att.author_name}__\n`;
}
if (!!att.title) {
text += `**${att.title}**\n`;
}
if (!!att.text) {
await this.writeToChannel(channel, att.text);
text += att.text;
}
if (!!text) {
await this.writeToChannel(channel, text);
}
(att.actions || []).forEach(async (action, index) => {
await this.renderAction(channel, action, actionKeyFor(msg, index));
Expand Down

0 comments on commit f1f366a

Please sign in to comment.