Resource icon

TeamSpeak 3 Modular Bot - C# BETA

No permission to download
Virustotal
https://github.com/Najsr/TeamSpeak3ModularBot
Additional Requirements
.NET 4.6.1 or newer runtime & compiler
TS3 Modular Bot

Introduction

A simple to use auto loading bot with many features!

Requirements

This module requires the following modules/libraries:


Installation

Download latest version of Modular Bot and build it. After you are done, you have a working bot with examples

Configuration

Create a file called __config.json__ and paste in this code and edit it by your login details...:
JSON:
{
    "Username": "serveradmin",
    "Password": "password",
    "Host": "my_server.com",
    "Port": 10011,
    "DisplayName": ".NET modular bot",
    "ServerPort": 9987
}
Injectable data types (in Command's parameter)

  • MessageReceivedEventArgs - whole received command
  • string[] or List<string> - All the parameters passed separated by space
  • uint - clientID of client who executed the command
  • PluginManager - Class used to manage plugins
  • MessageTarget - Enum value that contains on which type of chat the command was received
  • string
  1. if it has no default value set it is used as a required parameter
  2. if default value is null, it means that it is an optional parameter
  3. if name of the string is uniqueid then the bot injects invoker's UID
  4. if name of the string is clientnickname then the bot injects invoker's nickname
  5. if invoker didn't pass enough parameters it will execute the onFailedMessage string
Example Plugin
C#:
 //You must derive from Plugin class otherwise it will not be loaded.
 public class MyPlugin : Plugin
 {
    public MyPlugin(QueryRunner queryRunner) : base(queryRunner)
    {
    //Can be used for initializing since it is a constructor
    }

    //Author of plugin; Not required
    public override string Author => "Only ME";

    //Limits execution for specified groups
    [ServerGroups("Server Admin", "Normal")]
    //Implements chat command itself
    //Parameters: 
    //string Command - it is the command itself (if you want more on a single method, use more ClientCommand classes)
    //MessageMode = MessageMode.All - defines on which type of chat it will be triggered (it is bit based enum, so bitwise operators can be used)
    //string onFailedMessage = null - replied to a executing user when he does not input enough parameters (defined by string parameters without default value)
    [ClientCommand("hello", MessageMode.Private | MessageMode.Channel)]
    
    public void SendMessage(string clientNickname, uint clId, string input = null)
    {
        Ts3Instance.SendTextMessage(MessageTarget.Client, clId,
            $"Hello {clientNickname}. {(input != null ? "You just said: " + input : "")}");
    }
}
  • Like
Reactions: ULDIN
Author
Najsr
Downloads
76
Views
3,507
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from Najsr

Top