php-telegram-bot/core — reverse-engineered prompt

Reverse engineered prompt

Build me a PHP library that makes it easy to create Telegram bots using the official Bot API. I want it to work on PHP 8.1 or newer, be installable with Composer, and support both webhooks and polling with getUpdates so people can choose either setup. It should cover normal messages, groups and supergroups, channels, inline bots, inline keyboards, file uploads and downloads, and a simple conversation flow for multi step chats.

Please make it extensible with built in commands plus custom commands, including admin only commands and basic channel management. It should also be able to store messages, inline queries, chosen inline queries, and chat data in MySQL, with utilities for database setup and logging. Include a small example bot, clear setup docs for creating a bot token and connecting it, and tests for the main behavior. If anything is unclear, look up the current Telegram Bot API docs online and keep the library aligned with that.

Want more depth? Deep Reverse