telegram can have a little /photo/ and /video/ as a treat
This commit is contained in:
parent
c09266cd17
commit
80cca7b070
@ -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:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user