Skip to content

Commit fd5a19b

Browse files
committed
Bot API 6.8
1 parent 7b512cb commit fd5a19b

File tree

3 files changed

+23
-7
lines changed

3 files changed

+23
-7
lines changed

src/telebot/private/api.nim

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ proc banChatSenderChat*(b: TeleBot, chatId: ChatId, senderChatId: int, untilDate
299299

300300
proc unbanChatSenderChat*(b: TeleBot, chatId: ChatId, senderChatId: int): Future[bool] {.api, async.}
301301

302-
proc getUpdates*(b: TeleBot, offset, limit = 0, timeout = 50, allowedUpdates: seq[string] = @[]): Future[JsonNode] {.async.} =
302+
proc getUpdates*(b: TeleBot, offset = 0, limit = 0, timeout = 50, allowedUpdates: seq[string] = @[]): Future[JsonNode] {.async.} =
303303
var data = newMultipartData()
304304

305305
if offset > 0:
@@ -347,7 +347,7 @@ proc cleanUpdates*(b: TeleBot) {.async.} =
347347
while updates.len >= 100:
348348
updates = await b.getUpdates()
349349

350-
proc loop(b: TeleBot, timeout = 50, offset, limit = 0) {.async.} =
350+
proc loop(b: TeleBot, timeout = 50, offset = 0, limit = 0) {.async.} =
351351
try:
352352
let me = waitFor b.getMe()
353353
b.id = me.id
@@ -366,12 +366,12 @@ proc loop(b: TeleBot, timeout = 50, offset, limit = 0) {.async.} =
366366
let update = unmarshal(item, Update)
367367
asyncCheck b.handleUpdate(update)
368368

369-
proc poll*(b: TeleBot, timeout = 50, offset, limit = 0, clean = false) =
369+
proc poll*(b: TeleBot, timeout = 50, offset = 0, limit = 0, clean = false) =
370370
if clean:
371371
waitFor b.cleanUpdates()
372372
waitFor loop(b, timeout, offset, limit)
373373

374-
proc pollAsync*(b: TeleBot, timeout = 50, offset, limit = 0, clean = false) {.async.} =
374+
proc pollAsync*(b: TeleBot, timeout = 50, offset = 0, limit = 0, clean = false) {.async.} =
375375
if clean:
376376
await b.cleanUpdates()
377377
await loop(b, timeout, offset, limit)
@@ -415,3 +415,5 @@ proc reopenGeneralForumTopic*(b: TeleBot, chatId: ChatId): Future[bool] {.api, a
415415
proc hideGeneralForumTopic*(b: TeleBot, chatId: ChatId): Future[bool] {.api, async.}
416416

417417
proc unhideGeneralForumTopic*(b: TeleBot, chatId: ChatId): Future[bool] {.api, async.}
418+
419+
proc unpinAllGeneralForumTopicMessages*(b: TeleBot, chatId: ChatId): Future[bool] {.api, async.}

src/telebot/private/types.nim

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ type
7171
isForum*:Option[bool]
7272
photo*: Option[ChatPhoto]
7373
activeUsernames*: Option[seq[string]]
74-
emojiStatusCustomEmojiId: Option[string]
74+
emojiStatusCustomEmojiId*: Option[string]
75+
emojiStatusExpirationDate*: Option[int]
7576
bio*: Option[string]
7677
hasPrivateForwards*: Option[bool]
7778
joinToSendMessages*: Option[bool]
@@ -116,6 +117,17 @@ type
116117
mimeType*: Option[string]
117118
fileSize*: Option[int]
118119

120+
Story* = object of TelegramObject
121+
fileId*: string
122+
fileUniqueId*: string
123+
width*: int
124+
height*: int
125+
duration*: int
126+
thumbnail*: Option[PhotoSize]
127+
fileName*: Option[string]
128+
mimeType*: Option[string]
129+
fileSize*: Option[int]
130+
119131
Sticker* = object of TelegramObject
120132
fileId*: string
121133
fileUniqueId*: string
@@ -209,7 +221,8 @@ type
209221

210222
PollAnswer* = object of TelegramObject
211223
pollId*: string
212-
user*: User
224+
voterChat*: Option[Chat]
225+
user*: Option[User]
213226
optionIds*: seq[int]
214227

215228
Poll* = object of TelegramObject
@@ -422,6 +435,7 @@ type
422435
document*: Option[Document]
423436
photo*: Option[seq[PhotoSize]]
424437
sticker*: Option[Sticker]
438+
story*: Option[Story]
425439
video*: Option[Video]
426440
videoNote*: Option[VideoNote]
427441
voice*: Option[Voice]

telebot.nimble

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

0 commit comments

Comments
 (0)