telegram can have a little /photo/ and /video/ as a treat

This commit is contained in:
Cynthia Foxwell 2025-04-15 14:52:56 -06:00
parent c09266cd17
commit 80cca7b070
No known key found for this signature in database

View File

@ -141,11 +141,13 @@ proc createStatusRouter*(cfg: Config) =
avatar = tweet.user.userPic
time = some(tweet.time)
let isDiscord = request.headers.getOrDefault("User-Agent").toString().contains("Discordbot")
let
ua = request.headers.getOrDefault("User-Agent").toString()
isChatEmbedder = ua.contains("Discordbot") or ua.contains("TelegramBot")
var
realMediaIndex = mediaIndex
realUseVideo = false
if isDiscord and media.len > 0:
if isChatEmbedder and media.len > 0:
if media == "video" and tweet.video.isSome or tweet.gif.isSome:
tweet.photos = @[]
elif media == "photo" and tweet.photos.len > 0: