esports-academy / teamspeak-bundle
连接到 teamspeak-server 并将 teamspeak 事件转换为 symfony 事件的 teamspeak 服务
1.0.2
2017-10-28 21:14 UTC
Requires
- php: >=5.6
- planetteamspeak/ts3-php-framework: ^1.1
- symfony/symfony: >=3.0.0
Requires (Dev)
- phpunit/phpunit: 3.7.*
This package is not auto-updated.
Last update: 2024-09-30 00:15:52 UTC
README
此 Bundle 为您提供了连接到 TeamSpeak³-Server 的功能。它监听添加的事件并在您的项目中触发监听器。
安装
运行 composer require esports-academy/backup-bundle
以在您的项目中使用 ESATeamSpeakBundle。
配置
添加到 AppKernel.php
class AppKernel extends Kernel { public function registerBundles() { $bundles = array( new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new Symfony\Bundle\SecurityBundle\SecurityBundle(), new Symfony\Bundle\TwigBundle\TwigBundle(), // ... new ESA\TeamSpeakBundle\ESATeamSpeakBundle(), // ... return $bundles; } // ... }
config.yml
esa_team_speak: host: ts.es-a.org // TeamSpeak-IP port: 9987 // TeamSpeak-Port query_port: 10011 // Serverquery-Port username: serverquery // Serverquery-Username password: p4ssw0rd // Serverquery-Password nickname: James // Nickname timeout: 10 // Timeout in Seconds
使用方法
创建您的函数
AppBundle/TeamSpeakBot/ClientListener.php
class TeamSpeakBot { public function onClientEnterView($event) { // do stuff } }
注册您的函数
services.yml
services: AppBundle\TeamSpeakBot\ClientListener: tags: - { name: kernel.event_listener, event: teamspeak.client_enter_view, method: onClientEnterView }
运行机器人
要运行机器人,请执行 php bin/console teamspeak:bot:run
或 php bin/console teamspeak:bot:start
以进行后台作业。
路线图
以下是我们将要在未来包含的一些功能。
- 在事件之外添加操纵机器人的功能