Skip to content

[add] slack: Support message attachments#2184

Merged
liiight merged 1 commit intoFlexget:developfrom
rbraunschweig:feature/slack-attachments
Jul 31, 2018
Merged

[add] slack: Support message attachments#2184
liiight merged 1 commit intoFlexget:developfrom
rbraunschweig:feature/slack-attachments

Conversation

@rbraunschweig
Copy link
Copy Markdown
Contributor

Motivation for changes:

Supersedes/reopens #1716.

Detailed changes:

  • Add attachments to schema and include in payload

Config usage:

templates:
  slack:
    notify:
      entries:
        message: ":movie_camera: {{ imdb_name }}"
        via:
          - slack:
              web_hook_url: "{? slack.web_hook_url ?}"
              username: "{? slack.username ?}"
              attachments:
                - title: "{{ imdb_name }} ({{ imdb_year }})"
                  image_url: "{{ tmdb_posters | first }}" # better quality
                  title_link: "{{ imdb_url }}"
                  fallback: "{{ imdb_name }} ({{ imdb_year }})"
                  text: "{{ imdb_plot_outline }}"
                  color: "#e67e22"
                  footer: "{{ task }}"
                  footer_icon: "https://avatars2.githubusercontent.com/u/17483320?s=400&v=4"
                  fields:
                    - title: Runtime
                      value: "{{ tmdb_runtime }} mins"
                      short: true
                    - title: Score
                      value: "{{ imdb_score }}"
                      short: true
                    - title: Genres
                      value: "{{ imdb_genres | join(', ') | title }}"
                      short: true
                    - title: Rating
                      value: "{{ imdb_mpaa_rating }}"
                      short: true
                    - title: Cast
                      value: >
                        {% for key, value in imdb_actors.iteritems() %}
                          {{value}}
                          {% if not loop.last %}, {% endif %}
                        {% endfor %}
                      short: false

Output:

image

To Do:

  • Update wiki

@liiight liiight merged commit 46670bb into Flexget:develop Jul 31, 2018
@liiight
Copy link
Copy Markdown
Member

liiight commented Jul 31, 2018

Thanks for this, that config is pretty sweet. Can you please update the wiki?

@rbraunschweig
Copy link
Copy Markdown
Contributor Author

No problem. Sure, I'll get right on it.

@rbraunschweig rbraunschweig deleted the feature/slack-attachments branch July 31, 2018 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants