Skip to content

Commit 58ec6bc

Browse files
authored
Merge pull request #47 from greenfork/fix-addfile-multipart-syntax
Fix syntax for addFiles proc
2 parents 3567966 + 823be67 commit 58ec6bc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

telebot/api.nim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ proc setChatPhoto*(b: TeleBot, chatId: string, photo: string): Future[bool] {.as
273273
END_POINT("setChatPhoto")
274274
var data = newMultipartData()
275275
data["chat_id"] = chatId
276-
data.addFiles({"name": "photo", "file": photo})
276+
data.addFiles({"photo": photo})
277277
let res = await makeRequest(b, endpoint % b.token, data)
278278
result = res.toBool
279279

@@ -367,7 +367,7 @@ proc uploadStickerFile*(b: TeleBot, userId: int, pngSticker: string): Future[typ
367367
END_POINT("uploadStickerFile")
368368
var data = newMultipartData()
369369
data["user_id"] = $userId
370-
data.addFiles({"name": "png_sticker", "file": pngSticker})
370+
data.addFiles({"png_sticker": pngSticker})
371371
let res = await makeRequest(b, endpoint % b.token, data)
372372
result = unmarshal(res, types.File)
373373

@@ -377,7 +377,7 @@ proc createNewStickerSet*(b: TeleBot, userId: int, name: string, title: string,
377377
data["user_id"] = $userId
378378
data["name"] = name
379379
data["title"] = title
380-
data.addFiles({"name": "png_sticker", "file": pngSticker})
380+
data.addFiles({"png_sticker": pngSticker})
381381
data["emojis"] = emojis
382382
if containsMasks:
383383
data["contains_masks"] = "true"
@@ -393,7 +393,7 @@ proc addStickerToSet*(b: TeleBot, userId: int, name: string, pngSticker: string,
393393
var data = newMultipartData()
394394
data["user_id"] = $userId
395395
data["name"] = name
396-
data.addFiles({"name": "png_sticker", "file": pngSticker})
396+
data.addFiles({"png_sticker": pngSticker})
397397
data["emojis"] = emojis
398398
if maskPosition.isSome():
399399
var tmp = ""

0 commit comments

Comments
 (0)