yangm97 / lua-telegram-bot-api

Telegram Bot API bindings and utilities
MIT License
17 stars 2 forks source link

json error #3

Open xerox-xeon opened 5 years ago

xerox-xeon commented 5 years ago

oroutine 0: [C]: in function 'encode' ...local/openresty/site/lualib/telegram-bot-api/methods.lua:35: in function 'new' /usr/local/openresty/nginx/telegram.lua:3: in main chunk, client: x.x.x.x.x, server: localhost, request: "POST /telegram HTTP/1.1", host: "x.x.x.x.x" 2019/06/12 10:48:42 [error] 1299#1299: *3504 lua entry thread aborted: runtime error: ...local/openresty/site/lualib/telegram-bot-api/methods.lua:35: Cannot serialise function: type not supported stack traceback:

yangm97 commented 5 years ago

Please paste the code that generated this error.

goodprogrammist commented 4 years ago

Hello!

local api = require("telegram-bot-api.methods"):new("***")

local ok, err = api.send_message{
  chat_id = ***,
  text = "Hello World",
  parse_mode = "html"
  }

if not ok then
  print("Error while sending message: "..err.description)
end

This code (exact from example gives me the same error)

I'm using docker image:

FROM openresty/openresty:buster-fat RUN opm get yangm97/lua-telegram-bot-api