|
5 | 5 |
|
6 | 6 | ## Installation
|
7 | 7 |
|
8 |
| -Via Composer |
| 8 | +Install this package through Composer. Run this command in your project's terminal: |
9 | 9 |
|
10 | 10 | ``` bash
|
11 |
| -$ composer require php-telegram-bot/laravel |
| 11 | +composer require php-telegram-bot/laravel |
12 | 12 | ```
|
13 |
| - |
14 | 13 | ## Usage
|
| 14 | +For further basic configuration of this Laravel package you do not need to create any configuration files. |
| 15 | + |
| 16 | +Artisan terminal commands for the Webhook usage (remember, that you need an HTTPS server for it): |
| 17 | +``` bash |
| 18 | +# Use this method to specify a url and receive incoming updates via an outgoing webhook |
| 19 | +php artisan telegram:set-webhook |
| 20 | +# List of available options: |
| 21 | +# --d|drop-pending-updates : Drop all pending updates |
| 22 | +# --a|all-update-types : Explicitly allow all updates (including "chat_member") |
| 23 | +# --allowed-updates= : Define allowed updates (comma-seperated) |
| 24 | + |
| 25 | +# Use this method to remove webhook integration if you decide to switch back to getUpdates |
| 26 | +php artisan telegram:delete-webhook |
| 27 | +# List of available options: |
| 28 | +# --d|drop-pending-updates : Pass to drop all pending updates |
| 29 | +``` |
| 30 | +Artisan terminal commands for the Telegram getUpdates method: |
| 31 | +``` bash |
| 32 | +# Fetches Telegram updates periodically |
| 33 | +php artisan telegram:fetch |
| 34 | +# List of available options: |
| 35 | +# --a|all-update-types : Explicitly allow all updates (including "chat_member") |
| 36 | +# --allowed-updates= : Define allowed updates (comma-seperated) |
| 37 | +``` |
| 38 | +Artisan terminal command for Telegram Server logging out: |
| 39 | +``` bash |
| 40 | +# Sends a logout to the currently registered Telegram Server |
| 41 | +php artisan telegram:logout |
| 42 | +``` |
| 43 | +Artisan terminal command for closing Telegram Server: |
| 44 | +``` bash |
| 45 | +# Sends a close to the currently registered Telegram Server |
| 46 | +php artisan telegram:close |
| 47 | +``` |
| 48 | +Artisan terminal command for publishing Telegram command folder structure in your project: |
| 49 | +``` bash |
| 50 | +# Publishes folder structure for Telegram Commands |
| 51 | +# Default StartCommand class will be created |
| 52 | +php artisan telegram:publish |
| 53 | +``` |
| 54 | +Artisan terminal command for creating new Telegram command class in your project: |
| 55 | +``` bash |
| 56 | +# Create a new Telegram Bot Command class |
| 57 | +# e.g. php artisan make:telegram-command Menu --> will make User command class MenuCommand |
| 58 | +# e.g. php artisan make:telegram-command Genericmessage --system --> will make System command class GenericmessageCommand |
| 59 | +php artisan make:telegram-command |
| 60 | +# List of available options: |
| 61 | +# name : Name of the Telegram Command |
| 62 | +# --a|admin : Generate a AdminCommand |
| 63 | +# --s|system : Generate a SystemCommand |
| 64 | +# Without admin or system option default User command will be created |
| 65 | +``` |
| 66 | + |
| 67 | + |
15 | 68 |
|
16 | 69 | ## Credits
|
17 | 70 |
|
|
0 commit comments