ba0f3 / telebot.nim

Async Telegram Bot API Client implement in @Nim-Lang
MIT License
165 stars 24 forks source link

Exception message: key not found: icon_custom_emoji_id #84

Closed inv2004 closed 1 year ago

inv2004 commented 1 year ago

Thank you for the package. I was trying to use with the pretty new functionality of topics in telegram, but receives the error:

let resp = waitFor bot.createForumTopic(chatId, "topic1")
discard waitFor bot.sendMessage(chatId, "text1", resp.messageThreadId)
...
  /home/u/.choosenim/toolchains/nim-1.6.12/lib/pure/asyncdispatch.nim(1961)     waitFor
  /home/u/.choosenim/toolchains/nim-1.6.12/lib/pure/asyncdispatch.nim(1653)     poll
  /home/u/.choosenim/toolchains/nim-1.6.12/lib/pure/asyncdispatch.nim(1394)     runOnce
  /home/u/.choosenim/toolchains/nim-1.6.12/lib/pure/asyncdispatch.nim(234)      processPendingCallbacks
  /home/u/.choosenim/toolchains/nim-1.6.12/lib/pure/asyncmacro.nim(28)          sendMessageNimAsyncContinue
  /home/u/.nimble/pkgs/telebot-2023.03.23/telebot/private/api.nim(7)            sendMessageIter
  /home/u/.nimble/pkgs/telebot-2023.03.23/telebot/private/utils.nim(139)        unmarshal
  /home/u/.nimble/pkgs/telebot-2023.03.23/telebot/private/utils.nim(212)        toOption
  /home/u/.nimble/pkgs/telebot-2023.03.23/telebot/private/utils.nim(145)        unmarshal
  /home/u/.nimble/pkgs/telebot-2023.03.23/telebot/private/utils.nim(139)        unmarshal
  /home/u/.nimble/pkgs/telebot-2023.03.23/telebot/private/utils.nim(212)        toOption
  /home/u/.nimble/pkgs/telebot-2023.03.23/telebot/private/utils.nim(141)        unmarshal
  /home/u/.choosenim/toolchains/nim-1.6.12/lib/pure/json.nim(517)               []
  /home/u/.choosenim/toolchains/nim-1.6.12/lib/pure/collections/tables.nim(246) []
  /home/u/.choosenim/toolchains/nim-1.6.12/lib/pure/collections/tables.nim(234) raiseKeyError
Exception message: key not found: icon_custom_emoji_id

The only mention I found in API is

The parameters name and icon_custom_emoji_id of the method [editForumTopic](https://core.telegram.org/bots/api#editforumtopic) are now optional. If they are omitted, the existing values are kept`

But it was in 6.4, looks like you are already 6.6