Skip to content

Commit 6db6881

Browse files
committed
Bot API 4.5
1 parent fcaa304 commit 6db6881

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

telebot.nimble

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
version = "0.6.9"
1+
version = "0.7.0"
22
author = "Huy Doan"
33
description = "Async Telegram Bot API Client"
44
license = "MIT"
55
skipDirs = @["examples"]
66

7-
requires "nim >= 0.19.9", "sam >= 0.1.10"
7+
requires "nim >= 1.0.4", "sam >= 0.1.10"

telebot/api.nim

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,15 @@ proc answerInlineQuery*[T](b: TeleBot, id: string, results: seq[T], cacheTime =
637637
let res = await makeRequest(b, endpoint % b.token, data)
638638
result = res.toBool
639639

640+
proc setChatAdministratorCustomTitle*(b: TeleBot, chatId: string, userId: int, customTitle: string): Future[bool] {.async.} =
641+
END_POINT("setChatAdministratorCustomTitle")
642+
var data = newMultipartData()
643+
data["chat_id"] = chatId
644+
data["user_id"] = $userId
645+
data["custom_title"] = customTitle
646+
let res = await makeRequest(b, endpoint % b.token, data)
647+
result = res.toBool
648+
640649
proc getUpdates*(b: TeleBot, offset, limit = 0, timeout = 50, allowedUpdates: seq[string] = @[]): Future[JsonNode] {.async.} =
641650
END_POINT("getUpdates")
642651
var data = newMultipartData()

telebot/types.nim

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,20 @@ type
4848
inviteLink*: Option[string]
4949
pinnedMessage*: Option[ref Message]
5050
permissions*: Option[ChatPermissions]
51+
slowModeDelay*: Option[int]
5152
stickerSetName*: Option[string]
5253
canSetStickerSet*: Option[bool]
5354

5455
PhotoSize* = object of TelegramObject
5556
fileId*: string
57+
fileUniqueId*: string
5658
width*: int
5759
height*: int
5860
fileSize*: Option[int]
5961

6062
Audio* = object of TelegramObject
6163
fileId*: string
64+
fileUniqueId*: string
6265
duration*: int
6366
performer*: Option[string]
6467
title*: Option[string]
@@ -68,13 +71,15 @@ type
6871

6972
Document* = object of TelegramObject
7073
fileId*: string
74+
fileUniqueId*: string
7175
thumb*: Option[PhotoSize]
7276
fileName*: Option[string]
7377
mimeType*: Option[string]
7478
fileSize*: Option[int]
7579

7680
Sticker* = object of TelegramObject
7781
fileId*: string
82+
fileUniqueId*: string
7883
width*: int
7984
height*: int
8085
isAnimated*: bool
@@ -99,6 +104,7 @@ type
99104

100105
Video* = object of TelegramObject
101106
fileId*: string
107+
fileUniqueId*: string
102108
width*: int
103109
height*: int
104110
duration*: int
@@ -108,12 +114,14 @@ type
108114

109115
Voice* = object of TelegramObject
110116
fileId*: string
117+
fileUniqueId*: string
111118
duration*: int
112119
mimeType*: Option[string]
113120
fileSize*: Option[int]
114121

115122
VideoNote* = object of TelegramObject
116123
fileId*: string
124+
fileUniqueId*: string
117125
length*: int
118126
duration*: int
119127
thumb*: Option[PhotoSize]
@@ -153,6 +161,7 @@ type
153161

154162
File* = object of TelegramObject
155163
fileId*: string
164+
fileUniqueId*: string
156165
fileSize*: Option[int]
157166
filePath*: Option[string]
158167

@@ -264,11 +273,14 @@ type
264273

265274
ChatPhoto* = object of TelegramObject
266275
smallFileId*: string
276+
smallFileUniqueId*: string
267277
bigFileId*: string
278+
bigFileUniqueId*: string
268279

269280
ChatMember* = object of TelegramObject
270281
user*: User
271282
status*: string
283+
customTitle*: Option[string]
272284
untilDate*: Option[int]
273285
canBeEdited*: Option[bool]
274286
canPostMessages*: Option[bool]
@@ -318,6 +330,7 @@ type
318330
#------------------
319331
Animation* = object of TelegramObject
320332
fileId*: string
333+
fileUniqueId*: string
321334
thumb*: Option[PhotoSize]
322335
fileName*: Option[string]
323336
mimeType*: Option[string]
@@ -607,6 +620,7 @@ type
607620
#------------------
608621
PassportFile* = object of TelegramObject
609622
fileId*: string
623+
fileUniqueId*: string
610624
fileSize*: int
611625
fileDate*: int
612626

0 commit comments

Comments
 (0)