Skip to content

Commit

Permalink
drop embed creation entirely
Browse files Browse the repository at this point in the history
embeds cant play videos so the logic was changed to just repost the URL and have discord itself create the embed instead of the bot since bot embed just support plain videos rel:discord/discord-api-docs#1253
  • Loading branch information
s1ryx committed Nov 7, 2023
1 parent dfc136c commit 59d40a4
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions gallery-repost.yag
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,11 @@
{{ range .Message.Attachments }}
{{/* filter by file extension, so only embeds that would get a thumbnail generated are appended */}}
{{if (reFind `(?i)\.(png|jpe?g|webp|svg|webm|mp4)\z` .Filename) }}
{{ $message = $message.Append (cembed "image" (sdict "url" .ProxyURL )) }}
{{ sendMessage $channel .URL }}
{{ end }}
{{ end }}
{{/* afterwards, add all valid image URLs as embeds too */}}
{{ range $urls }}
{{ $message = $message.Append (cembed "image" (sdict "url" . )) }}
{{ end }}
{{/* send message with all constructed embeds when there is at least one element to append*/}}
{{ if (gt (len $message) 0 ) }}
{{ sendMessage $channel (complexMessage "embed" $message ) }}
{{ sendMessage $channel . }}
{{ end }}
{{ end }}

0 comments on commit 59d40a4

Please sign in to comment.