Skip to content

Commit 022575f

Browse files
committed
Multiple fixes for Nim 0.19.4, closes #28
1 parent aadb0c6 commit 022575f

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

telebot.nimble

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = "0.5.7.3"
1+
version = "0.5.7.4"
22
author = "Huy Doan"
33
description = "Async Telegram Bot API Client"
44
license = "MIT"

telebot/types.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,8 +591,8 @@ type
591591
secret*: string
592592

593593
PassportData* = object of TelegramObject
594-
data: seq[EncryptedPassportElement]
595-
credentials: EncryptedCredentials
594+
data*: seq[EncryptedPassportElement]
595+
credentials*: EncryptedCredentials
596596

597597
PassportElementError = ref object of TelegramObject
598598
source*: string

telebot/utils.nim

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ proc getCommands*(update: Update): StringTableRef =
2727
var entities = message.entities.get()
2828
for entity in entities:
2929
if entity.kind == "bot_command":
30-
var
30+
var
3131
messageText = message.text.get()
3232
offset = entity.offset
3333
length = entity.length
@@ -236,13 +236,14 @@ macro genInputMedia*(mediaType: untyped): untyped =
236236

237237
result = quote do:
238238
proc `funcName`*(media: string; caption=""; parseMode=""): `objName` =
239-
new(result)
240-
result.kind = `kind`
241-
result.media = media
239+
var inputMedia = new(`objName`)
240+
inputMedia.kind = `kind`
241+
inputMedia.media = media
242242
if caption.len > 0:
243-
result.caption = some(caption)
243+
inputMedia.caption = some(caption)
244244
if parseMode.len > 0:
245-
result.parseMode = some(parseMode)
245+
inputMedia.parseMode = some(parseMode)
246+
return inputMedia
246247

247248
macro magic*(head, body: untyped): untyped =
248249
result = newStmtList()

0 commit comments

Comments
 (0)