开源软件名称(OpenSource Name):php-telegram-bot/laravel开源软件地址(OpenSource Url):https://github.com/php-telegram-bot/laravel开源编程语言(OpenSource Language):PHP 100.0%开源软件介绍(OpenSource Introduction):Telegram Bot Package for Laravel 6.x, 7.x, and 8.xThis package helps easily integrate PHP Telegram Bot library in Laravel application. Table of ContentsInstallationInstall this package through Composer. Edit your project's Create composer.json file: {
"name": "yourproject/yourproject",
"type": "project",
"require": {
"php-telegram-bot/laravel": "^1.0"
}
} And run composer update Or run a command in your command line:
Copy the package config and migrations to your project with the publish command:
After run migration command
In the config you have to specify Telegram API KEY UsageYou can inject For example: <?php
namespace App\Http\Controllers;
use PhpTelegramBot\Laravel\PhpTelegramBotContract;
class CustomController extends Controller
{
public function handle(PhpTelegramBotContract $telegramBot)
{
// Call handle method
$telegramBot->handle();
// Or set webhook
$hookUrl = 'https://hook.url';
$telegramBot->setWebhook($hookUrl);
// Or handle telegram getUpdates request
$telegramBot->handleGetUpdates();
}
} More details about usage you can see on the PHP Telegram Bot docs: https://github.com/php-telegram-bot/core#instructions TODOwrite more tests TroubleshootingIf you like living on the edge, please report any bugs you find on the php-telegram-bot/laravel issues page. ContributingPull requests are welcome. See CONTRIBUTING.md for information. LicensePlease see the LICENSE included in this repository for a full copy of the MIT license, which this project is licensed under. CreditsFull credit list in CREDITS |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论