Use elif blocks instead of falling through each if
It cannot be a video and photo at the same time Signed-off-by: baalajimaestro <me@baalajimaestro.me>
This commit is contained in:
parent
6c0db09773
commit
5be6fb18ba
1 changed files with 5 additions and 5 deletions
|
@ -41,19 +41,19 @@ proc updateHandler(b: Telebot, u: Update): Future[bool] {.async, gcsafe.} =
|
|||
if response.document.isSome:
|
||||
fileid = response.document.get.fileId
|
||||
ftype = "document"
|
||||
if response.video.isSome:
|
||||
elif response.video.isSome:
|
||||
fileid = response.video.get.fileId
|
||||
ftype = "video"
|
||||
if response.videoNote.isSome:
|
||||
elif response.videoNote.isSome:
|
||||
fileid = response.videoNote.get.fileId
|
||||
ftype = "videonote"
|
||||
if response.animation.isSome:
|
||||
elif response.animation.isSome:
|
||||
fileid = response.animation.get.fileId
|
||||
ftype = "animation"
|
||||
if response.photo.isSome:
|
||||
elif response.photo.isSome:
|
||||
fileid = response.photo.get[0].fileId
|
||||
ftype = "photo"
|
||||
if response.mediaGroupId.isSome:
|
||||
elif response.mediaGroupId.isSome:
|
||||
fileid = response.mediaGroupId.get
|
||||
|
||||
let filehash = generate_hash()
|
||||
|
|
Loading…
Reference in a new issue