Handle stickers as well

Also move the deeplinks to elif

Signed-off-by: baalajimaestro <me@baalajimaestro.me>
This commit is contained in:
baalajimaestro 2022-04-09 22:50:21 +05:30
parent 5dc6903291
commit d1bbc59e27
Signed by: baalajimaestro
GPG key ID: F93C394FE9BBAFD5

View file

@ -39,14 +39,16 @@ proc updateHandler(b: Telebot, u: Update): Future[bool] {.async, gcsafe.} =
for i in TempData:
if i.ftype == "photo":
discard await b.sendPhoto(response.chat.id, i.fileid, i.caption)
if i.ftype == "document":
elif i.ftype == "document":
discard await b.sendDocument(response.chat.id, i.fileid, i.caption)
if i.ftype == "video":
elif i.ftype == "video":
discard await b.sendVideo(response.chat.id, i.fileid, caption=i.caption)
if i.ftype == "videonote":
elif i.ftype == "videonote":
discard await b.sendVideoNote(response.chat.id, i.fileid)
if i.ftype == "animation":
elif i.ftype == "animation":
discard await b.sendAnimation(response.chat.id, i.fileid, caption=i.caption)
elif i.ftype == "sticker":
discard await b.sendSticker(response.chat.id, i.fileid)
else:
var fileid = ""
var ftype = ""
@ -68,6 +70,9 @@ proc updateHandler(b: Telebot, u: Update): Future[bool] {.async, gcsafe.} =
elif response.photo.isSome:
fileid = response.photo.get[0].fileId
ftype = "photo"
elif response.sticker.isSome:
fileid = response.sticker.get.fileId
ftype = "sticker"
elif response.mediaGroupId.isSome:
fileid = response.mediaGroupId.get