{"id":21556951,"url":"https://github.com/everhard/telegram-bot-api","last_synced_at":"2025-10-24T17:32:30.794Z","repository":{"id":57059297,"uuid":"145241862","full_name":"Everhard/Telegram-Bot-API","owner":"Everhard","description":"Telegram Bot API written in PHP.","archived":false,"fork":false,"pushed_at":"2018-09-24T21:28:12.000Z","size":85,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-24T10:32:22.889Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","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/Everhard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-18T18:03:13.000Z","updated_at":"2024-08-12T16:03:55.000Z","dependencies_parsed_at":"2022-08-24T07:40:07.040Z","dependency_job_id":null,"html_url":"https://github.com/Everhard/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/Everhard%2FTelegram-Bot-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Everhard%2FTelegram-Bot-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Everhard%2FTelegram-Bot-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Everhard%2FTelegram-Bot-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Everhard","download_url":"https://codeload.github.com/Everhard/Telegram-Bot-API/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244147802,"owners_count":20406056,"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":[],"created_at":"2024-11-24T08:10:27.108Z","updated_at":"2025-10-24T17:32:29.673Z","avatar_url":"https://github.com/Everhard.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Telegram Bot API\n\n[![Latest Stable Version](https://poser.pugx.org/steadfast/telegram-bot-api/v/stable)](https://packagist.org/packages/steadfast/telegram-bot-api)\n[![Total Downloads](https://poser.pugx.org/steadfast/telegram-bot-api/downloads)](https://packagist.org/packages/steadfast/telegram-bot-api)\n[![License](https://poser.pugx.org/steadfast/telegram-bot-api/license)](https://packagist.org/packages/steadfast/telegram-bot-api)\n\n\nAn extended native [Telegram Bot API](https://core.telegram.org/bots/api) in PHP without requirements. Supports all methods and types of responses.\n\n## Installation\n\n``` bash\ncomposer require steadfast/telegram-bot-api\n```\n\n## Client usage\n\nHow to send message:\n``` php\nuse TelegramBot\\Api\\BotApi;\n\n$bot = new BotApi($bot_api_token);\n\n$bot-\u003esendMessage($chat_id, $message_text);\n```\n\n## Server usage\n\nTo handle commands:\n``` php\nuse TelegramBot\\Api\\Client;\n\n$bot = new Client($bot_api_token);\n\n$bot-\u003ecommand('ping', function ($message) use ($bot) {\n    $bot-\u003esendMessage($message-\u003egetChat()-\u003egetId(), 'pong!');\n});\n```\n\nTo handle an event when the bot was added to a group:\n``` php\nuse TelegramBot\\Api\\Client;\n\n$bot = new Client($bot_api_token);\n\n$bot-\u003ewasAddedToAGroup(function ($message) use ($bot) {\n    $bot-\u003esendMessage($message-\u003egetChat()-\u003egetId(), \"Let's welcome our new member!\");\n});\n```\n\nTo handle an event when the bot was removed from a group:\n``` php\nuse TelegramBot\\Api\\Client;\n\n$bot = new Client($bot_api_token);\n\n$bot-\u003ewasRemovedFromAGroup(function ($message) use ($bot) {\n    $bot-\u003esendMessage($message-\u003egetChat()-\u003egetId(), \"Say goodbye to our friend!\");\n});\n```\n\nTo handle any events:\n``` php\nuse TelegramBot\\Api\\Client;\n\n$bot = new Client($bot_api_token);\n\n$bot-\u003eon(function ($update) {\n    echo $update-\u003egetUpdateId();\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feverhard%2Ftelegram-bot-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feverhard%2Ftelegram-bot-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feverhard%2Ftelegram-bot-api/lists"}