Open conors06 opened 1 year ago
The json that is you posted is invalid. Please provide the template you are using.
{ {{#if_exist SlackUsername}} "username": "{{BotUsername}}", {{/if_exist}} {{#if_exist SlackIconUrl}} "icon_url": "{{SlackIconUrl}}", {{/if_exist}} {{#if_equals ItemType 'Season'}} "text": "{{{SeriesName}}} {{{Name}}} has been added to {{{ServerName}}}", {{else}} {{#if_equals ItemType 'Episode'}} "text": "{{{SeriesName}}} S{{SeasonNumber00}}E{{EpisodeNumber00}} {{{Name}}} has been added to {{{ServerName}}}", {{else}} "text": "{{{Name}}} ({{Year}}) has been added to {{{ServerName}}}", {{/if_equals}} {{/if_equals}} }
It's just the template slack one
I believe your slack icon url is what is causing issues, looks like it has a trailing backslash
Tried it with different icon image and no icon didn't work either way
I am also facing a similar issue: @crobibero Did you find a solution?
[12:15:14] [WRN] [18] Jellyfin.Plugin.Webhook.Destinations.Slack.SlackClient: Notification failed with POST request to https://hooks.slack.com/services/xxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxx: {
"token": "",
"user": "",
"message": "John started playing: Looney.Tunes.Cartoons.S05E30 ()"
}
[12:15:14] [WRN] [18] Jellyfin.Plugin.Webhook.Destinations.Slack.SlackClient: Notification failed with response status code BadRequest: no_text
I am not using an icon url. Here is the template I am using:
{
"token": "{{Token}}",
"user": "{{UserToken}}",
{{#if_equals NotificationType "PlaybackStart"}}
{{#if_equals ItemType 'Episode'}}
"message": "{{NotificationUsername}} started playing show:\n\n{{SeriesName}} ({{Year}})\nS{{SeasonNumber00}}E{{EpisodeNumber00}} - {{Name}}"
{{/if_equals}}
{{#if_equals ItemType 'Movie'}}
"message": "{{NotificationUsername}} started playing movie: {{Name}} ({{Year}})"
{{/if_equals}}
{{/if_equals}}
}
@Aadityajoshi151 Are token
and user
populated when being sent?
@crobibero No, they are not.
I would start there. You need to add the details so Slack knows you are authorized to send messages.
Got it. With some trial and error I was able to get the notifications working. It looks like I got templates for Discord and Slack mixed up. Here is the working template (for slack) if someone is interested:
{
{{#if_exist SlackUsername}}
"username": "{{BotUsername}}",
{{/if_exist}}
{{#if_exist SlackIconUrl}}
"icon_url": "{{SlackIconUrl}}",
{{/if_exist}}
{{#if_equals NotificationType "PlaybackStart"}}
{{#if_equals ItemType 'Season'}}
"text": "{{{NotificationUsername}}} started watching {{{SeriesName}}} {{{Name}}}",
{{else}}
{{#if_equals ItemType 'Episode'}}
"text": "{{{NotificationUsername}}} started watching {{{SeriesName}}} S{{SeasonNumber00}}E{{EpisodeNumber00}} {{{Name}}}",
{{else}}
"text": "{{{NotificationUsername}}} started watching {{{Name}}} ({{Year}})",
{{/if_equals}}
{{/if_equals}}
{{/if_equals}}
}
Is there a way to fix this? Jellyfin with Docker Compose