Bot responser

EscuderoKevin

Well-Known Member
Jul 2, 2015
380
181
130
Hello , i think a bot "Reponser"

how to recive commands php ? or java ?

ex:

EscuderoKevin: !bot hi
MyBotServer: Hi , Escudero Kevin.

(?
 

0x0539

Retired Staff
Contributor
Jan 30, 2016
1,334
1,146
254
Why would you ask it in the vip section anyway? ;P
 

Derp

Retired Staff
Contributor
Apr 30, 2015
933
1,014
217
It took a single google query. I mean, really? is it that hard to google "TS3 PHP Framework Documentation"?

https://docs.planetteamspeak.com/ts3/php/framework/index.html#example_sec

This is what you're looking for

14. Create a Simple Bot waiting for Events

Code:
// load framework files
require_once("libraries/TeamSpeak3/TeamSpeak3.php");
// connect to local server in non-blocking mode, authenticate and spawn an object for the virtual server on port 9987
$ts3_VirtualServer = TeamSpeak3::factory("serverquery://username:[email protected]:10011/?server_port=9987&blocking=0");
// get notified on incoming private messages
$ts3_VirtualServer->notifyRegister("textprivate");
// register a callback for notifyTextmessage events
TeamSpeak3_Helper_Signal::getInstance()->subscribe("notifyTextmessage", "onTextmessage");
// wait for events
while(1) $ts3_VirtualServer->getAdapter()->wait();
// define a callback function
function onTextmessage(TeamSpeak3_Adapter_ServerQuery_Event $event, TeamSpeak3_Node_Host $host)
{
echo "Client " . $event["invokername"] . " sent textmessage: " . $event["msg"];
}

-Derp
 

EscuderoKevin

Well-Known Member
Jul 2, 2015
380
181
130
It took a single google query. I mean, really? is it that hard to google "TS3 PHP Framework Documentation"?

https://docs.planetteamspeak.com/ts3/php/framework/index.html#example_sec

This is what you're looking for

14. Create a Simple Bot waiting for Events

Code:
// load framework files
require_once("libraries/TeamSpeak3/TeamSpeak3.php");
// connect to local server in non-blocking mode, authenticate and spawn an object for the virtual server on port 9987
$ts3_VirtualServer = TeamSpeak3::factory("serverquery://username:[email protected]:10011/?server_port=9987&blocking=0");
// get notified on incoming private messages
$ts3_VirtualServer->notifyRegister("textprivate");
// register a callback for notifyTextmessage events
TeamSpeak3_Helper_Signal::getInstance()->subscribe("notifyTextmessage", "onTextmessage");
// wait for events
while(1) $ts3_VirtualServer->getAdapter()->wait();
// define a callback function
function onTextmessage(TeamSpeak3_Adapter_ServerQuery_Event $event, TeamSpeak3_Node_Host $host)
{
echo "Client " . $event["invokername"] . " sent textmessage: " . $event["msg"];
}

-Derp

o my fucking god :/ i think php cant do this :/ thanks derp.
 
Top