ts3admin class readChatMessage

FarisDev

L oryh brx
Contributor
Jun 9, 2016
277
111
107
Hello R4P3 Players,
I've been searching for any example for readChatMessage Function on ts3admin.class
I want to make If anyone's Write Hi on the chat, The bot automatically replies.
So can anyone help me with that?
Note: I'm learning now ts3admin.class, So it's cool to help me with this example :)
 

Kleberstoff

Knowledge Seeker
VIP
Dec 29, 2015
308
214
158
PHP:
while(true)
{
   $msgData = $tsAdmin->readChatMessage('textprivate', true);
   if($msgData['success'] == 1) // All went fine
   {
       $msgData = $msgData['data'];
       $clientID = $msgData['invokerid'];
       $clientUID = $msgData['invokeruid'];
       $clientName = $msgData['invokername'];
       $msg = $msgData['msg'];
       $targetMode = $msgData['targetmode'];
   }
}
PHP:
$tsAdmin = new ts3admin("127.0.0.1", "10011");

if($tsAdmin->getElement('success', $tsAdmin->connect()))
{
   $tsAdmin->login("serveradmin", "fuckinghell");
   $tsAdmin->selectServer("9987");
   $tsAdmin->setName("Ignore Me");
  
   $whoami = $tsAdmin->getElement('data', $tsAdmin->whoAmI());
    $tsAdmin->clientMove($whoami['client_id'],"498");
  
   echo "Connected\n";
}

while(true)
{
   $msgData = $tsAdmin->readChatMessage('textchannel', true);
   if($msgData['success'] == 1) // All went fine
   {
       $msgData = $msgData['data'];
       $clientID = $msgData['invokerid'];
       $clientUID = $msgData['invokeruid'];
       $clientName = $msgData['invokername'];
       $msg = $msgData['msg'];
       $targetMode = $msgData['targetmode'];
       echo $msg . "\n";
   }
}

should be fine right? Taken from here
 
Last edited:
Top