ba0f3 / telebot.nim

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

Error when compiling Echo Bot example #75

Closed snowcat404 closed 2 years ago

snowcat404 commented 2 years ago

Code Used: https://github.com/ba0f3/telebot.nim#echo-bot

Command Used: nim c -d:ssl echo.nim

Output:

C:\Users\User\Desktop\Nim\echo.nim(140, 4) Error: type mismatch: got <TeleBot, proc (b: TeleBot, u: Update):
Future[system.bool]{.locks: <unknown>.}>
but expected one of:
proc onUpdate(b: TeleBot; cb: UpdateCallback)
  first type mismatch at position: 2
  required type for cb: UpdateCallback
  but expression 'updateHandler' is of type: proc (b: TeleBot, u: Update): Future[system.bool]{.locks: <unknown>.}
  Pragma mismatch: got '{..}', but expected '{.gcsafe.}'.
  This expression is not GC-safe. Annotate the proc with {.gcsafe.} to get extended error information.
ba0f3 commented 2 years ago

Did you solve this problem yourself?