Code Monkey home page Code Monkey logo

ts-channel-deleter's Introduction

TeamSpeak Query bot - Channel Deleter GitHub license

What is this?

TeamSpeak query bot that deletes unused channels after specific time.
Delete time is saved in channel topic so the deletion time will not be reseted after server restart.
Channel icons if channel is too close to delete.

Features

  • It's query bot so does not use any slots.
  • Fully configurable
  • Build in most powerful ts3 php framework TeamSpeak 3 PHP Framework
  • Works on Linux, macOS and Windows
  • Open Source

Installation

Requirements

  • PHP 7.x, mbstring, xml
  • TeamSpeak Server - v3.4.0 (build >= 1536564584) or higher.
  • Install the TS3 PHP Framework by manually downloading it or using Composer:
composer require planetteamspeak/ts3-php-framework
  • Channels must be as subsubchannels!

Setup server permissions

  • Disable for users this permission b_channel_modify_topic

Configuration

config.php
$cf["framework"] = "libraries/TeamSpeak3/TeamSpeak3.php";
$cf["connect"]   = [
    "username"        => "serveradmin",
    "password"        => "2lM3Nop6",
    "host"            => "127.0.0.1",
    "qport"           => "10011",
    "vport"           => "9987",
    "nickname"        => "Channel Deleter",
    "default_channel" => false, //channel id of channel / false to disable
];
$cf["deleter"] = [
    "update_interval" => 120, //Check channels every x seconds
    "timezone"        => "Europe/Prague", //timezones https://www.php.net/manual/en/timezones.php
    "parent_channel"  => 685, //parent channel of sub channels
    "delete_time"     => 604800, //In seconds! (1 week)
    "warning_time"    => [
        "enabled"      => true, //false to disable
        "time"         => 432000, //In seconds! (2 days before delete)
        "suffix"       => [
            "enabled" => true,
            "suffix"  => 4145625407, // IMPORTANT!!! add space before the suffix
        ],
        "info_channel" => [ //avaiable variables [COUNT], [HOURS], [MINUTES], [SECONDS]
            "enabled"      => true, //eneble info channel, false to disable all feauters
            "cid"          => 685, //channel id
            "channel_name" => [
                "enabled"      => true, //false to disable
                "channel_name" => "[cspacer]Number of rooms [COUNT]/50",
            ],
            "description"  => [ // IMPORTANT!!! Only if warning time is enabled!
                "enabled"            => true, //false to disable //if warning time is disabled this is disabled also
                "description_prefix" => "[SIZE=10]list of rooms that will be deleted[/SIZE]", // "\n" for new line
                "description_suffix" => "", // "\n" for new line
                "description"        => "Channel [B][CHANNEL][/B] will be deleted in [HOURS] hours, [MINUTES] minutes and [SECONDS] seconds\n", // "\n" for new line
                "description_empty"  => "No channel will be deleted", // "\n" for new line
            ],
        ],
    ],
];

Usage

screen -AmdSL tsbot php bot.php

Screenshosts

Show Images

License

MIT License

Copyright (c) 2019 Ondřej Niesner

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.