jellyfin / jellyfin-plugin-webhook

GNU General Public License v3.0
149 stars 46 forks source link

Custom template not working #292

Open 7eventy7 opened 1 week ago

7eventy7 commented 1 week ago

Having some trouble getting my custom webhook template working, if anyone could take a quick look over it I'd be very appreciative!

    "content": "{{MentionType}}",
    "avatar_url": "{{AvatarUrl}}",
    "username": "{{{BotUsername}}}",
    "embeds": [
        {   
            "author": {
                {{#if_equals ItemType 'Season'}}
                    "name": "New Season",
                {{/if_equals}}

                {{#if_equals ItemType 'Episode'}}
                    "name": "New Episode",
                {{/if_equals}}

                {{#if_equals ItemType 'Movie'}}
                    "name": "New Movie",
                {{/if_equals}}

                {{#if_equals ItemType 'Song'}}
                    "name": "New Song",
                {{/if_equals}}
            },

            "thumbnail": {
                "url": "{{ServerUrl}}/Items/{{ItemId}}/Images/Primary"
            },

            "description": "
            **{{#if_equals ItemType 'Movie'}}{{Name}}{{/if_equals}}
            {{#if_equals ItemType 'Episode'}}{{SeriesName}} S{{SeasonNumber00}}E{{EpisodeNumber00}} ~ {{Name}}{{/if_equals}}
            {{#if_equals ItemType 'Season'}}{{SeriesName}} {{Name}}{{/if_equals}}
            {{#if_equals ItemType 'Song'}}{{AlbumArtist}} - {{Name}}{{/if_equals}}**

            {{~#if_equals ItemType 'Movie'~}}
                {{~#if_exist Overview~}}
                    > {{{Overview}}}\n\n
                {{~/if_exist~}}
            {{~/if_equals~}}

            {{~#if_equals ItemType 'Season'~}}
                {{~#if_exist Overview~}}
                    > {{{Overview}}}\n\n
                {{~/if_exist~}}
            {{~/if_equals~}}
            ",

            "color": "4AC474",

            "footer": {
                "text": "{{{ServerName}}} ",
                "icon_url": "{{AvatarUrl}}"
            },

            "timestamp": "{{Timestamp}}"
        }
    ]
}
crobibero commented 1 week ago

Can you please be specific with what you are trying to do and what the issue is that you are having?

7eventy7 commented 1 week ago

Just trying to make simple nice looking embeds for discord. I used the additemdiscord template as reference but once I started changing it for my purposes something broke. I simply can't figure out what's wrong with it!