Forum

Results 1 to 12 of 12
  1. #1
    Join Date
    May 2009
    Location
    Germany
    Posts
    75

    Server Group Assign Bot

    Hello TS Community,

    the following question just kept popping up over and over again:

    "I want clients to be able to assign certain server groups, but only to themselves."

    As we all know, this is not possible with the TeamSpeak permission hierachy. For this reason I have created a small PHP Bot to resolve this issue. The bot is really minimalistic and should be fairly easy to use. Simply have LAMP installed, configure the settings.php to your needs and execute the ts3_assign_server_groups.php in a shell.
    Download link:

    http://madmatti.de/download.php?fileID=3


    Features:
    • Welcome message is sent to clients who connect
    • Chat command "assign SERVER_GROUP_NAME" to assign a predefined server group to the client
    • Chat command "revoke SERVER_GROUP_NAME" to revoke a predefined server group from the client
    • Optional Member-Only mode to require the client to be in a predefined server group before he can use the bot
    • Optional Limit server groups feature to limit the maximum amount of server groups a client can receive through the bot


    Requirements:
    A server which can execute PHP scripts. Any common Linux distribution should do the trick for example. You also need a ServerQuery login. If you are hosting your own server, you can use the "serveradmin" login. Else, try to click at "Tools, ServerQuery Login". If that is greyed out, then sorry, but you will not be able to create a login for the bot.

    Running the bot:
    Modify the settings.php file first. Set the $login_name and $login_password to either your "serveradmin" login credentials or to the data you have received when you used the "Tools, ServerQuery Login" function of the TS3 Client.
    Next important setting is $server_groups, where you need to enter the Server Group IDs the bot should be able to assign.
    Code:
    $server_groups = array(
    	"minecraft" 	=> "566",
    	"testgrp"	=> "922",
    	"vip"		=> "747",
    );
    This means, if you whisper the bot with "assign minecraft", he will try to give you the ServerGroup with ID 566. Server Group IDs can be looked up under "Permissions, Server Groups" on the left hand side in the TS3 client.
    The rest of the settings should not be ultra important, as long as you configured the bot to connect to the correct server ($virtualserver_port) and entered the correct query port ($query_port).

    After editing the settings, all you need to do is to execute the bot:
    ./ts3_assign_server_groups.php

    You might want to use screen to keep the bot running when you close the terminal:
    screen -AmdS ts3bot ./ts3_assign_server_groups.php


    Special thanks to SCP, who wrote the TeamSpeak 3 PHP Framework. A copy of the framework is included in the download.
    If you find any bugs, please post them in here. I have done only very little debugging, so this could very well happen ;-)
    Last edited by Madmatthi; August 21st, 2015 at 11:35 AM. Reason: Added instructions

  2. #2
    Join Date
    July 2015
    Posts
    1
    please tell me how to run this thing?

  3. #3
    Join Date
    May 2009
    Location
    Germany
    Posts
    75
    Made some minor changes to the code to prevent the bot from crashing in some rare cases when it tried to send text messages to query clients or did not have permissions to send a message.
    Also fixed a bug where the bot would not remove anyone from server groups, if "limit_server_groups" was set to 0 in the settings.

  4. #4
    Join Date
    November 2014
    Posts
    5
    Quote Originally Posted by VEERZ View Post
    please tell me how to run this thing?
    +1 pls how to run?

  5. #5
    Join Date
    November 2014
    Posts
    5
    pls guide to run

  6. #6
    Join Date
    May 2009
    Location
    Germany
    Posts
    75
    Added some intructions and requirements as requested. Sorry for the late reply.

  7. #7
    Join Date
    February 2010
    Location
    Hollandia
    Posts
    57
    Great work m8te, I see the bot will give serveradmin rights when a client whispers the bot.
    Isn't this a security issue?

  8. #8
    Join Date
    November 2015
    Posts
    1

    Server Group Assigning Bot (HELP)

    Hey guys! So i have a little challenge for you script devs. I'm trying to figure out a way to setup a bot someone can send a certain text message to, and receive permissions from it.

    EXAMPLE:

    A new user joins the TeamSpeak as servergroup "Guest". Guest has no permissions. Guest must read the rules to obtain permissions. At the bottom of the Rules page, there is text that says "Send this key to Bot to obtain membership: MEMBER". Guest sends message "MEMBER" to bot as a private chat text and is assigned servergroup Member because of it.

    Now, riddle me this, is this even possible? I do not know PHP or write scripts. I'm hoping this isn't too elaborate for this great big TS community to come up with a solution! I look forward to hearing from all of you!
    Last edited by dante696; August 23rd, 2016 at 04:25 PM. Reason: merged, because such bot does exist already and topic is the same

  9. #9
    Join Date
    August 2016
    Location
    Germany
    Posts
    5
    Quote Originally Posted by SteZZz View Post
    Great work m8te, I see the bot will give serveradmin rights when a client whispers the bot.
    Isn't this a security issue?
    it only assigns server admin rights if you allow the bot to... just dont let him, then theres no security issue.
    Last edited by JonnyBnator; August 19th, 2016 at 05:20 AM.

  10. #10
    Join Date
    August 2016
    Location
    Germany
    Posts
    5
    This is somewhat similiar to what you are looking for:

    http://forum.teamspeak.com/threads/1...oup-Assign-Bot

  11. #11
    Join Date
    September 2016
    Posts
    5

    Error?

    Quote Originally Posted by Madmatthi View Post
    Hello TS Community,

    "I want clients to be able to assign certain server groups, but only to themselves."
    Hey man! Thanks for creating this bot. This is exactly what I need in order to better manage the groups on my TS server.
    I've made the required changes to the settings.php, uploaded the folder to my server, gave the user ownership and modded the php file to be executable. I run the file, and when a user connects, it throws an error .

    Code:
    PHP Fatal error:  Uncaught TeamSpeak3_Adapter_ServerQuery_Exception: convert error in /home/ts3bot/servergroups/libraries/TeamSpeak3/Adapter/ServerQuery/Reply.php:319
    Stack trace:
    #0 /home/ts3bot/servergroups/libraries/TeamSpeak3/Adapter/ServerQuery/Reply.php(91): TeamSpeak3_Adapter_ServerQuery_Reply->fetchError(Object(TeamSpeak3_Helper_String))
    #1 /home/ts3bot/servergroups/libraries/TeamSpeak3/Adapter/ServerQuery.php(141): TeamSpeak3_Adapter_ServerQuery_Reply->__construct(Array, 'servergroupclie...', Object(TeamSpeak3_Node_Host), true)
    #2 /home/ts3bot/servergroups/libraries/TeamSpeak3/Node/Abstract.php(73): TeamSpeak3_Adapter_ServerQuery->request('servergroupclie...', true)
    #3 /home/ts3bot/servergroups/libraries/TeamSpeak3/Node/Server.php(90): TeamSpeak3_Node_Abstract->request('servergroupclie...', true)
    #4 /home/ts3bot/servergroups/libraries/TeamSpeak3/Node/Abstract.php(97): TeamSpeak3_Node_Server->request('servergroupclie...')
    #5 /home/ts3bot/servergroups/libraries/TeamSpeak3/Node/Server.php(1228): TeamSpeak3_Node_Abstract- in /home/ts3bot/servergroups/libraries/TeamSpeak3/Adapter/ServerQuery/Reply.php on line 319
    I can't seem to find what I've done wrong. I've tried removing the array, so it's just 2 groups, but still getting an error. Any change you ran into this as well since some update and point me to my problem? Thanks again!

  12. #12
    Join Date
    November 2016
    Location
    Hungary
    Posts
    5
    Quote Originally Posted by jo0lz View Post
    Hey man! Thanks for creating this bot. This is exactly what I need in order to better manage the groups on my TS server.
    I've made the required changes to the settings.php, uploaded the folder to my server, gave the user ownership and modded the php file to be executable. I run the file, and when a user connects, it throws an error .

    Code:
    PHP Fatal error:  Uncaught TeamSpeak3_Adapter_ServerQuery_Exception: convert error in /home/ts3bot/servergroups/libraries/TeamSpeak3/Adapter/ServerQuery/Reply.php:319
    Stack trace:
    #0 /home/ts3bot/servergroups/libraries/TeamSpeak3/Adapter/ServerQuery/Reply.php(91): TeamSpeak3_Adapter_ServerQuery_Reply->fetchError(Object(TeamSpeak3_Helper_String))
    #1 /home/ts3bot/servergroups/libraries/TeamSpeak3/Adapter/ServerQuery.php(141): TeamSpeak3_Adapter_ServerQuery_Reply->__construct(Array, 'servergroupclie...', Object(TeamSpeak3_Node_Host), true)
    #2 /home/ts3bot/servergroups/libraries/TeamSpeak3/Node/Abstract.php(73): TeamSpeak3_Adapter_ServerQuery->request('servergroupclie...', true)
    #3 /home/ts3bot/servergroups/libraries/TeamSpeak3/Node/Server.php(90): TeamSpeak3_Node_Abstract->request('servergroupclie...', true)
    #4 /home/ts3bot/servergroups/libraries/TeamSpeak3/Node/Abstract.php(97): TeamSpeak3_Node_Server->request('servergroupclie...')
    #5 /home/ts3bot/servergroups/libraries/TeamSpeak3/Node/Server.php(1228): TeamSpeak3_Node_Abstract- in /home/ts3bot/servergroups/libraries/TeamSpeak3/Adapter/ServerQuery/Reply.php on line 319
    I can't seem to find what I've done wrong. I've tried removing the array, so it's just 2 groups, but still getting an error. Any change you ran into this as well since some update and point me to my problem? Thanks again!
    I have same problem, please help.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Assign only specific Groups, outside of Group Assign Power
    By IAmSerge in forum Permission System
    Replies: 1
    Last Post: May 5th, 2015, 08:39 AM
  2. Anyone can assign server group ?
    By Speed78 in forum Permission System
    Replies: 4
    Last Post: December 17th, 2014, 01:24 AM
  3. Auto-Assign Channel Group based on Server Group?
    By mish_poly in forum Permission System
    Replies: 1
    Last Post: June 7th, 2014, 10:37 PM
  4. Can assign server group but not channel group
    By Morthawt in forum Permission System
    Replies: 2
    Last Post: January 17th, 2013, 02:08 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •