-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attachments #17
Comments
Hey. There's a veeeery crude implementation here. Feel free to have a look and you know.. provide some feedback. Some notes (apart from code being a mess)
|
The issue with using blockquotes would be that Riot strips all attempts at coloring it. Although that might be solved with a patch to Riot. I'll see if I can squeeze the patch in, but for now using blockquote should be fine. |
That would be awesome! So ditch the Also I think I'll add a |
Yea, ditch the bar thing and replace it with Technically Riot supports tables, they're just really ugly. A |
Yea, it's just a promise thing. The avatar code should give a somewhat dirty example on how to use it. |
I think I might drop the |
Put it in its own layer, before slack_attachments? Is it possible for it to not resolve before the next layer starts doing its thing? |
The layer can return a promise and it'll block on that. |
Maybe squash the commits? |
Opening a PR would probably be best so it's easier to see the changes. |
Added. Thanks @joenas ! |
Is supporting the "thumb_url" or "icon_url" slack message parameters in the plans? For example, I have a payload like this:
|
ref: https://api.slack.com/docs/message-attachments
The
fallback
should be treated as plain text (no formatting) and is used when the client (matrix) doesn't support the message.Color / pretext
color
:good
,warning
,danger
, or any hex code like#439FE0
Slack renders this like:
we'll render it like this:
Attachments are otherwise rendered with a grey line. It's unfortunate that matrix doesn't support the line wrapping (pre-text) thing, but this will work for now.
Pretext is
pretext
Use #f7f7f7 for default.
Authors
author_name
,author_link
,author_icon
<img src='mxc://t2bot.io/hcSELkhLCNMRxLLTXKffPPSn' width='16' height='16'> <a href='https://matrix.to/#/user/@voyager:t2bot.io'>Matrix Traveler</a>
Although the image may need cropping ahead of time.
Titles
title
,title_link
Basically an h3 as an anchor
Fields
fields
is an array of{title, value, short}
.short
is optional.Images
image_url
thumb_url
Footers
footer
andfooter_icon
(text & image). Treat much like the authorsts
(timestamp) - seconds since epochThe text was updated successfully, but these errors were encountered: