PHPackages                             ericgu178/telegram-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. ericgu178/telegram-api

ActiveLibrary

ericgu178/telegram-api
======================

封转的电报群机器人api

0.3(4y ago)019PHPPHP &gt;=5.6.0

Since Mar 23Pushed 4y ago1 watchersCompare

[ Source](https://github.com/ericgu178/TelegramApi)[ Packagist](https://packagist.org/packages/ericgu178/telegram-api)[ RSS](/packages/ericgu178-telegram-api/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (3)Used By (0)

 TelegramApi
=============

[](#----telegramapi)

清单
--

[](#清单)

- [安装](#%E5%AE%89%E8%A3%85)
- [关于](#%E5%85%B3%E4%BA%8E)
- [使用](#%E4%BD%BF%E7%94%A8)
- [接口](#%E6%8E%A5%E5%8F%A3)
    - [Message](#Message)

安装
--

[](#安装)

使用下面的命令安装

```
composer require ericgu178/telegram-api
```

在 php 文件中 使用

```
use TelgramApi/Telegram
```

关于
--

[](#关于)

这是目前我自用封装的电报api代码，仅仅涉及到了Message这块api的发送并没有完全适配完所有电报api，什么时间用到别的或者有bug会修改，其他的欢迎下载在基础上push代码，后续我也会完善的。

使用
--

[](#使用)

目前适用机器人（没测试别的） 需要给予管理权限

```
    $config = [
        'api_id'    =>  '', // api id
        'api_hash'  =>  '', // api hash
        'botToken'  =>  '', // @EricGU178Bot
        'chat_id'   =>  '@wechatGroupQrCode',
        'proxy' =>  '' //代理
    ];
    $telegram = Telegram::openPlatform($config);
    $res = $telegram->Message->sendMessage($text = 'Hello World');
    var_dump($res); // json 数据 去群组查看
```

接口
--

[](#接口)

目前 只有 /lib/OpenPlatform/Message/ 中三个方法 sendPhoto sendMessage sendGroupMedia sendAudio

### Message

[](#message)

使用 sendPhoto

```
    $res = $telegram->Message->sendPhoto(string $url,array $ext = []); // $ext 其他参数
    var_dump($res);
```

使用 sendGroupMedia

sendAudio

```
    $res = $telegram->Message->sendGroupMedia([
        [
            'type'  =>  'photo',
            'media' =>  'https://ww1.sinaimg.cn/large/6d28b716ly1goswssp7huj20s311cq87.jpg',
            'caption'   =>  '微博'
        ],
        [
            'type'  =>  'photo',
            'media' =>  'https://ww1.sinaimg.cn/large/6d28b716ly1goswssp7huj20s311cq87.jpg',
            'caption'   =>  'aaaa'
        ],
    ]); // $ext 其他参数
    var_dump($res);
```

使用 sendAudio

```
    $url = '网络地址 mp3 m4a 类型'
    $res = $telegram->Message->sendAudio(string $url,$ext); // $ext 其他参数
    var_dump($res);
```

###  Health Score

19

—

LowBetter than 12% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~28 days

Total

2

Last Release

1798d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/380965679cd95b4ae68c0a707e8b42a2e78ff4442a7dfe3aa84e4e0bd25127e7?d=identicon)[ericgu178](/maintainers/ericgu178)

---

Tags

phptelegramtelegramapi

### Embed Badge

![Health badge](/badges/ericgu178-telegram-api/health.svg)

```
[![Health](https://phpackages.com/badges/ericgu178-telegram-api/health.svg)](https://phpackages.com/packages/ericgu178-telegram-api)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
