mateodioev/tgbot 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mateodioev/tgbot

Composer 安装命令:

composer require mateodioev/tgbot

包简介

Libreria para interactuar con los metodos de la api de bots de telegram

README 文档

README

Install

composer require mateodioev/tgbot
git clone https://github.com/Mateodioev/tgbot

First step

require __DIR__ . 'path/to/vendor/autoload.php';

Create new Api instance

use Mateodioev\Bots\Telegram\Api;

$api = new Api($bot_token);

Send method to telegram api

use Mateodioev\Bots\Telegram\Types\Message;

$message = $api->sendMessage('chat_id', 'Text', $others_params);

var_dump($message->get());
var_dump($message instanceof Message::class);

Enable async mode

Note: This use amphp/http-client

$api->setAsync(true);

Create new telegram types

use Mateodioev\Bots\Telegram\Types\baseType;

class MyCustomType extends baseType
{
    protected array $fields = [
        'field1' => 'valueType',
        'id'     => 'integer', // only accept integer values
        'user'   => User::class, // only accept arrays or instances of the User class
    ];
}

Create new instance

// from array
$customType = MyCustomType::createFromArray(['field1' => 'Type', 'id' => 1111, 'user' => $user]);
// From stdClass
$customType = MyCustomType::create((object) ['field1' => 'Type', 'id' => 1111, 'user' => $user]);
// Create from constructor
$customType = new MyCustomType(field1: 'Type', id: 1111, user: $user); // maybe this cause linter errors

统计信息

  • 总下载量: 463
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 4
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 2
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-06-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固