bennetgallein/ts3ab-api
Composer 安装命令:
composer require bennetgallein/ts3ab-api
包简介
OOP API Wrapper for the TS3AudioBot WebAPI
README 文档
README
OOP API Wrapper for the TS3AudioBot WebAPI
This Wrapper is meant to make work with the TS3AudioBot WebAPI over PHP easier. It provides (in the future) all functions that the bot supports.
Warning: This is based on the development branch! Do not use funtions that are only available there or you'll encounter some bad errors!
Intention
This is more of a sideproject than a dedicated one, since I needed an easier way to communicate between a PHP-Backend with the Bot's API.
Installation
PHP Version Required: 7.1
Install view composer:
composer require bennetgallein/ts3ab-api
Get started
- Make a connection:
$bot = new \TS3AB\Ts3AudioBot("192.168.1.104", "3306");
- Authenticate
$bot->basicAuth("j+W41OpXcHv8In9vt/Q2x+UmUPs=:ts3ab:X38WCfV3srBQBYUYZVkMnpxyBPWlMxZs");
Read more about Authentication in the official Wiki.
- Select the correct bot. Since TS3AB allows multi-instances to run at the same time, you need to choose the context you want to work with.
var_dump($bot->getCommandExecutor()->list()); // lists all active bots $bot->getCommandExecutor()->use(0); // tells the API to use bot "0"
- Execute commands.
var_dump($bot->getCommandExecutor()->play("https://www.youtube.com/watch?v=xxxx"));
History
$history = $bot->getCommandExecutor()->history();
Adds the song with to the queue
$history->add(0);
Cleans up the history file for better startup performance.
$history->clean();
Cleans up the history file for better startup performance. Also checks for all links in the history which cannot be opened anymore.
$history->cleanRemovedefective();
Removes the entry with from the history.
$history->delete(0);
Gets the last songs from the user with the given ".
$history->historyFrom(10, <userid>);
Displays all saved informations about the song with (also can be last|next)
$history->historyID(0);
Gets the last played songs.
$history->last(10);
Plays the last song again
$history->playLast();
Playes the song with
$history->play(2);
Sets the name of the song with to
$history->rename(0, "new title");
Gets all songs played until . Any of those desciptors: (hour|today|yesterday|week)
$history->till("today");
Gets all songs which title contains
$history->filterTitle("filter");
Atm the return value of all funtions is the pure answer from the TS3AB API, which may change in the future.
bennetgallein/ts3ab-api 适用场景与选型建议
bennetgallein/ts3ab-api 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.31k 次下载、GitHub Stars 达 3, 最近一次更新时间为 2018 年 06 月 30 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 bennetgallein/ts3ab-api 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 bennetgallein/ts3ab-api 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 1.31k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: LGPL-3.0
- 更新时间: 2018-06-30