{"id":13896336,"url":"https://github.com/yangm97/lua-telegram-bot-api","last_synced_at":"2026-01-19T03:06:22.055Z","repository":{"id":82335758,"uuid":"95424967","full_name":"yangm97/lua-telegram-bot-api","owner":"yangm97","description":"Telegram Bot API bindings and utilities","archived":false,"fork":false,"pushed_at":"2019-06-09T10:42:50.000Z","size":51,"stargazers_count":17,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-07T18:39:24.207Z","etag":null,"topics":["lua","openresty","telegram","telegram-api","telegram-bot","telegram-bot-api"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yangm97.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-06-26T08:25:02.000Z","updated_at":"2023-12-23T10:27:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"1a8474ec-e5a7-4577-b5fd-0f15953466e9","html_url":"https://github.com/yangm97/lua-telegram-bot-api","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yangm97%2Flua-telegram-bot-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yangm97%2Flua-telegram-bot-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yangm97%2Flua-telegram-bot-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yangm97%2Flua-telegram-bot-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yangm97","download_url":"https://codeload.github.com/yangm97/lua-telegram-bot-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226265521,"owners_count":17597222,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lua","openresty","telegram","telegram-api","telegram-bot","telegram-bot-api"],"created_at":"2024-08-06T18:02:50.777Z","updated_at":"2026-01-19T03:06:22.049Z","avatar_url":"https://github.com/yangm97.png","language":"Lua","readme":"# Lua Telegram Bot API\nThis package provides API bindings and utilities for developing Telegram Bots. Contains bindings for all Bot API 3.5 methods. Supports both OpenResty and plain lua.\n\n## Usage\n\nYou can call methods using either positional arguments or by sending a single body table, either way the table is serialized as JSON and the request is sent. On return, the json response is deserialized for you, if the request was successful, you will receive the `.result` as a lua table, if something goes wrong, you will receive `nil` and the whole error table.\n\n## Example\n\nUsing positional arguments:\n\n```\nlocal Methods = require(\"telegram-bot-api.methods\")\n\nlocal api = Methods:new(\"123456789:ABCDefGhw3gUmZOq36-D_46_AMwGBsfefbcQ\")\n\nlocal ok, err = api.sendMessage(12345678, \"\u003cb\u003eHello World\u003c/b\u003e\", \"html\")\n\nif not ok then\n  print(\"Error while sending message: \"..err.description)\nend\n```\n\nUsing body table (snake_case is supported too!):\n\n```\nlocal api = require(\"telegram-bot-api.methods\"):new(\"123456789:ABCDefGhw3gUmZOq36-D_46_AMwGBsfefbcQ\")\n\nlocal ok, err = api.send_message{\n  chat_id = 12345678,\n  text = \"Hello World\",\n  parse_mode = \"html\"\n  }\n\nif not ok then\n  print(\"Error while sending message: \"..err.description)\nend\n```\n\n## Customizing\n\nYou can also set a custom set a custom server as the second init argument, and call custom methods, like this:\n\n```\nlocal Methods = require(\"telegram-bot-api.methods\")\n\nlocal api = Methods:new({\n  token = \"123456789:ABCDefGhw3gUmZOq36-D_46_AMwGBsfefbcQ\",\n  server=\"api.pwrtelegram.xyz\"\n})\n\nlocal ok, err = api.phoneLogin{phone=\"+3984748839\"}\n\nif not ok then\n  print(\"Error while using phoneLogin: \"..err.description)\nend\n```\n\n## Finishing lines\n\nBoth argument names and variable positioning try to mirror Telegram documentation as closely as possible, but you may prefer using `lib/telegram-bot-api/methods.lua` as a reference. The library will also try to warn you regarding missing required arguments before making a request.\n","funding_links":[],"categories":["Lua"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyangm97%2Flua-telegram-bot-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyangm97%2Flua-telegram-bot-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyangm97%2Flua-telegram-bot-api/lists"}