diff --git a/RECIPES.md b/RECIPES.md index ec5a750e..f1cbe819 100644 --- a/RECIPES.md +++ b/RECIPES.md @@ -29,6 +29,7 @@ Additional recipes can be found on the [Main Recipes Repository](https://github. | [ambient-link/ability-sdk](https://packagist.org/packages/ambient-link/ability-sdk) | [1.0](ambient-link/ability-sdk/1.0) | | [andchir/omnipay-bundle](https://packagist.org/packages/andchir/omnipay-bundle) | [1.0](andchir/omnipay-bundle/1.0) | | [andchir/shopkeeper4-comments](https://packagist.org/packages/andchir/shopkeeper4-comments) | [1.0](andchir/shopkeeper4-comments/1.0) | +| [andrew-gos/telegram-bot-bundle](https://packagist.org/packages/andrew-gos/telegram-bot-bundle) | [1.0](andrew-gos/telegram-bot-bundle/1.0) | | [anezi/locale-extension](https://packagist.org/packages/anezi/locale-extension) | [1.0](anezi/locale-extension/1.0) | | [antishov/doctrine-extensions-bundle](https://packagist.org/packages/antishov/doctrine-extensions-bundle) | [1.4](antishov/doctrine-extensions-bundle/1.4) | | [anyx/login-gate-bundle](https://packagist.org/packages/anyx/login-gate-bundle) | [1.0](anyx/login-gate-bundle/1.0) | diff --git a/andrew-gos.telegram-bot-bundle.1.0.json b/andrew-gos.telegram-bot-bundle.1.0.json new file mode 100644 index 00000000..d4df1b7c --- /dev/null +++ b/andrew-gos.telegram-bot-bundle.1.0.json @@ -0,0 +1,97 @@ +{ + "manifests": { + "andrew-gos/telegram-bot-bundle": { + "manifest": { + "bundles": { + "AndrewGos\\TelegramBotBundle\\AndrewGosTelegramBotBundle": [ + "all" + ] + }, + "copy-from-recipe": { + "config/": "%CONFIG_DIR%/" + } + }, + "files": { + "config/packages/andrew_gos_telegram_bot.yaml": { + "contents": [ + "# -----------------------------------------------------------------------------", + "# AndrewGos Telegram Bot Bundle - Default Configuration", + "# -----------------------------------------------------------------------------", + "# This file was generated by the AndrewGos Telegram Bot Bundle recipe.", + "# It provides a solid foundation for your first Telegram bot.", + "#", + "# \u2757\ufe0f YOUR NEXT STEPS:", + "# 1. Set your bot's token in the .env file:", + "# TELEGRAM_BOT_TOKEN=\"123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11\"", + "#", + "# 2. Create the handler and checker classes referenced below, for example:", + "# src/Telegram/Handler/StartHandler.php", + "# src/Telegram/Checker/CommandChecker.php", + "# src/Telegram/Handler/DefaultMessageHandler.php", + "# -----------------------------------------------------------------------------", + "", + "andrew_gos_telegram_bot:", + " bots:", + " # \ud83e\udd16 This is the unique name for your bot.", + " # You'll use this name in console commands, e.g., `php bin/console andrew-gos:telegram-bot:listen default_bot`", + " # default_bot:", + " # \ud83c\udfed The factory defines how the Telegram API client is created.", + " # factory:", + " # 'getUpdates' is a shortcut for the long-polling factory. It's perfect for", + " # getting started quickly with the `listen` command.", + " # For production, you will likely switch to webhooks using the 'default' factory.", + " # method: 'getUpdates'", + " # arguments:", + " # \u2705 Best Practice: Never hardcode secrets!", + " # This reads the token from your .env file.", + " # $token: '%env(string:TELEGRAM_BOT_TOKEN)%'", + "", + " # \ud83d\udd0c Plugins are services that run on EVERY update before handlers.", + " # They are great for logging, analytics, or session management.", + " # Uncomment this section to enable a request logger.", + " # plugins:", + " # - class: App\\Telegram\\Plugin\\RequestLoggerPlugin", + " # arguments:", + " # # This injects the default Symfony logger for the 'telegram' channel.", + " # $logger: '@monolog.logger.telegram'", + "", + " # \ud83d\udd04 Handlers contain the core logic of your bot.", + " # They are checked in order of priority (higher numbers first).", + " # The first handler whose 'checker' passes will be executed.", + " # handlers:", + " # Handler for the '/start' command. It has a high priority.", + " # -", + " # The checker decides if the handler should run for the current update.", + " # checker:", + " # class: App\\Telegram\\Checker\\CommandChecker", + " # arguments:", + " # $command: '/start'", + "", + " # The handler contains the actual logic to execute.", + " # handler: App.Telegram.Handler.StartHandler", + "", + " # Middlewares run after the checker but before the handler.", + " # Useful for authentication, rate limiting, etc.", + " # middlewares:", + " # - App\\Telegram\\Middleware\\UserRateLimiterMiddleware", + "", + " # Higher priority means this handler is checked before others.", + " # priority: 10", + "", + " # A fallback handler for any message not caught by the handlers above.", + " # When a 'checker' is not specified, it defaults to `AnyChecker`,", + " # -", + " # which always passes. This makes it a perfect \"catch-all\".", + " # handler: App\\Telegram\\Handler\\DefaultMessageHandler", + "", + " # A negative priority ensures this runs last.", + " # priority: -10", + "" + ], + "executable": false + } + }, + "ref": "1866f96fbf233b166ba4ed3a5f085e3a64f1efe0" + } + } +} diff --git a/archived/andrew-gos.telegram-bot-bundle/1866f96fbf233b166ba4ed3a5f085e3a64f1efe0.json b/archived/andrew-gos.telegram-bot-bundle/1866f96fbf233b166ba4ed3a5f085e3a64f1efe0.json new file mode 100644 index 00000000..d4df1b7c --- /dev/null +++ b/archived/andrew-gos.telegram-bot-bundle/1866f96fbf233b166ba4ed3a5f085e3a64f1efe0.json @@ -0,0 +1,97 @@ +{ + "manifests": { + "andrew-gos/telegram-bot-bundle": { + "manifest": { + "bundles": { + "AndrewGos\\TelegramBotBundle\\AndrewGosTelegramBotBundle": [ + "all" + ] + }, + "copy-from-recipe": { + "config/": "%CONFIG_DIR%/" + } + }, + "files": { + "config/packages/andrew_gos_telegram_bot.yaml": { + "contents": [ + "# -----------------------------------------------------------------------------", + "# AndrewGos Telegram Bot Bundle - Default Configuration", + "# -----------------------------------------------------------------------------", + "# This file was generated by the AndrewGos Telegram Bot Bundle recipe.", + "# It provides a solid foundation for your first Telegram bot.", + "#", + "# \u2757\ufe0f YOUR NEXT STEPS:", + "# 1. Set your bot's token in the .env file:", + "# TELEGRAM_BOT_TOKEN=\"123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11\"", + "#", + "# 2. Create the handler and checker classes referenced below, for example:", + "# src/Telegram/Handler/StartHandler.php", + "# src/Telegram/Checker/CommandChecker.php", + "# src/Telegram/Handler/DefaultMessageHandler.php", + "# -----------------------------------------------------------------------------", + "", + "andrew_gos_telegram_bot:", + " bots:", + " # \ud83e\udd16 This is the unique name for your bot.", + " # You'll use this name in console commands, e.g., `php bin/console andrew-gos:telegram-bot:listen default_bot`", + " # default_bot:", + " # \ud83c\udfed The factory defines how the Telegram API client is created.", + " # factory:", + " # 'getUpdates' is a shortcut for the long-polling factory. It's perfect for", + " # getting started quickly with the `listen` command.", + " # For production, you will likely switch to webhooks using the 'default' factory.", + " # method: 'getUpdates'", + " # arguments:", + " # \u2705 Best Practice: Never hardcode secrets!", + " # This reads the token from your .env file.", + " # $token: '%env(string:TELEGRAM_BOT_TOKEN)%'", + "", + " # \ud83d\udd0c Plugins are services that run on EVERY update before handlers.", + " # They are great for logging, analytics, or session management.", + " # Uncomment this section to enable a request logger.", + " # plugins:", + " # - class: App\\Telegram\\Plugin\\RequestLoggerPlugin", + " # arguments:", + " # # This injects the default Symfony logger for the 'telegram' channel.", + " # $logger: '@monolog.logger.telegram'", + "", + " # \ud83d\udd04 Handlers contain the core logic of your bot.", + " # They are checked in order of priority (higher numbers first).", + " # The first handler whose 'checker' passes will be executed.", + " # handlers:", + " # Handler for the '/start' command. It has a high priority.", + " # -", + " # The checker decides if the handler should run for the current update.", + " # checker:", + " # class: App\\Telegram\\Checker\\CommandChecker", + " # arguments:", + " # $command: '/start'", + "", + " # The handler contains the actual logic to execute.", + " # handler: App.Telegram.Handler.StartHandler", + "", + " # Middlewares run after the checker but before the handler.", + " # Useful for authentication, rate limiting, etc.", + " # middlewares:", + " # - App\\Telegram\\Middleware\\UserRateLimiterMiddleware", + "", + " # Higher priority means this handler is checked before others.", + " # priority: 10", + "", + " # A fallback handler for any message not caught by the handlers above.", + " # When a 'checker' is not specified, it defaults to `AnyChecker`,", + " # -", + " # which always passes. This makes it a perfect \"catch-all\".", + " # handler: App\\Telegram\\Handler\\DefaultMessageHandler", + "", + " # A negative priority ensures this runs last.", + " # priority: -10", + "" + ], + "executable": false + } + }, + "ref": "1866f96fbf233b166ba4ed3a5f085e3a64f1efe0" + } + } +} diff --git a/index.json b/index.json index 183971b1..af660249 100644 --- a/index.json +++ b/index.json @@ -79,6 +79,9 @@ "andchir/shopkeeper4-comments": [ "1.0" ], + "andrew-gos/telegram-bot-bundle": [ + "1.0" + ], "anezi/locale-extension": [ "1.0" ],