Expand description
TeamSpeak 3.6 updates the plugin api version to 26.
Version 0.3 is compatible with this version.
At the moment, not all methods that are exposed by the TeamSpeak API are available for plugins. If a method that you need is missing, please file an issue or open a pull request.
§Usage
Add the following to your Cargo.toml
:
[package]
name = "<pluginname>"
version = "<version>"
authors = ["<your name>"]
description = "<description>"
[lib]
name = "<pluginname>"
crate-type = ["cdylib"]
[dependencies]
ts3plugin = "0.3"
§Example
A fully working example, which creates a plugin that does nothing:
#[macro_use]
extern crate ts3plugin;
use ts3plugin::*;
struct MyTsPlugin;
impl Plugin for MyTsPlugin {
// The default name is the crate name, but we can overwrite it here.
fn name() -> String { String::from("My Ts Plugin") }
fn command() -> Option<String> { Some(String::from("myplugin")) }
fn autoload() -> bool { false }
fn configurable() -> ConfigureOffer { ConfigureOffer::No }
// The only required method
fn new(api: &TsApi) -> Result<Box<MyTsPlugin>, InitError> {
api.log_or_print("Inited", "MyTsPlugin", LogLevel::Info);
Ok(Box::new(MyTsPlugin))
// Or return Err(InitError::Failure) on failure
}
// Implement callbacks here
fn shutdown(&mut self, api: &TsApi) {
api.log_or_print("Shutdown", "MyTsPlugin", LogLevel::Info);
}
}
create_plugin!(MyTsPlugin);
Re-exports§
pub use plugin::*;
Modules§
Macros§
- create_
plugin - Create a plugin.
Structs§
- BBCode
Tags - Bookmark
Item - Bookmark
List - Channel
- Channel
Group - Channel
Group Id - Channel
Id - A wrapper for a channel id.
- Client
Mini Export - Connection
- Connection
Id - A wrapper for a connection id.
- File
Transfer Callback Export - Hotkey
- Invoker
- The invoker is maybe not visible to the user, but we can get events caused by him, so some information about him are passed along with his id.
- Invoker
Data - Menu
Item - Myts
Data Unset Flags - Permission
- Permission
Id - Permissions
- Permissions - TODO not yet implemented
- Plugin
Lock - Server
- Server
Group - Server
Group Id - Server
Id - A wrapper for a server id.
- Speaker
- Speaker locations used by some sound callbacks
- Transform
File Path Export - Structure used to describe a file transfer in the \ref ServerLibFunctions.onTransformFilePath callback. This describes the original values, and also contains hints for length limitations of the result parameter of the callback. Important: Which values of the struct can be modified is defined by the action value of the original parameter.
- Transform
File Path Export Returns - Structure to rewrite the file transfer file name and path in the \ref ServerLibFunctions.onTransformFilePath callback. The lengths are limited as described in the original parameter. Important: Which values of the struct can be modified is defined by the action value of the original parameter.
- Ts3Functions
- Functions exported to plugin from main binary
- Ts3Vector
- Describes a client position in 3 dimensional space, used for 3D Sound.
- TsApi
- The main struct that contains all permanently save data.
- TsApi
Lock - Variables
Export - Variables
Export Item - Some structs to handle variables in callbacks
Enums§
- ACLType
- Access Control List
- Away
Status - Channel
Bool Property - Channel
Codec Type Property - Channel
Hostbanner Mode Property - Channel
I32Property - Channel
Option Channel Property - Channel
Properties - Channel
Property - Channel
String Property - Client
Command - This enum is used to disable client commands on the server
- Client
Properties - Client
Type - Codec
Encryption Mode - Codec
Type - Command
Line Properties Rare - Configure
Offer - Return values for offersConfigure
- Connect
Status - Connect
Tab - Connection
Away Status Property - Connection
Bool Property - Connection
Channel Group IdProperty - Connection
Channel IdProperty - Connection
Channel Property - Connection
Date Time UtcProperty - Connection
Duration Property - Connection
Hardware Input Status Property - Connection
Hardware Output Status Property - Connection
I32Property - Connection
Input Deactivation Status Property - Connection
Mute Input Status Property - Connection
Mute Output Status Property - Connection
Properties - Connection
Property - Connection
String Property - Connection
Talk Status Property - Connection
U16Property - Connection
U64Property - Connection
VecServer Group IdProperty - Error
- File
List Type - File transfer type
- File
Transfer Action - File transfer actions
- File
Transfer State - File transfer status
- Group
Show Name Tree Mode - Group
Whisper Target Mode - Group
Whisper Type - GuiProfile
- Hardware
Input Status - Hardware
Output Status - Hostbanner
Mode - Hostmessage
Mode - Input
Deactivation Status - Item
Type - License
Issue - Local
Test Mode - LogLevel
- LogTypes
- Menu
Type - Message
Receiver - The possible receivers of a message. A message can be sent to a specific connection, to the current channel chat or to the server chat.
- Message
Target - Mono
Sound Destination - Mute
Input Status - Mute
Output Status - Plugin
Target Mode - Protocol
Encryption Cipher - Reason
Identifier - Security
Salt Options - Server
Binding - Server
Bool Property - Server
Channel Group IdProperty - Server
Codec Encryption Mode Property - Server
Connection Property - Server
Date Time UtcProperty - Server
Duration Property - Server
Hostbanner Mode Property - Server
Hostmessage Mode Property - Server
I32Property - Server
Instance Properties Rare - Server
Property - Server
Server Group IdProperty - Server
String Property - Talk
Status - Text
Message Target Mode - Virtual
Server Properties - Visibility
Constants§
- BANDWIDTH_
LIMIT_ UNLIMITED - HOTKEY_
BUFSZ - MAX_
SIZE_ AWAY_ MESSAGE - MAX_
SIZE_ CHANNEL_ DESCRIPTION - channel description length limit, measured in bytes (utf8 encoded)
- MAX_
SIZE_ CHANNEL_ NAME - channel name maximum length in characters
- MAX_
SIZE_ CHANNEL_ TOPIC - // channel topic lengt limith, measured in bytes (utf8 encoded)
- MAX_
SIZE_ CLIENT_ DESCRIPTION - MAX_
SIZE_ CLIENT_ NICKNAME - client display name length limit in characters
- MAX_
SIZE_ CLIENT_ NICKNAME_ NONSDK - MAX_
SIZE_ COMPLAIN_ MESSAGE - MAX_
SIZE_ GROUP_ NAME - MAX_
SIZE_ HOSTBUTTON_ TOOLTIP - MAX_
SIZE_ HOST_ MESSAGE - MAX_
SIZE_ OFFLINE_ MESSAGE - MAX_
SIZE_ OFFLINE_ MESSAGE_ SUBJECT - MAX_
SIZE_ POKE_ MESSAGE - MAX_
SIZE_ REASON_ MESSAGE - length limit in characters for kick, move, etc reasons
- MAX_
SIZE_ TALK_ REQUEST_ MESSAGE - MAX_
SIZE_ TEXTMESSAGE - text message length limit, measured in bytes (utf8 encoded)
- MAX_
SIZE_ USER_ TAG - MAX_
SIZE_ VIRTUALSERVER_ HOSTBANNER_ GFX_ URL - MAX_
SIZE_ VIRTUALSERVER_ NAME - virtual server name maximum length in characters
- MAX_
SIZE_ VIRTUALSERVER_ WELCOMEMESSAGE - server welcome message length limit measured in bytes (utf8 encoded)
- MAX_
VARIABLES_ EXPORT_ COUNT - MENU_
BUFSZ - MIN_
SECONDS_ CLIENTID_ REUSE - Minimum amount of seconds before a clientID that was in use can be assigned to a new client
- MIN_
SIZE_ CLIENT_ NICKNAME - client display name minimum length in characters
- MIN_
SIZE_ CLIENT_ NICKNAME_ NONSDK - SIZE_
MYTSID