Teamspeak PHP Get MyTs Id From It ?

Yousef

Active Member
Nov 16, 2017
36
9
83
Hello r4p3 users and programmers

i wanna to get MyTs Id from php can i do it with teamspeak framework i think there is a way to get it because i can get it from YaTQa

Thanks
 

Ondra3211

Contributor
May 5, 2018
65
37
111
PHP:
<?php
require_once("libraries/TeamSpeak3/TeamSpeak3.php");
try
{
  //Your nickname
    $name = "TeamSpeakUser";
  //connect to server
  $uri = "serverquery://serveradmin:[email protected]:10011/?server_port=9987&blocking=0";

  $ts3 = TeamSpeak3::factory($uri);
  $info = $ts3->clientGetByName($name)->getInfo();
  echo $info["client_myteamspeak_id"];
}
catch(TeamSpeak3_Exception $e)
{
  echo "Error " . $e->getCode() . ": " . $e->getMessage();
}
?>
 

Yousef

Active Member
Nov 16, 2017
36
9
83
PHP:
<?php
require_once("libraries/TeamSpeak3/TeamSpeak3.php");
try
{
  //Your nickname
    $name = "TeamSpeakUser";
  //connect to server
  $uri = "serverquery://serveradmin:[email protected]:10011/?server_port=9987&blocking=0";

  $ts3 = TeamSpeak3::factory($uri);
  $info = $ts3->clientGetByName($name)->getInfo();
  echo $info["client_myteamspeak_id"];
}
catch(TeamSpeak3_Exception $e)
{
  echo "Error " . $e->getCode() . ": " . $e->getMessage();
}
?>

Thank You <3
 
Top