• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

php-telegram-bot/laravel: Laravel package for PHP Telegram Bot Library

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(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.x

Build Status Code Coverage Code Quality Latest Stable Version Total Downloads Downloads Month Minimum PHP Version License

This package helps easily integrate PHP Telegram Bot library in Laravel application.

Table of Contents

Installation

Install this package through Composer.

Edit your project's composer.json file to require php-telegram-bot/laravel

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:

composer require php-telegram-bot/laravel

Copy the package config and migrations to your project with the publish command:

php artisan vendor:publish --provider="PhpTelegramBot\Laravel\ServiceProvider"

After run migration command

php artisan migrate

In the config you have to specify Telegram API KEY

Usage

You can inject PhpTelegramBot\Laravel\PhpTelegramBotContract in anywhere and use bot instance

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

TODO

write more tests

Troubleshooting

If you like living on the edge, please report any bugs you find on the php-telegram-bot/laravel issues page.

Contributing

Pull requests are welcome. See CONTRIBUTING.md for information.

License

Please see the LICENSE included in this repository for a full copy of the MIT license, which this project is licensed under.

Credits

Full credit list in CREDITS




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap