├── AutoFollow ├── packages.config ├── Properties │ └── AssemblyInfo.cs ├── AutoFollow.csproj └── plugin.cs ├── ISPValidator ├── packages.config ├── Properties │ └── AssemblyInfo.cs └── ISPValidator.csproj ├── AntiAFK ├── AntiAFK.xml └── AntiAFK.csproj ├── AutoPause ├── AutoPause.xml └── AutoPause.csproj ├── PMRedirect ├── packages.config ├── Properties │ ├── Settings.settings │ ├── AssemblyInfo.cs │ └── Settings.Designer.cs ├── app.config ├── plugin.cs └── PMRedirect.csproj ├── .editorconfig ├── MetaData ├── packages.config ├── Properties │ └── AssemblyInfo.cs ├── MetaData.csproj └── plugin.cs ├── README.md ├── AwayMover ├── AwayMover.csproj └── Plugin.cs ├── RegistriertChannel ├── packages.config ├── Properties │ └── AssemblyInfo.cs ├── App.config ├── RegistriertChannel.csproj └── plugin.cs ├── Test ├── Test.csproj └── Plugin.cs ├── ServerLog ├── ServerLog.csproj └── Plugin.cs ├── GroupOnConnect ├── GroupOnConnect.csproj └── Plugin.cs ├── MinecraftLink ├── MinecraftLink.csproj └── Plugin.cs ├── BotAutoStartQuery ├── BotAutoStartQuery.csproj └── Plugin.cs ├── NoIdentity ├── NoIdentity.csproj └── plugin.cs ├── Bluscream.Util.dll ├── Bluscream.Util.csproj └── PluginUtil.cs ├── ClientQuery ├── Properties │ ├── Settings.settings │ ├── AssemblyInfo.cs │ └── Settings.Designer.cs ├── app.config ├── ClientQuery.csproj └── Client.cs ├── TeaSpeak ├── TeaSpeak.csproj └── Plugin.cs ├── Twitch ├── YouTubeLive.csproj └── Plugin.cs ├── AntiVPN ├── AntiVPN.csproj └── Plugin.cs ├── VersionVerify ├── VersionVerify.csproj └── Plugin.cs ├── ChannelManager └── ChannelManager.csproj ├── NoDirectConnect ├── NoDirectConnect.csproj └── Plugin.cs ├── DropSystems └── DropSystems (Deprecated).csproj ├── Follow ├── AutoFollow.csproj └── Plugin.cs ├── Dynamic Slots └── DynamicSlots.csproj ├── customBan └── customBan.csproj ├── AntiGodZilla └── ModBlackList.csproj ├── AutoChannelCommander ├── AutoChannelCommander.csproj └── plugin.cs ├── ToggleSupport └── ToggleSupport.csproj ├── simpleVerify └── SimpleVerify.csproj ├── ChannelWatcher ├── ChannelWatcher.csproj └── Plugin.cs ├── ComplaintReminder └── ComplaintReminder.csproj ├── CountdownChannel ├── CountdownChannel.csproj └── Plugin.cs ├── CountryWhitelist └── CountryWhitelist.csproj ├── MaintenanceMode └── MaintenanceMode.csproj ├── BewerbungNotify └── BewerbungNotify.csproj ├── JTS3Mod ├── JTS3Mod.csproj └── plugin.cs ├── NowPlaying └── NowPlaying.csproj ├── ChannelEdit └── ChannelEdit.csproj ├── VersionDump ├── VersionDetector.csproj └── plugin.cs ├── BackToDefaultChannel ├── BackToDefaultChannel.csproj └── plugin.cs ├── DefaultServerGroup ├── DefaultServerGroup.csproj └── plugin.cs ├── AutoChannelDescription ├── AutoChannelDescription.csproj └── Plugin.cs ├── YoutubeSearch ├── YoutubeSearch.csproj └── plugin.cs ├── Example.cs ├── SimpleTTS └── SimpleTTS.csproj ├── BotAutoStart └── BotAutoStart.csproj ├── Tools └── Tools.csproj ├── TestPlugin ├── Properties │ └── AssemblyInfo.cs ├── TestPlugin.csproj └── plugin.cs ├── AutoChannelCreate └── AutoChannelCreate.csproj ├── Class1.cs ├── .gitattributes └── .gitignore /AutoFollow/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /ISPValidator/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /AntiAFK/AntiAFK.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | AntiAFK 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /AutoPause/AutoPause.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | AutoPause 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /PMRedirect/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | insert_final_newline = true 6 | charset = utf-8 7 | 8 | [*.cs] 9 | indent_style = tab 10 | trim_trailing_whitespace = true 11 | 12 | [*.tt] 13 | insert_final_newline = false 14 | -------------------------------------------------------------------------------- /MetaData/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TS3AudioBotPlugins 2 | 3 | ## Note 4 | 5 | This repository is no longer maintained as i don't use TeamSpeak anymore. Most of the plugins here are outdated and don't work with latest versions of TS3AudioBot. You are free to create pull requests to update any plugin if you wish. Also i will leave this repository unarchived to give others inspirations of how to handle certain stuff with a plugin. 6 | -------------------------------------------------------------------------------- /AwayMover/AwayMover.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /RegistriertChannel/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Test/Test.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | false 14 | 15 | 16 | false 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /ServerLog/ServerLog.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | false 14 | 15 | 16 | false 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /GroupOnConnect/GroupOnConnect.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | false 14 | 15 | 16 | false 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /MinecraftLink/MinecraftLink.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | false 14 | 15 | 16 | false 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /BotAutoStartQuery/BotAutoStartQuery.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | false 14 | 15 | 16 | false 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /NoIdentity/NoIdentity.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | Bluscream 6 | https://github.com/Splamy/TS3AudioBot 7 | https://github.com/Bluscream/TS3AudioBotPlugins 8 | git 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Bluscream.Util.dll/Bluscream.Util.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | Contains common utils for my plugins. 6 | Bluscream 7 | Bluscream 8 | Bluscream 9 | 10 | 11 | 12 | P:\TS3AB\net46\Plugins\ 13 | Off 14 | none 15 | false 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /ClientQuery/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 0.0.0.0 7 | 8 | 9 | 25639 10 | 11 | 12 | 0000-0000-0000-0000 13 | 14 | 15 | -------------------------------------------------------------------------------- /TeaSpeak/TeaSpeak.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | P:\TS3AB\net46\Plugins\ 9 | Off 10 | none 11 | false 12 | 13 | 14 | 15 | 16 | false 17 | 18 | 19 | false 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Twitch/YouTubeLive.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | Off 9 | P:\TS3AB\net46\Plugins\ 10 | none 11 | false 12 | 13 | 14 | 15 | 16 | false 17 | 18 | 19 | false 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /AntiVPN/AntiVPN.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | P:\TS3AB\Plugins\Descriptions\ 9 | Off 10 | none 11 | false 12 | 13 | 14 | 15 | 16 | false 17 | 18 | 19 | false 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /VersionVerify/VersionVerify.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | P:\TS3AB\Plugins\ 9 | Off 10 | none 11 | false 12 | 13 | 14 | 15 | 16 | false 17 | 18 | 19 | false 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /ChannelManager/ChannelManager.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | P:\TS3AB\net46\Plugins 9 | Off 10 | none 11 | false 12 | 13 | 14 | 15 | 16 | false 17 | 18 | 19 | false 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /NoDirectConnect/NoDirectConnect.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | P:\TS3AB\net46\Plugins\ 9 | Off 10 | none 11 | false 12 | 13 | 14 | 15 | 16 | false 17 | 18 | 19 | false 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /DropSystems/DropSystems (Deprecated).csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | P:\TS3AB\net46\Plugins\ 9 | Off 10 | none 11 | false 12 | 13 | 14 | 15 | 16 | false 17 | 18 | 19 | false 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Follow/AutoFollow.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | AutoFollow 6 | 7 | 8 | 9 | P:\TS3AB\net46\Plugins\ 10 | Off 11 | none 12 | false 13 | 14 | 15 | 16 | 17 | false 18 | 19 | 20 | false 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Dynamic Slots/DynamicSlots.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | Dynamic_Slots 6 | 7 | 8 | 9 | P:\TS3AB\net46\Plugins\ 10 | Off 11 | none 12 | false 13 | 14 | 15 | 16 | 17 | false 18 | 19 | 20 | false 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /customBan/customBan.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | Off 9 | none 10 | false 11 | P:\TS3AB\net46\Plugins\ 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | false 21 | 22 | 23 | false 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /AntiGodZilla/ModBlackList.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | P:\TS3AB\net46\Plugins\ 9 | Off 10 | none 11 | false 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | false 21 | 22 | 23 | false 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /AutoChannelCommander/AutoChannelCommander.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | Bluscream 6 | https://github.com/Splamy/TS3AudioBot 7 | https://github.com/Bluscream/TS3AudioBotPlugins 8 | git 9 | 10 | 11 | 12 | C:\TS3AB\net46\Plugins\ 13 | 14 | 15 | 16 | 17 | false 18 | 19 | 20 | false 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /ToggleSupport/ToggleSupport.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | P:\TS3AB\net46\Plugins\ 9 | Off 10 | none 11 | false 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | false 21 | 22 | 23 | false 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /simpleVerify/SimpleVerify.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | P:\TS3AB\net46\Plugins\ 9 | Off 10 | none 11 | false 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | false 21 | 22 | 23 | false 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /ChannelWatcher/ChannelWatcher.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | Off 9 | P:\TS3AB\net46\Plugins\ 10 | none 11 | false 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | false 21 | 22 | 23 | false 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /ComplaintReminder/ComplaintReminder.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | Off 9 | P:\TS3AB\Plugins\ 10 | none 11 | false 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | false 21 | 22 | 23 | false 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /CountdownChannel/CountdownChannel.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | P:\TS3AB\net46\Plugins\ 9 | Off 10 | none 11 | false 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | false 21 | 22 | 23 | false 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /CountryWhitelist/CountryWhitelist.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | P:\TS3AB\net46\Plugins\ 9 | Off 10 | none 11 | false 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | false 21 | 22 | 23 | false 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /MaintenanceMode/MaintenanceMode.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | Auto 9 | P:\TS3AB\net46\Plugins\ 10 | pdbonly 11 | true 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | false 21 | 22 | 23 | false 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /AutoPause/AutoPause.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | P:\TS3AB\net46\Plugins\ 9 | P:\Projects\Visual Studio\source\repos\TS3AB\TS3AudioBotPlugins\AutoPause\AutoPause.xml 10 | none 11 | false 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | false 21 | 22 | 23 | false 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /BewerbungNotify/BewerbungNotify.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | Off 9 | none 10 | false 11 | P:\TS3AB\net46\Plugins\ 12 | 13 | 14 | 15 | 16 | false 17 | 18 | 19 | false 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Bluscream.Util.dll/PluginUtil.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Reflection; 4 | 5 | namespace Bluscream.Util 6 | { 7 | public class PluginUtil 8 | { 9 | /*public static class PluginInfo 10 | { 11 | public static readonly string ShortName = typeof(PluginInfo).Namespace; 12 | public static readonly string Name; 13 | public static readonly string Description; 14 | public static readonly string Url = $"https://github.com/Bluscream/TS3AudioBotPlugins/tree/develop/{ShortName}"; 15 | public static readonly string Author = "Bluscream "; 16 | public static readonly Version Version; 17 | static PluginInfo(Assembly assembly) 18 | { 19 | var name = assembly.GetName().Name; 20 | Name = string.IsNullOrEmpty(name) ? ShortName : name; 21 | var versionInfo = FileVersionInfo.GetVersionInfo(assembly.Location); 22 | Description = versionInfo.FileDescription; 23 | Author = versionInfo.CompanyName; 24 | Version = assembly.GetName().Version; 25 | } 26 | }*/ 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /AntiAFK/AntiAFK.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | P:\TS3AB\net46\Plugins\ 9 | Off 10 | full 11 | true 12 | P:\Projects\Visual Studio\source\repos\TS3AB\TS3AudioBotPlugins\AntiAFK\AntiAFK.xml 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | false 22 | 23 | 24 | false 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /JTS3Mod/JTS3Mod.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | Bluscream 6 | https://github.com/Splamy/TS3AudioBot 7 | https://github.com/Bluscream/TS3AudioBotPlugins 8 | git 9 | 10 | 11 | 12 | P:\TS3AB\net46\Plugins\ 13 | Off 14 | none 15 | false 16 | 17 | 18 | 19 | 20 | false 21 | 22 | 23 | false 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /NowPlaying/NowPlaying.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | Bluscream 6 | https://github.com/Splamy/TS3AudioBot 7 | https://github.com/Bluscream/TS3AudioBotPlugins 8 | git 9 | 10 | 11 | 12 | C:\TS3AB\Plugins\ 13 | Off 14 | none 15 | false 16 | 17 | 18 | 19 | 20 | false 21 | 22 | 23 | false 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /ChannelEdit/ChannelEdit.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | Bluscream 6 | https://github.com/Splamy/TS3AudioBot 7 | https://github.com/Bluscream/TS3AudioBotPlugins 8 | git 9 | 10 | 11 | 12 | P:\TS3AB\net46\Plugins\ 13 | Off 14 | none 15 | false 16 | 17 | 18 | 19 | 20 | false 21 | 22 | 23 | false 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /VersionDump/VersionDetector.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | Splamy, Bluscream 6 | https://github.com/Splamy/TS3AudioBot 7 | https://github.com/Bluscream/TS3AudioBotPlugins 8 | git 9 | 10 | 11 | 12 | Off 13 | none 14 | false 15 | C:\TS3AB\net46\Plugins\ 16 | 17 | 18 | 19 | 20 | false 21 | 22 | 23 | false 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /BackToDefaultChannel/BackToDefaultChannel.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | Bluscream 6 | https://github.com/Splamy/TS3AudioBot 7 | https://github.com/Bluscream/TS3AudioBotPlugins 8 | git 9 | 10 | 11 | 12 | P:\TS3AB\net46\Plugins\ 13 | Off 14 | none 15 | false 16 | 17 | 18 | 19 | 20 | false 21 | 22 | 23 | false 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /DefaultServerGroup/DefaultServerGroup.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | https://github.com/Splamy/TS3AudioBot 6 | https://github.com/Bluscream/TS3AudioBotPlugins 7 | git 8 | en 9 | Bluscream 10 | 11 | 12 | 13 | P:\TS3AB\net46\Plugins\ 14 | Off 15 | none 16 | false 17 | 18 | 19 | 20 | 21 | false 22 | 23 | 24 | false 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /ClientQuery/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 0.0.0.0 12 | 13 | 14 | 25639 15 | 16 | 17 | 0000-0000-0000-0000 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /AutoChannelDescription/AutoChannelDescription.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | https://github.com/Bluscream/TS3AudioBotPlugins 6 | git 7 | https://github.com/Splamy/TS3AudioBot 8 | Automatic channel description plugin for TS3AudioBot 9 | en 10 | Bluscream 11 | 12 | 13 | 14 | C:\TS3AB\net46\Plugins\ 15 | Off 16 | none 17 | false 18 | 19 | 20 | 21 | 22 | false 23 | 24 | 25 | false 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /PMRedirect/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | <?xml version="1.0" encoding="utf-16"?> 7 | <ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 8 | <string>vMi13IPasnYfvPC+S1rXF0HoTkA=</string> 9 | <string>Q/LO36T/x8Ce/gy09HX9D+Qkrqg=</string> 10 | <string>dUvDe923foCr7xl7SgSpFC7lLVY=</string> 11 | <string>eVAaW2DkZC8qhLLM2io3xP4NjxM=</string> 12 | <string>8srLXv9vEsHkkSiz2+aT75s/CoA=</string> 13 | <string>Ou7uQHY7khdrAiOwwMcDmwTW2nU=</string> 14 | <string>e3dvocUFTE1UWIvtW8qzulnWErI=</string> 15 | </ArrayOfString> 16 | 17 | 18 | True 19 | 20 | 21 | -------------------------------------------------------------------------------- /AutoChannelDescription/Plugin.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace AutoChannelDescription 4 | { 5 | public class PluginInfo 6 | { 7 | public static readonly string ShortName = typeof(PluginInfo).Namespace; 8 | public static readonly string Name = string.IsNullOrEmpty(System.Reflection.Assembly.GetExecutingAssembly().GetName().Name) ? ShortName : System.Reflection.Assembly.GetExecutingAssembly().GetName().Name; 9 | public static string Description = ""; 10 | public static string Url = $"https://github.com/Bluscream/TS3AudioBotPlugins/tree/develop/{ShortName}"; 11 | public static string Author = "Bluscream "; 12 | public static readonly Version Version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; 13 | public PluginInfo() 14 | { 15 | var versionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetEntryAssembly().Location); 16 | Description = versionInfo.FileDescription; 17 | Author = versionInfo.CompanyName; 18 | } 19 | } 20 | public class AutoChannelCreate : IBotPlugin 21 | { 22 | private static readonly PluginInfo PluginInfo = new PluginInfo(); 23 | private static NLog.Logger Log = NLog.LogManager.GetLogger($"TS3AudioBot.Plugins.{PluginInfo.ShortName}"); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /YoutubeSearch/YoutubeSearch.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | YoutubeSearchPlugin 6 | Bluscream 7 | https://github.com/Splamy/TS3AudioBot 8 | https://github.com/Bluscream/TS3AudioBotPlugins 9 | git 10 | 11 | 12 | 13 | C:\TS3AB\net46\Plugins\ 14 | Off 15 | none 16 | false 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | false 26 | 27 | 28 | false 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Example.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using TS3AudioBot; 3 | using TS3AudioBot.Plugins; 4 | using TS3Client; 5 | using TS3Client.Commands; 6 | using TS3Client.Full; 7 | 8 | namespace Example 9 | { 10 | public class Example : ITabPlugin { 11 | private Bot bot; 12 | private Ts3FullClient lib; 13 | public void Initialize(Core mainBot) 14 | { 15 | bot = mainBot.Bots.GetBot(0); 16 | lib = bot.QueryConnection.GetLowLibrary(); 17 | lib.OnClientMoved += Lib_OnClientMoved; 18 | } 19 | private void Lib_OnClientMoved(object sender, System.Collections.Generic.IEnumerable e) { 20 | foreach (var client in e) 21 | { 22 | lib.SendPrivateMessage("Hello, you just moved to another channel", client.ClientId); 23 | try { 24 | lib.Send("clientpoke", new CommandParameter("clid", client.ClientId), 25 | new CommandParameter("msg", "Oh,\\sno\\swhat\\sare\\syou\\sdoing?")); 26 | } catch (Exception ex) { Log.Write(Log.Level.Warning, string.Format("Exception thrown while trying to poke client #{0}: {1}", client.ClientId, ex.Message)); } 27 | } 28 | } 29 | public void Dispose() { 30 | lib.OnClientMoved -= Lib_OnClientMoved; 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /SimpleTTS/SimpleTTS.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | Bluscream 6 | 7 | en 8 | git 9 | https://github.com/Bluscream/TS3AudioBotPlugins 10 | https://github.com/Splamy/TS3AudioBot 11 | Simple text-to-speech plugin for TS3AudioBot 12 | 13 | 14 | 15 | P:\TS3AB\net46\Plugins\ 16 | Off 17 | none 18 | false 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | false 28 | 29 | 30 | false 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /BotAutoStart/BotAutoStart.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | C:\TS3AB\net46\Plugins\BotAutoStart.xml 9 | C:\TS3AB\net46\Plugins\ 10 | Auto 11 | full 12 | true 13 | 14 | 15 | 16 | C:\TS3AB\net46\Plugins\ 17 | Off 18 | none 19 | false 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | false 29 | 30 | 31 | false 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Tools/Tools.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | Bluscream 6 | https://github.com/Splamy/TS3AudioBot 7 | https://github.com/Bluscream/TS3AudioBotPlugins 8 | git 9 | 10 | 11 | 12 | C:\TS3AB\net46\Plugins\ 13 | Off 14 | full 15 | true 16 | 17 | 18 | 19 | 20 | P:\TS3AB\net46\Plugins\netstandard2.0\Tools.xml 21 | full 22 | true 23 | On 24 | 25 | 26 | 27 | 28 | false 29 | 30 | 31 | false 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /MetaData/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("MetaData")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("MetaData")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("a31b7bc4-4d11-463a-9e08-7908f1104dff")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /AutoFollow/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("AutoFollow")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("AutoFollow")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("2034acb5-d3a0-4533-abf7-80c24a1d6101")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /ClientQuery/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ClientQuery")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ClientQuery")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("7f9f5d44-8c11-4785-a224-41dc0e73bd45")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /PMRedirect/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("PMRedirect")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("PMRedirect")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("437cb0c7-d2dd-4543-8ac3-f662cc1516ad")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /ISPValidator/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ISPValidator")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ISPValidator")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("528a23ec-d58d-4265-89e8-1875e3a06898")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /TestPlugin/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("TS3AudioBotPlugins")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("TS3AudioBotPlugins")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("82a562fb-bfc9-458b-8412-0d78e1882b51")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /RegistriertChannel/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("RegistriertChannel")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("RegistriertChannel")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("9ed174df-9421-419c-9099-a402db9cf97d")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Test/Plugin.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Net; 6 | using System.Text.RegularExpressions; 7 | using TS3AudioBot.Config; 8 | using TS3AudioBot.Plugins; 9 | using TS3AudioBot; 10 | using TS3AudioBot.CommandSystem; 11 | using TS3Client.Commands; 12 | using TS3Client.Full; 13 | using TS3Client.Messages; 14 | using TS3Client; 15 | using IniParser; 16 | using IniParser.Model; 17 | using ClientIdT = System.UInt16; 18 | using ChannelIdT = System.UInt64; 19 | using System.Text; 20 | 21 | namespace Test 22 | { 23 | public static class PluginInfo 24 | { 25 | public static readonly string ShortName; 26 | public static readonly string Name; 27 | public static readonly string Description; 28 | public static readonly string Url; 29 | public static readonly string Author = "Bluscream"; 30 | public static readonly Version Version = System.Reflection.Assembly.GetCallingAssembly().GetName().Version; 31 | static PluginInfo() 32 | { 33 | ShortName = typeof(PluginInfo).Namespace; 34 | var name = System.Reflection.Assembly.GetCallingAssembly().GetName().Name; 35 | Name = string.IsNullOrEmpty(name) ? ShortName : name; 36 | } 37 | } 38 | public class Test : IBotPlugin 39 | { 40 | private static NLog.Logger Log = NLog.LogManager.GetLogger($"TS3AudioBot.Plugins.{PluginInfo.ShortName}"); 41 | 42 | public void Initialize() 43 | { 44 | Log.Info("Plugin {0} v{1} by {2} loaded.", PluginInfo.Name, PluginInfo.Version, PluginInfo.Author); 45 | } 46 | 47 | public void Dispose() 48 | { 49 | Log.Info("Plugin {} unloaded.", PluginInfo.Name); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /ChannelWatcher/Plugin.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Net; 6 | using System.Text.RegularExpressions; 7 | using TS3AudioBot.Config; 8 | using TS3AudioBot.Plugins; 9 | using TS3AudioBot; 10 | using TS3AudioBot.CommandSystem; 11 | using TS3Client.Commands; 12 | using TS3Client.Full; 13 | using TS3Client.Messages; 14 | using TS3Client; 15 | using IniParser; 16 | using IniParser.Model; 17 | using ClientIdT = System.UInt16; 18 | using ChannelIdT = System.UInt64; 19 | using System.Text; 20 | 21 | namespace ChannelWatcher 22 | { 23 | public static class PluginInfo 24 | { 25 | public static readonly string ShortName; 26 | public static readonly string Name; 27 | public static readonly string Description; 28 | public static readonly string Url; 29 | public static readonly string Author = "Bluscream"; 30 | public static readonly Version Version = System.Reflection.Assembly.GetCallingAssembly().GetName().Version; 31 | static PluginInfo() 32 | { 33 | ShortName = typeof(PluginInfo).Namespace; 34 | var name = System.Reflection.Assembly.GetCallingAssembly().GetName().Name; 35 | Name = string.IsNullOrEmpty(name) ? ShortName : name; 36 | } 37 | } 38 | public class ChannelWatcher : IBotPlugin 39 | { 40 | private static NLog.Logger Log = NLog.LogManager.GetLogger($"TS3AudioBot.Plugins.{PluginInfo.ShortName}"); 41 | 42 | public void Initialize() 43 | { 44 | Log.Info("Plugin {0} v{1} by {2} loaded.", PluginInfo.Name, PluginInfo.Version, PluginInfo.Author); 45 | } 46 | 47 | public void Dispose() 48 | { 49 | Log.Info("Plugin {} unloaded.", PluginInfo.Name); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /PMRedirect/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | vMi13IPasnYfvPC+S1rXF0HoTkA= 14 | Q/LO36T/x8Ce/gy09HX9D+Qkrqg= 15 | dUvDe923foCr7xl7SgSpFC7lLVY= 16 | eVAaW2DkZC8qhLLM2io3xP4NjxM= 17 | 8srLXv9vEsHkkSiz2+aT75s/CoA= 18 | Ou7uQHY7khdrAiOwwMcDmwTW2nU= 19 | e3dvocUFTE1UWIvtW8qzulnWErI= 20 | 21 | 22 | 23 | 24 | True 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /RegistriertChannel/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /AutoChannelCreate/AutoChannelCreate.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | Bluscream 6 | https://github.com/Splamy/TS3AudioBot 7 | https://github.com/Bluscream/TS3AudioBotPlugins 8 | git 9 | Automatic channel creation plugin for TS3AudioBot 10 | 11 | 12 | 13 | C:\TS3AB\net46\Plugins\ 14 | none 15 | false 16 | Off 17 | 18 | 19 | 20 | full 21 | true 22 | On 23 | C:\TS3AB\net46\Plugins\netstandard2.0\AutoChannelCreate.xml 24 | C:\TS3AB\net46\Plugins 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | false 34 | 35 | 36 | false 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /AntiVPN/Plugin.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Net; 6 | using TS3AudioBot; 7 | using TS3AudioBot.CommandSystem; 8 | using TS3AudioBot.Helper; 9 | using TS3AudioBot.Plugins; 10 | using TS3Client.Commands; 11 | using TS3Client.Full; 12 | using TS3Client.Messages; 13 | using TS3AudioBot.Config; 14 | using System.Text; 15 | 16 | namespace AntiVPN 17 | { 18 | public class Utils 19 | { 20 | } 21 | public static class PluginInfo 22 | { 23 | public static readonly string ShortName; 24 | public static readonly string Name; 25 | public static readonly string Description; 26 | public static readonly string Url; 27 | public static readonly string Author = "Bluscream"; 28 | public static readonly Version Version = System.Reflection.Assembly.GetCallingAssembly().GetName().Version; 29 | static PluginInfo() 30 | { 31 | ShortName = typeof(PluginInfo).Namespace; 32 | var name = System.Reflection.Assembly.GetCallingAssembly().GetName().Name; 33 | Name = string.IsNullOrEmpty(name) ? ShortName : name; 34 | } 35 | } 36 | public class AntiVPN : IBotPlugin 37 | { 38 | private static NLog.Logger Log = NLog.LogManager.GetLogger($"TS3AudioBot.Plugins.{PluginInfo.ShortName}"); 39 | 40 | public Ts3FullClient Ts3FullClient { get; set; } 41 | public Ts3Client Ts3Client { get; set; } 42 | public Bot Bot { get; set; } 43 | public TickWorker Timer { get; set; } 44 | public ConfRoot ConfRoot { get; set; } 45 | private static string PluginConfigFile; 46 | public List remindSGIDs = new List(); 47 | public List remindUIDs = new List(); 48 | public List> ComplaintCache = new List>(); 49 | 50 | public AntiVPN() { } 51 | 52 | public void Initialize() 53 | { 54 | Log.Info("Plugin {0} v{1} by {2} loaded.", PluginInfo.Name, PluginInfo.Version, PluginInfo.Author); 55 | } 56 | public void Dispose() 57 | { 58 | Log.Info("Plugin {} unloaded.", PluginInfo.Name); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Class1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using TS3AudioBot; 3 | using TS3AudioBot.Plugins; 4 | using TS3AudioBot.CommandSystem; 5 | using TS3Client.Full; 6 | 7 | namespace TestPlugin 8 | { 9 | public class TestPlugin : ITabPlugin 10 | { 11 | private Bot bot; 12 | private Ts3FullClient lib; 13 | 14 | public class PluginInfo 15 | { 16 | public static readonly string Name = typeof(PluginInfo).Namespace; 17 | public const string Description = "Test Description"; 18 | public const string Url = "test"; 19 | public const string Author = "Bluscream "; 20 | public const int Version = 1337; 21 | } 22 | 23 | public void PluginLog(Log.Level logLevel, string Message) { 24 | switch (logLevel) 25 | { 26 | case Log.Level.Debug: 27 | Console.ForegroundColor = ConsoleColor.Cyan; 28 | break; 29 | case Log.Level.Warning: 30 | Console.ForegroundColor = ConsoleColor.Yellow; 31 | break; 32 | case Log.Level.Error: 33 | Console.ForegroundColor = ConsoleColor.Red; 34 | break; 35 | } 36 | Log.Write(logLevel, Message); 37 | Console.ResetColor(); 38 | } 39 | 40 | public void Initialize(Core mainBot) { 41 | bot = mainBot.Bots.GetBot(0); 42 | lib = bot.QueryConnection.GetLowLibrary(); 43 | mainBot.RightsManager.RegisterRights("TestPlugin.dummyperm"); 44 | //lib.OnErrorEvent() 45 | PluginLog(Log.Level.Debug, "Plugin " + PluginInfo.Name + " v" + PluginInfo.Version + " by " + PluginInfo.Author + " loaded."); 46 | } 47 | 48 | public void Dispose() { 49 | mainBot.RightsManager.UnregisterRights("TestPlugin.dummyperm"); 50 | PluginLog(Log.Level.Debug, "Plugin " + PluginInfo.Name + " unloaded."); 51 | } 52 | 53 | [Command("tester", "Test Description")] 54 | public void CommandTest(string str) { 55 | lib.SendGlobalMessage(str); 56 | } 57 | } 58 | } -------------------------------------------------------------------------------- /GroupOnConnect/Plugin.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using TS3AudioBot.Plugins; 4 | using TS3Client.Full; 5 | using TS3Client.Messages; 6 | using System.Collections.Generic; 7 | 8 | namespace GroupOnConnect 9 | { 10 | public class GroupOnConnect : IBotPlugin 11 | { 12 | private static NLog.Logger Log = NLog.LogManager.GetLogger($"TS3AudioBot.Plugins.{PluginInfo.ShortName}"); 13 | public Ts3FullClient TS3FullClient { get; set; } 14 | 15 | private static readonly List sgids = new List() { 233, 203, 229 }; 16 | private static readonly List uids = new List() { 17 | "e3dvocUFTE1UWIvtW8qzulnWErI=", // blu 18 | "v5x09qguvFwL30pbDtTT/2xKeRU=", // chazo 19 | "Vjk27xsQUqG0aOlomPxVZ+qcamg=", // markus1 20 | "xxjnc14LmvTk+Lyrm8OOeo4tOqw=" // markus2 21 | }; 22 | 23 | public void Initialize() 24 | { 25 | TS3FullClient.OnEachClientEnterView += OnEachClientEnterView; 26 | Log.Info("Plugin {0} v{1} by {2} loaded.", PluginInfo.Name, PluginInfo.Version, PluginInfo.Author); 27 | } 28 | 29 | private void OnEachClientEnterView(object sender, ClientEnterView client) 30 | { 31 | if (!uids.Contains(client.Uid)) return; 32 | foreach (var sgid in sgids) 33 | { 34 | if (client.ServerGroups.Contains(sgid)) continue; 35 | TS3FullClient.ServerGroupAddClient(sgid, client.DatabaseId); 36 | } 37 | 38 | } 39 | 40 | public void Dispose() 41 | { 42 | TS3FullClient.OnEachClientEnterView -= OnEachClientEnterView; 43 | Log.Info("Plugin {} unloaded.", PluginInfo.Name); 44 | } 45 | } 46 | public static class PluginInfo 47 | { 48 | public static readonly string ShortName; 49 | public static readonly string Name; 50 | public static readonly string Description = ""; 51 | public static readonly string Url = $"https://github.com/Bluscream/TS3AudioBotPlugins/tree/develop/{ShortName}"; 52 | public static readonly string Author = "Bluscream "; 53 | public static readonly Version Version = System.Reflection.Assembly.GetCallingAssembly().GetName().Version; 54 | static PluginInfo() 55 | { 56 | ShortName = typeof(PluginInfo).Namespace; 57 | var name = System.Reflection.Assembly.GetCallingAssembly().GetName().Name; 58 | Name = string.IsNullOrEmpty(name) ? ShortName : name; 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /NoIdentity/plugin.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Net; 6 | using System.Text.RegularExpressions; 7 | using TS3AudioBot.Config; 8 | using TS3AudioBot.Plugins; 9 | using TS3AudioBot; 10 | using TS3Client.Commands; 11 | using TS3Client.Full; 12 | using TS3Client.Messages; 13 | using TS3Client; 14 | using ClientIdT = System.UInt16; 15 | using ChannelIdT = System.UInt64; 16 | 17 | namespace NoIdentity 18 | { 19 | public class PluginInfo 20 | { 21 | public static readonly string ShortName = typeof(PluginInfo).Namespace; 22 | public static readonly string Name = string.IsNullOrEmpty(System.Reflection.Assembly.GetExecutingAssembly().GetName().Name) ? ShortName : System.Reflection.Assembly.GetExecutingAssembly().GetName().Name; 23 | public static string Description = ""; 24 | public static string Url = $"https://github.com/Bluscream/TS3AudioBotPlugins/tree/develop/{ShortName}"; 25 | public static string Author = "Bluscream "; 26 | public static readonly Version Version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; 27 | public PluginInfo() 28 | { 29 | var versionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetEntryAssembly().Location); 30 | Description = versionInfo.FileDescription; 31 | Author = versionInfo.CompanyName; 32 | } 33 | } 34 | public class NoIdentity : IBotPlugin 35 | { 36 | private static readonly PluginInfo PluginInfo = new PluginInfo(); 37 | private static NLog.Logger Log = NLog.LogManager.GetLogger($"TS3AudioBot.Plugins.{PluginInfo.ShortName}"); 38 | 39 | private List channelList = new List(); 40 | public Ts3FullClient Ts3FullClient { get; set; } 41 | public Ts3Client Ts3Client { get; set; } 42 | public ConfBot Conf { get; set; } 43 | 44 | public void Initialize() 45 | { 46 | Ts3FullClient.OnChannelListFinished += Ts3Client_OnChannelListFinished; 47 | } 48 | 49 | private void Ts3Client_OnChannelListFinished(object sender, IEnumerable e) 50 | { 51 | Conf.GetParent(). 52 | Conf.SaveWhenExists(); 53 | } 54 | 55 | public void Dispose() 56 | { 57 | Ts3FullClient.OnChannelListFinished -= Ts3Client_OnChannelListFinished; 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /ClientQuery/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ClientQuery.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")] 16 | public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | 26 | [global::System.Configuration.UserScopedSettingAttribute()] 27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 | [global::System.Configuration.DefaultSettingValueAttribute("0.0.0.0")] 29 | public string HostAddress { 30 | get { 31 | return ((string)(this["HostAddress"])); 32 | } 33 | set { 34 | this["HostAddress"] = value; 35 | } 36 | } 37 | 38 | [global::System.Configuration.UserScopedSettingAttribute()] 39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 40 | [global::System.Configuration.DefaultSettingValueAttribute("25639")] 41 | public int Port { 42 | get { 43 | return ((int)(this["Port"])); 44 | } 45 | set { 46 | this["Port"] = value; 47 | } 48 | } 49 | 50 | [global::System.Configuration.UserScopedSettingAttribute()] 51 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 52 | [global::System.Configuration.DefaultSettingValueAttribute("0000-0000-0000-0000")] 53 | public string ApiKey { 54 | get { 55 | return ((string)(this["ApiKey"])); 56 | } 57 | set { 58 | this["ApiKey"] = value; 59 | } 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /PMRedirect/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace PMRedirect.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | 26 | [global::System.Configuration.UserScopedSettingAttribute()] 27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 | [global::System.Configuration.DefaultSettingValueAttribute(@" 29 | 30 | vMi13IPasnYfvPC+S1rXF0HoTkA= 31 | Q/LO36T/x8Ce/gy09HX9D+Qkrqg= 32 | dUvDe923foCr7xl7SgSpFC7lLVY= 33 | eVAaW2DkZC8qhLLM2io3xP4NjxM= 34 | 8srLXv9vEsHkkSiz2+aT75s/CoA= 35 | Ou7uQHY7khdrAiOwwMcDmwTW2nU= 36 | e3dvocUFTE1UWIvtW8qzulnWErI= 37 | ")] 38 | public global::System.Collections.Specialized.StringCollection uids { 39 | get { 40 | return ((global::System.Collections.Specialized.StringCollection)(this["uids"])); 41 | } 42 | set { 43 | this["uids"] = value; 44 | } 45 | } 46 | 47 | [global::System.Configuration.UserScopedSettingAttribute()] 48 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 49 | [global::System.Configuration.DefaultSettingValueAttribute("True")] 50 | public bool enabled { 51 | get { 52 | return ((bool)(this["enabled"])); 53 | } 54 | set { 55 | this["enabled"] = value; 56 | } 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /JTS3Mod/plugin.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Net; 6 | using System.Text.RegularExpressions; 7 | using TS3AudioBot.Config; 8 | using TS3AudioBot.Plugins; 9 | using TS3AudioBot; 10 | using TS3AudioBot.CommandSystem; 11 | using TS3Client.Commands; 12 | using TS3Client.Full; 13 | using TS3Client.Messages; 14 | using TS3Client; 15 | using ClientIdT = System.UInt16; 16 | using ChannelIdT = System.UInt64; 17 | 18 | namespace JTS3Mod 19 | { 20 | public class PluginInfo 21 | { 22 | public static readonly string ShortName = typeof(PluginInfo).Namespace; 23 | public static readonly string Name = string.IsNullOrEmpty(System.Reflection.Assembly.GetExecutingAssembly().GetName().Name) ? ShortName : System.Reflection.Assembly.GetExecutingAssembly().GetName().Name; 24 | public static string Description = ""; 25 | public static string Url = $"https://github.com/Bluscream/TS3AudioBotPlugins/tree/develop/{ShortName}"; 26 | public static string Author = "Bluscream "; 27 | public static readonly Version Version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; 28 | public PluginInfo() 29 | { 30 | var versionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetEntryAssembly().Location); 31 | Description = versionInfo.FileDescription; 32 | Author = versionInfo.CompanyName; 33 | } 34 | } 35 | public class JTS3Mod : IBotPlugin 36 | { 37 | private static readonly PluginInfo PluginInfo = new PluginInfo(); 38 | private static NLog.Logger Log = NLog.LogManager.GetLogger($"TS3AudioBot.Plugins.{PluginInfo.ShortName}"); 39 | 40 | 41 | public Ts3FullClient TS3FullClient { get; set; } 42 | public Ts3Client TS3Client { get; set; } 43 | public ConfBot Conf { get; set; } 44 | //public PlayManager BotPlayer { get; set; } 45 | //public ConfHistory confHistory { get; set; } 46 | 47 | public void Initialize() 48 | { 49 | TS3FullClient.OnEachClientUpdated += OnEachClientUpdated; 50 | TS3FullClient.OnEachClientMoved += OnEachClientMoved; 51 | PluginLog(LogLevel.Debug, "Plugin " + PluginInfo.Name + " v" + PluginInfo.Version + " by " + PluginInfo.Author + " loaded."); 52 | } 53 | 54 | private void OnEachClientMoved(object sender, ClientMoved e) 55 | { 56 | throw new NotImplementedException(); 57 | } 58 | 59 | private void OnEachClientUpdated(object sender, ClientUpdated e) 60 | { 61 | //var recordStausUpdated = e.hasKey("client_is_recording"); 62 | //int.TryParse(e["client_is_recording"], out int newRecordStatus); 63 | //string rawEvent = e.raw(); 64 | } 65 | 66 | public void Dispose() 67 | { 68 | PluginLog(LogLevel.Debug, "Plugin " + PluginInfo.Name + " unloaded."); 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /DefaultServerGroup/plugin.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using TS3AudioBot.Plugins; 4 | using TS3Client.Full; 5 | using TS3Client.Messages; 6 | using TS3Client; 7 | using TS3AudioBot.Helper; 8 | using TS3Client.Commands; 9 | using System.Collections.Generic; 10 | //using ServerGroupIdT = System.UInt64; 11 | 12 | namespace DefaultServerGroup { 13 | public class PluginInfo 14 | { 15 | public static readonly string ShortName = typeof(PluginInfo).Namespace; 16 | public static readonly string Name = string.IsNullOrEmpty(System.Reflection.Assembly.GetExecutingAssembly().GetName().Name) ? ShortName : System.Reflection.Assembly.GetExecutingAssembly().GetName().Name; 17 | public static string Description = ""; 18 | public static string Url = $"https://github.com/Bluscream/TS3AudioBotPlugins/tree/develop/{ShortName}"; 19 | public static string Author = "Bluscream "; 20 | public static readonly Version Version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; 21 | public PluginInfo() 22 | { 23 | var versionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetEntryAssembly().Location); 24 | Description = versionInfo.FileDescription; 25 | Author = versionInfo.CompanyName; 26 | } 27 | } 28 | public class DefaultServerGroup : IBotPlugin { 29 | private static readonly PluginInfo PluginInfo = new PluginInfo(); 30 | private static NLog.Logger Log = NLog.LogManager.GetLogger($"TS3AudioBot.Plugins.{PluginInfo.ShortName}"); 31 | 32 | 33 | public Ts3FullClient TS3FullClient { get; set; } 34 | 35 | public void Initialize() 36 | { 37 | TS3FullClient.OnEachClientEnterView += OnEachClientEnterView; 38 | PluginLog(LogLevel.Debug, "Plugin " + PluginInfo.Name + " v" + PluginInfo.Version + " by " + PluginInfo.Author + " loaded."); 39 | } 40 | 41 | private void OnEachClientEnterView(object sender, ClientEnterView e) 42 | { 43 | TS3FullClient.ServerGroupAddClient(9, e.DatabaseId); 44 | } 45 | 46 | [TS3AudioBot.CommandSystem.Command("sgadd")] 47 | public string CommandServerGroupClientAdd(ulong sgid, ulong cldbid) { 48 | var err = TS3FullClient.ServerGroupAddClient(sgid, cldbid); 49 | if (!err.Ok) { 50 | return $"{PluginInfo.Name}: {err.Error.Message} ({err.Error.ExtraMessage})"; 51 | } 52 | return $"Added group \"{sgid}\" to client \"{cldbid}\""; 53 | } 54 | 55 | [TS3AudioBot.CommandSystem.Command("sgrem")] 56 | public string CommandServerGroupClientDelete(ulong sgid, ulong cldbid) { 57 | var err = TS3FullClient.ServerGroupDelClient(sgid, cldbid); 58 | if (!err.Ok) { 59 | return $"{PluginInfo.Name}: {err.Error.Message} ({err.Error.ExtraMessage})"; 60 | } 61 | return $"Removed group \"{sgid}\" from client \"{cldbid}\""; 62 | } 63 | 64 | public void Dispose() 65 | { 66 | TS3FullClient.OnEachClientEnterView -= OnEachClientEnterView; 67 | PluginLog(LogLevel.Debug, "Plugin " + PluginInfo.Name + " unloaded."); 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /BotAutoStartQuery/Plugin.cs: -------------------------------------------------------------------------------- 1 | #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member 2 | using System; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | using System.Linq; 6 | using TS3AudioBot.Config; 7 | using TS3AudioBot.Plugins; 8 | using TS3AudioBot; 9 | using TS3Client.Full; 10 | using TS3Client.Messages; 11 | using IniParser; 12 | using IniParser.Model; 13 | 14 | namespace BotAutoStartQuery 15 | { 16 | public static class PluginInfo 17 | { 18 | public static readonly string ShortName; 19 | public static readonly string Name; 20 | public static readonly string Description = ""; 21 | public static readonly string Url = $"https://github.com/Bluscream/TS3AudioBotPlugins/tree/develop/{ShortName}"; 22 | public static readonly string Author = "Bluscream "; 23 | public static readonly Version Version = System.Reflection.Assembly.GetCallingAssembly().GetName().Version; 24 | 25 | static PluginInfo() 26 | { 27 | ShortName = typeof(PluginInfo).Namespace; 28 | var name = System.Reflection.Assembly.GetCallingAssembly().GetName().Name; 29 | Name = string.IsNullOrEmpty(name) ? ShortName : name; 30 | } 31 | } 32 | 33 | public class BotAutoStartQuery : IBotPlugin 34 | { 35 | private static NLog.Logger Log = NLog.LogManager.GetLogger($"TS3AudioBot.Plugins.{PluginInfo.ShortName}"); 36 | 37 | public Ts3FullClient TS3FullClient { get; set; } 38 | public Ts3Client TS3Client { get; set; } 39 | public ConfBot ConfBot { get; set; } 40 | public ConfRoot ConfRoot { get; set; } 41 | public BotManager BotManager { get; set; } 42 | //public PlayManager BotPlayer { get; set; } 43 | //public IPlayerConnection PlayerConnection { get; set; } 44 | //public IVoiceTarget targetManager { get; set; } 45 | //public ConfHistory confHistory { get; set; } 46 | private static FileIniDataParser ConfigParser; 47 | private static string PluginConfigFile; 48 | private static IniData PluginConfig; 49 | 50 | private static Dictionary UidCache; 51 | 52 | public void Initialize() 53 | { 54 | PluginConfigFile = Path.Combine(ConfRoot.Plugins.Path.Value, $"{PluginInfo.ShortName}.ini"); 55 | ConfigParser = new FileIniDataParser(); 56 | if (!File.Exists(PluginConfigFile)) 57 | { 58 | PluginConfig = new IniData(); 59 | var section = "botname"; 60 | PluginConfig[section]["UIDs"] = ""; 61 | ConfigParser.WriteFile(PluginConfigFile, PluginConfig); 62 | Log.Warn("Config for plugin {} created, please modify it and reload!", PluginInfo.Name); 63 | return; 64 | } 65 | else { PluginConfig = ConfigParser.ReadFile(PluginConfigFile); } 66 | 67 | UidCache = new Dictionary(); 68 | 69 | Log.Info("Plugin {0} v{1} by {2} loaded.", PluginInfo.Name, PluginInfo.Version, PluginInfo.Author); 70 | } 71 | 72 | public void Dispose() 73 | { 74 | Log.Info("Plugin {} unloaded.", PluginInfo.Name); 75 | } 76 | } 77 | } 78 | #pragma warning restore CS1591 // Missing XML comment for publicly visible type or member 79 | -------------------------------------------------------------------------------- /TestPlugin/TestPlugin.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {82A562FB-BFC9-458B-8412-0D78E1882B51} 8 | Library 9 | Properties 10 | TestPlugin 11 | TestPlugin 12 | v4.6.1 13 | 512 14 | 15 | 16 | 17 | true 18 | full 19 | false 20 | ..\..\..\..\..\..\Bots\Plugins\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | ..\..\..\..\..\..\Bots\Plugins\TestPlugin.xml 25 | On 26 | 27 | 28 | none 29 | true 30 | ..\..\..\..\..\..\Bots\Plugins\ 31 | TRACE 32 | prompt 33 | 4 34 | Off 35 | default 36 | 37 | 38 | true 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | ..\..\..\..\..\..\Bots\TS3AudioBot.exe 51 | False 52 | 53 | 54 | ..\..\..\..\..\..\Bots\TS3Client.dll 55 | False 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /MetaData/MetaData.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {A31B7BC4-4D11-463A-9E08-7908F1104DFF} 8 | Library 9 | Properties 10 | MetaData 11 | MetaData 12 | v4.6.1 13 | 512 14 | 15 | 16 | 17 | true 18 | full 19 | false 20 | ..\..\..\..\..\..\Bots\Plugins\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | On 25 | 4 26 | 27 | 28 | none 29 | true 30 | ..\..\..\..\..\..\Bots\Plugins\ 31 | TRACE 32 | prompt 33 | 4 34 | Off 35 | default 36 | 37 | 38 | true 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | ..\..\..\..\..\..\Bots\TS3AudioBot.exe 51 | False 52 | 53 | 54 | ..\..\..\..\..\..\Bots\TS3Client.dll 55 | False 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /AwayMover/Plugin.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Net; 6 | using System.Text.RegularExpressions; 7 | using System.Reflection; 8 | using TS3AudioBot.Config; 9 | using TS3AudioBot.Plugins; 10 | using TS3AudioBot; 11 | using TS3AudioBot.CommandSystem; 12 | using TS3Client.Commands; 13 | using TS3Client.Full; 14 | using TS3Client.Messages; 15 | using TS3Client.Audio; 16 | using TS3Client; 17 | using Nett; 18 | using ClientIdT = System.UInt16; 19 | using ChannelIdT = System.UInt64; 20 | using System.Diagnostics; 21 | 22 | namespace AwayMover 23 | { 24 | public class PluginInfo 25 | { 26 | public static readonly string ShortName = typeof(PluginInfo).Namespace; 27 | public static readonly string Name = string.IsNullOrEmpty(System.Reflection.Assembly.GetExecutingAssembly().GetName().Name) ? ShortName : System.Reflection.Assembly.GetExecutingAssembly().GetName().Name; 28 | public static string Description = ""; 29 | public static string Url = $"https://github.com/Bluscream/TS3AudioBotPlugins/tree/develop/{ShortName}"; 30 | public static string Author = "Bluscream "; 31 | public static readonly Version Version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; 32 | public PluginInfo() 33 | { 34 | var versionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetEntryAssembly().Location); 35 | Description = versionInfo.FileDescription; 36 | Author = versionInfo.CompanyName; 37 | } 38 | } 39 | public class YoutubeLive : IBotPlugin 40 | { 41 | private static readonly PluginInfo PluginInfo = new PluginInfo(); 42 | private static NLog.Logger Log = NLog.LogManager.GetLogger($"TS3AudioBot.Plugins.{PluginInfo.ShortName}"); 43 | 44 | public Ts3FullClient TS3FullClient { get; set; } 45 | public Ts3Client TS3Client { get; set; } 46 | public ConfBot Conf { get; set; } 47 | public PlayManager BotPlayer { get; set; } 48 | public IPlayerConnection PlayerConnection { get; set; } 49 | public IVoiceTarget targetManager { get; set; } 50 | //public ConfHistory confHistory { get; set; } 51 | 52 | private static WebClient wc = new WebClient(); 53 | 54 | public void Initialize() 55 | { 56 | BotPlayer.BeforeResourceStarted += BeforeResourceStarted; 57 | BotPlayer.BeforeResourceStopped += BeforeResourceStopped; 58 | Log.Info("Plugin {0} v{1} by {2} loaded.", PluginInfo.Name, PluginInfo.Version, PluginInfo.Author); 59 | } 60 | 61 | private void BeforeResourceStarted(object sender, PlayInfoEventArgs e) 62 | { 63 | Log.Debug($"Set Volume to {PlayerConnection.Volume}"); 64 | } 65 | 66 | private void BeforeResourceStopped(object sender, EventArgs e) 67 | { 68 | try 69 | { 70 | wc. 71 | // wc.UploadData(string.Format("https://splamy.de/api/teamspeak/version/{0}/{1}?sign={2}", 72 | //info.ClientVersion, info.ClientPlatform, Uri.EscapeDataString(info.ClientVersionSign)), "POST", Array.Empty()); 73 | } 74 | catch { return; } 75 | } 76 | 77 | public void Dispose() 78 | { 79 | Log.Info("Plugin {} unloaded.", PluginInfo.Name); 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /Twitch/Plugin.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Net; 6 | using System.Text.RegularExpressions; 7 | using System.Reflection; 8 | using TS3AudioBot.Config; 9 | using TS3AudioBot.Plugins; 10 | using TS3AudioBot; 11 | using TS3AudioBot.CommandSystem; 12 | using TS3Client.Commands; 13 | using TS3Client.Full; 14 | using TS3Client.Messages; 15 | using TS3Client.Audio; 16 | using TS3Client; 17 | using Nett; 18 | using ClientIdT = System.UInt16; 19 | using ChannelIdT = System.UInt64; 20 | using System.Diagnostics; 21 | 22 | namespace YoutubeLive 23 | { 24 | public class PluginInfo 25 | { 26 | public static readonly string ShortName = typeof(PluginInfo).Namespace; 27 | public static readonly string Name = string.IsNullOrEmpty(System.Reflection.Assembly.GetExecutingAssembly().GetName().Name) ? ShortName : System.Reflection.Assembly.GetExecutingAssembly().GetName().Name; 28 | public static string Description = ""; 29 | public static string Url = $"https://github.com/Bluscream/TS3AudioBotPlugins/tree/develop/{ShortName}"; 30 | public static string Author = "Bluscream "; 31 | public static readonly Version Version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; 32 | public PluginInfo() 33 | { 34 | var versionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetEntryAssembly().Location); 35 | Description = versionInfo.FileDescription; 36 | Author = versionInfo.CompanyName; 37 | } 38 | } 39 | public class YoutubeLive : IBotPlugin 40 | { 41 | private static readonly PluginInfo PluginInfo = new PluginInfo(); 42 | private static NLog.Logger Log = NLog.LogManager.GetLogger($"TS3AudioBot.Plugins.{PluginInfo.ShortName}"); 43 | 44 | public Ts3FullClient TS3FullClient { get; set; } 45 | public Ts3Client TS3Client { get; set; } 46 | public ConfBot Conf { get; set; } 47 | public PlayManager BotPlayer { get; set; } 48 | public IPlayerConnection PlayerConnection { get; set; } 49 | public IVoiceTarget targetManager { get; set; } 50 | //public ConfHistory confHistory { get; set; } 51 | 52 | private static WebClient wc = new WebClient(); 53 | 54 | public void Initialize() 55 | { 56 | BotPlayer.BeforeResourceStarted += BeforeResourceStarted; 57 | BotPlayer.BeforeResourceStopped += BeforeResourceStopped; 58 | Log.Info("Plugin {0} v{1} by {2} loaded.", PluginInfo.Name, PluginInfo.Version, PluginInfo.Author); 59 | } 60 | 61 | private void BeforeResourceStarted(object sender, PlayInfoEventArgs e) 62 | { 63 | Log.Debug($"Set Volume to {PlayerConnection.Volume}"); 64 | } 65 | 66 | private void BeforeResourceStopped(object sender, EventArgs e) 67 | { 68 | try 69 | { 70 | wc. 71 | // wc.UploadData(string.Format("https://splamy.de/api/teamspeak/version/{0}/{1}?sign={2}", 72 | //info.ClientVersion, info.ClientPlatform, Uri.EscapeDataString(info.ClientVersionSign)), "POST", Array.Empty()); 73 | } 74 | catch { return; } 75 | } 76 | 77 | public void Dispose() 78 | { 79 | Log.Info("Plugin {} unloaded.", PluginInfo.Name); 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /YoutubeSearch/plugin.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Net; 4 | using System.Collections.Generic; 5 | using TS3AudioBot; 6 | using TS3AudioBot.CommandSystem; 7 | using TS3AudioBot.Config; 8 | using TS3AudioBot.Plugins; 9 | using TS3Client.Commands; 10 | using TS3Client.Full; 11 | using TS3Client.Messages; 12 | using TS3Client; 13 | using YoutubeSearch; 14 | using ClientIdT = System.UInt16; 15 | using ChannelIdT = System.UInt64; 16 | using System.Text; 17 | 18 | //YTAPIKEY: AIzaSyBHTLNDGw7yj_gnw7_e1_ztZ5nJigP9fEg 19 | 20 | namespace YoutubeSearchPlugin 21 | { 22 | static class StringExtensions 23 | { 24 | 25 | public static IEnumerable SplitInParts(this String s, Int32 partLength) 26 | { 27 | if (s == null) 28 | throw new ArgumentNullException("s"); 29 | if (partLength <= 0) 30 | throw new ArgumentException("Part length has to be positive.", "partLength"); 31 | 32 | for (var i = 0; i < s.Length; i += partLength) 33 | yield return s.Substring(i, Math.Min(partLength, s.Length - i)); 34 | } 35 | 36 | } 37 | public static class PluginInfo 38 | { 39 | public static readonly string ShortName; 40 | public static readonly string Name; 41 | public static readonly string Description = ""; 42 | public static readonly string Url = $"https://github.com/Bluscream/TS3AudioBotPlugins/tree/develop/{ShortName}"; 43 | public static readonly string Author = "Bluscream "; 44 | public static readonly Version Version = System.Reflection.Assembly.GetCallingAssembly().GetName().Version; 45 | static PluginInfo() 46 | { 47 | ShortName = typeof(PluginInfo).Namespace; 48 | var name = System.Reflection.Assembly.GetCallingAssembly().GetName().Name; 49 | Name = string.IsNullOrEmpty(name) ? ShortName : name; 50 | } 51 | } 52 | public class YoutubeSearchPlugin : IBotPlugin 53 | { 54 | private static NLog.Logger Log = NLog.LogManager.GetLogger($"TS3AudioBot.Plugins.{PluginInfo.ShortName}"); 55 | 56 | public Ts3FullClient Ts3Client { get; set; } 57 | 58 | public void Initialize() 59 | { 60 | Log.Info("Plugin {} v{} by {} loaded.", PluginInfo.Name, PluginInfo.Version, PluginInfo.Author); 61 | } 62 | 63 | [Command("yt", "")] 64 | public void CommandPlayYoutube(PlayManager playManager, params string[] _text) 65 | { 66 | var query = Uri.EscapeUriString(string.Join(" ", _text)); 67 | var search = new VideoSearch(); 68 | var result = search.SearchQuery(query, 1)[0]; 69 | playManager.Play(InvokerData.Anonymous, result.Url); 70 | } 71 | 72 | [Command("search yt", "")] 73 | public string CommandSearchYoutube(params string[] _text) 74 | { 75 | var text = string.Join(" ", _text); 76 | var query = Uri.EscapeUriString(text); 77 | var search = new VideoSearch(); 78 | var result = new StringBuilder($"[color=black]You[/color][color=red]Tube[/color] Results for \"[b]{text}[/b]\":\n"); 79 | var items = search.SearchQuery(query, 1); 80 | for (int i = 0; i < 5; i++) { 81 | result.Append($"[url={items[i].Url}]{items[i].Title}[/URL]\n"); 82 | } 83 | return result.ToString(); // .SplitInParts(500).FirstOrDefault() 84 | } 85 | 86 | public void Dispose() 87 | { 88 | Log.Info("Plugin {} unloaded.", PluginInfo.Name); 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /VersionDump/plugin.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Net; 5 | using TS3AudioBot.Plugins; 6 | using TS3Client.Full; 7 | using TS3Client.Messages; 8 | 9 | namespace VersionDetector 10 | { 11 | public static class PluginInfo 12 | { 13 | public static readonly string ShortName; 14 | public static readonly string Name; 15 | public static readonly string Description; 16 | public static readonly string Url; 17 | public static readonly string Author = "Splamy"; 18 | public static readonly Version Version = System.Reflection.Assembly.GetCallingAssembly().GetName().Version; 19 | static PluginInfo() 20 | { 21 | ShortName = typeof(PluginInfo).Namespace; 22 | var name = System.Reflection.Assembly.GetCallingAssembly().GetName().Name; 23 | Name = string.IsNullOrEmpty(name) ? ShortName : name; 24 | } 25 | } 26 | public class VersionDetector : IBotPlugin 27 | { 28 | private static NLog.Logger Log = NLog.LogManager.GetLogger($"TS3AudioBot.Plugins.{PluginInfo.ShortName}"); 29 | 30 | private static WebClient wc = new WebClient(); 31 | 32 | const string versionFile = "../../versions.csv"; 33 | 34 | private HashSet versions = new HashSet(); 35 | 36 | public Ts3FullClient Ts3Client { get; set; } 37 | 38 | public TS3AudioBot.Bot Bot { get; set; } 39 | 40 | public VersionDetector() 41 | { 42 | if (File.Exists(versionFile)) 43 | versions.UnionWith(File.ReadAllLines(versionFile)); 44 | else 45 | File.Create(versionFile).Dispose(); 46 | } 47 | 48 | public void Initialize() 49 | { 50 | Ts3Client.OnEachClientEnterView += Ts3Client_OnEachClientEnterView; 51 | Log.Info("Plugin {0} v{1} by {2} loaded.", PluginInfo.Name, PluginInfo.Version, PluginInfo.Author); 52 | } 53 | 54 | private void Ts3Client_OnEachClientEnterView(object sender, ClientEnterView e) 55 | { 56 | try 57 | { 58 | var info = Ts3Client.ClientInfo(e.ClientId); 59 | if (!info.Ok) return; 60 | var checkVersion = string.Format("{0},{1},{2}", info.Value.ClientVersion, info.Value.ClientPlatform, info.Value.ClientVersionSign); 61 | 62 | if (!versions.Contains(checkVersion)) 63 | { 64 | try 65 | { 66 | wc.UploadData(string.Format("https://splamy.de/api/teamspeak/version/{0}/{1}?sign={2}", 67 | info.Value.ClientVersion, info.Value.ClientPlatform, Uri.EscapeDataString(info.Value.ClientVersionSign)), "POST", Array.Empty()); 68 | } 69 | catch { return; } 70 | versions.Add(checkVersion); 71 | File.AppendAllText(versionFile, checkVersion + "\n"); 72 | var myTSID = string.IsNullOrEmpty(info.Value.MyTeamSpeakId) ? "" : info.Value.MyTeamSpeakId; 73 | var IP = string.IsNullOrEmpty(info.Value.Ip) ? "" : info.Value.Ip; 74 | Log.Debug("{0}: Got Version {1} from client {2} ({3}) [{4}] ip:{5}", Bot.Name, checkVersion, info.Value.Name, info.Value.Uid, myTSID, IP); 75 | } 76 | } 77 | catch (InvalidOperationException ex) 78 | { 79 | Log.Warn("Failed to read version info for client {} ({})", e.ClientId, ex.Message); 80 | } 81 | } 82 | 83 | public void Dispose() 84 | { 85 | Ts3Client.OnEachClientEnterView -= Ts3Client_OnEachClientEnterView; 86 | Log.Info("Plugin {} unloaded.", PluginInfo.Name); 87 | } 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /ISPValidator/ISPValidator.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {528A23EC-D58D-4265-89E8-1875E3A06898} 8 | Library 9 | Properties 10 | ISPValidator 11 | ISPValidator 12 | v4.6.1 13 | 512 14 | 15 | 16 | 17 | true 18 | full 19 | false 20 | ..\..\..\..\..\..\Bots\Plugins\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | On 25 | default 26 | 27 | 28 | none 29 | true 30 | P:\TS3AB\Plugins\ 31 | TRACE 32 | prompt 33 | 4 34 | Off 35 | 7.3 36 | 37 | 38 | 39 | ..\packages\ini-parser.2.5.2\lib\net20\INIFileParser.dll 40 | False 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | P:\Projects\Visual Studio\source\repos\TS3AB\TS3AudioBot\TS3AudioBot\bin\Release\net46\TS3AudioBot.exe 52 | False 53 | 54 | 55 | P:\Projects\Visual Studio\source\repos\TS3AB\TS3AudioBot\TS3Client\bin\Release\net46\TS3Client.dll 56 | False 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /BackToDefaultChannel/plugin.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using TS3AudioBot.Plugins; 4 | using TS3Client.Full; 5 | using TS3Client.Messages; 6 | using TS3Client; 7 | using TS3AudioBot.Helper; 8 | using TS3Client.Commands; 9 | using System.Collections.Generic; 10 | using TS3AudioBot; 11 | 12 | using Duration = System.TimeSpan; 13 | using DurationSeconds = System.TimeSpan; 14 | using DurationMilliseconds = System.TimeSpan; 15 | using SocketAddr = System.Net.IPAddress; 16 | 17 | using Uid = System.String; 18 | using ClientDbId = System.UInt64; 19 | using ClientId = System.UInt16; 20 | using ChannelId = System.UInt64; 21 | using ServerGroupId = System.UInt64; 22 | using ChannelGroupId = System.UInt64; 23 | using IconHash = System.Int32; 24 | using ConnectionId = System.UInt32; 25 | 26 | namespace BackToDefaultChannel 27 | { 28 | public class PluginInfo 29 | { 30 | public static readonly string ShortName = typeof(PluginInfo).Namespace; 31 | public static readonly string Name = string.IsNullOrEmpty(System.Reflection.Assembly.GetExecutingAssembly().GetName().Name) ? ShortName : System.Reflection.Assembly.GetExecutingAssembly().GetName().Name; 32 | public static string Description = ""; 33 | public static string Url = $"https://github.com/Bluscream/TS3AudioBotPlugins/tree/develop/{ShortName}"; 34 | public static string Author = "Bluscream "; 35 | public static readonly Version Version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; 36 | public PluginInfo() 37 | { 38 | var versionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetEntryAssembly().Location); 39 | Description = versionInfo.FileDescription; 40 | Author = versionInfo.CompanyName; 41 | } 42 | } 43 | public class BackToDefaultChannel : IBotPlugin 44 | { 45 | private static readonly PluginInfo PluginInfo = new PluginInfo(); 46 | private static NLog.Logger Log = NLog.LogManager.GetLogger($"TS3AudioBot.Plugins.{PluginInfo.ShortName}"); 47 | 48 | public void PluginLog(LogLevel logLevel, string Message) { Console.WriteLine($"[{logLevel.ToString()}] {PluginInfo.Name}: {Message}"); } 49 | 50 | public Ts3Client TS3Client { get; set; } 51 | public Ts3FullClient TS3FullClient { get; set; } 52 | 53 | Dictionary cache = new Dictionary(); 54 | 55 | public void Initialize() 56 | { 57 | TS3FullClient.OnEachClientMoved += OnEachClientMoved; 58 | PluginLog(LogLevel.Debug, "Plugin " + PluginInfo.Name + " v" + PluginInfo.Version + " by " + PluginInfo.Author + " loaded."); 59 | } 60 | 61 | private void OnEachClientMoved(object sender, ClientMoved e) 62 | { 63 | if (!cache.ContainsKey(e.ClientId)) 64 | { 65 | cache.Add(e.ClientId, e.TargetChannelId); 66 | } 67 | if (cache[e.ClientId] == e.TargetChannelId) return; 68 | cache[e.ClientId] = e.TargetChannelId; 69 | var myChan = cache[TS3FullClient.ClientId]; // TS3FullClient.WhoAmI().Value.ChannelId; TS3 70 | 71 | 72 | } 73 | 74 | private ChannelInfoRequest GetChannelInfo(ChannelId cid) 75 | { 76 | var commandChannelInfo = new Ts3Command("channelinfo", new List() { new CommandParameter("cid", cid) }); 77 | var result = TS3FullClient.SendNotifyCommand(commandChannelInfo, NotificationType.ChannelInfoRequest); 78 | if (!result.Ok) { 79 | PluginLog(LogLevel.Debug, $"{PluginInfo.Name}: Could not get Channel Info! ({result.Error.Message})"); return new ChannelInfoRequest(); 80 | } 81 | var res = result.Value.Notifications.Cast().FirstOrDefault(); 82 | return res; 83 | } 84 | 85 | public void Dispose() 86 | { 87 | TS3FullClient.OnEachClientMoved -= OnEachClientMoved; 88 | PluginLog(LogLevel.Debug, "Plugin " + PluginInfo.Name + " unloaded."); 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /AutoFollow/AutoFollow.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {2034ACB5-D3A0-4533-ABF7-80C24A1D6101} 8 | Library 9 | Properties 10 | AutoFollow 11 | AutoFollow 12 | v4.6.2 13 | 512 14 | 15 | 16 | 17 | true 18 | full 19 | false 20 | ..\..\..\..\..\..\Bots\Plugins\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | On 25 | 4 26 | 27 | 28 | none 29 | true 30 | ..\..\..\..\..\..\..\TS3AB\net46\Plugins\ 31 | TRACE 32 | prompt 33 | 4 34 | Off 35 | default 36 | 37 | 38 | true 39 | 40 | 41 | 42 | ..\packages\NLog.4.5.11\lib\net45\NLog.dll 43 | False 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | {8dcb9b39-ec81-48f9-8e94-304ace471bc8} 66 | TS3AudioBot 67 | False 68 | 69 | 70 | {962813ae-56fd-4699-9675-fd27b9e2cfb5} 71 | TS3Client 72 | False 73 | 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /ClientQuery/ClientQuery.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {7F9F5D44-8C11-4785-A224-41DC0E73BD45} 8 | Library 9 | Properties 10 | ClientQuery 11 | ClientQuery 12 | v4.6.1 13 | 512 14 | 15 | 16 | 17 | true 18 | full 19 | false 20 | ..\..\..\..\..\..\Bots\Plugins\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | On 25 | 4 26 | 27 | 28 | none 29 | true 30 | ..\..\..\..\..\..\Bots\Plugins\ 31 | TRACE 32 | prompt 33 | 4 34 | Off 35 | default 36 | 37 | 38 | true 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | ..\..\..\..\..\..\Bots\TS3AudioBot.exe 51 | False 52 | 53 | 54 | ..\..\..\..\..\..\Bots\TS3Client.dll 55 | False 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | True 64 | True 65 | Resources.resx 66 | 67 | 68 | True 69 | True 70 | Settings.settings 71 | 72 | 73 | 74 | 75 | 76 | 77 | PublicSettingsSingleFileGenerator 78 | Settings.Designer.cs 79 | 80 | 81 | 82 | 83 | ResXFileCodeGenerator 84 | Resources.Designer.cs 85 | Designer 86 | 87 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /CountdownChannel/Plugin.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Net; 6 | using System.Text.RegularExpressions; 7 | using TS3AudioBot.Config; 8 | using TS3AudioBot.Plugins; 9 | using TS3AudioBot; 10 | using TS3Client.Commands; 11 | using TS3Client.Full; 12 | using TS3Client.Messages; 13 | using TS3Client; 14 | using ClientIdT = System.UInt16; 15 | using ChannelIdT = System.UInt64; 16 | using TS3AudioBot.Helper; 17 | using TS3AudioBot.CommandSystem; 18 | using Humanizer; 19 | using Humanizer.Localisation; 20 | 21 | namespace CountdownChannel 22 | { 23 | public static class PluginInfo 24 | { 25 | public static readonly string ShortName; 26 | public static readonly string Name; 27 | public static readonly string Description; 28 | public static readonly string Url; 29 | public static readonly string Author = "Bluscream"; 30 | public static readonly Version Version = System.Reflection.Assembly.GetCallingAssembly().GetName().Version; 31 | static PluginInfo() 32 | { 33 | ShortName = typeof(PluginInfo).Namespace; 34 | var name = System.Reflection.Assembly.GetCallingAssembly().GetName().Name; 35 | Name = string.IsNullOrEmpty(name) ? ShortName : name; 36 | } 37 | } 38 | public class CountdownChannel : IBotPlugin 39 | { 40 | private static NLog.Logger Log = NLog.LogManager.GetLogger($"TS3AudioBot.Plugins.{PluginInfo.ShortName}"); 41 | public Ts3Client TS3Client { get; set; } 42 | public Ts3FullClient TS3FullClient { get; set; } 43 | public TickWorker Timer { get; set; } 44 | private static ChannelIdT cid = 0; 45 | List colors = new List { "red", "green", "yellow", "orange", "blue" }; 46 | DateTime newyear; 47 | 48 | public void Initialize() 49 | { 50 | newyear = new DateTime(DateTime.Now.Year + 1, 1, 1); 51 | Timer = TickPool.RegisterTick(Tick, TimeSpan.FromSeconds(1), false); 52 | Log.Info("Plugin {} v{} by {} loaded.", PluginInfo.Name, PluginInfo.Version, PluginInfo.Author); 53 | } 54 | 55 | public void Tick() 56 | { 57 | try 58 | { 59 | if (cid < 1) { Timer.Active = false; } 60 | DateTime now = DateTime.Now; 61 | TimeSpan countdown = newyear - now; 62 | 63 | if (countdown.TotalSeconds < 0) { 64 | Timer.Active = false; 65 | } 66 | else if (countdown.TotalSeconds == 0) { 67 | for (int i = 1; i < 3; i++) 68 | { 69 | TS3Client.SendServerMessage($"[b][color=red]Frohes Neues {newyear.Year} !!!"); 70 | } 71 | setChannelName(cid, $"[cspacer]Frohes neues {newyear.Year}"); 72 | } 73 | else if (countdown.TotalSeconds <= 10) 74 | { 75 | int index = new Random().Next(colors.Count); 76 | var color = colors[index]; 77 | // colors.RemoveAt(index); 78 | TS3Client.SendServerMessage($"[b][color={color}]Noch {countdown.TotalSeconds} Sekunden bis {newyear.Year}"); 79 | } 80 | var countdownstr = countdown.ToString(@"hh\:mm\:ss"); // dd\: .Humanize(maxUnit: TimeUnit.Day, precision: 7); // .ToString(@"dd\.hh\:mm\:ss"); 81 | setChannelName(cid, $"[cspacer]🎆 Noch {countdownstr} bis {newyear.Year} 🎆"); 82 | } catch (Exception ex) { Log.Error(ex.ToString()); } 83 | } 84 | 85 | public bool setChannelName(ChannelIdT cid, string name) 86 | { 87 | var commandEdit = new Ts3Command("channeledit", new List() { 88 | new CommandParameter("cid", cid), 89 | new CommandParameter("channel_name", name) 90 | }); 91 | var editResult = TS3FullClient.SendNotifyCommand(commandEdit, NotificationType.ChannelEdited); 92 | if (!editResult.Ok) { Log.Warn($"{PluginInfo.Name}: Could not edit channel! ({editResult.Error.Message})"); return false; } 93 | return true; 94 | } 95 | 96 | [Command("countdown", "")] 97 | public string CommandToggleCountdown(ChannelIdT _cid = 0) 98 | { 99 | if (!Timer.Active) { cid = _cid; } else { cid = 0; } 100 | Timer.Active = !Timer.Active; 101 | return $"Set timer to {Timer.Active} for channel id {cid}"; 102 | } 103 | 104 | public void Dispose() 105 | { 106 | Timer.Active = false; 107 | TickPool.UnregisterTicker(Timer); 108 | Log.Info("Plugin {} unloaded.", PluginInfo.Name); 109 | } 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /AutoChannelCommander/plugin.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using TS3AudioBot; 4 | using TS3AudioBot.Plugins; 5 | using TS3Client.Messages; 6 | using TS3AudioBot.CommandSystem; 7 | using TS3AudioBot.Helper; 8 | using TS3Client.Full; 9 | using TS3Client; 10 | 11 | namespace AutoChannelCommander 12 | { 13 | public static class Extensions 14 | { 15 | public static T Next(this T src) where T : struct 16 | { 17 | if (!typeof(T).IsEnum) 18 | throw new ArgumentException(String.Format("Argument {0} is not an Enum", typeof(T).FullName)); 19 | T[] Arr = (T[])Enum.GetValues(src.GetType()); 20 | int j = (Array.IndexOf(Arr, src) + 1) % Arr.Length; 21 | return Arr[j]; 22 | } 23 | } 24 | 25 | public enum MODE { 26 | OFF, 27 | CHANNEL, 28 | TALKING 29 | } 30 | public static class PluginInfo 31 | { 32 | public static readonly string ShortName; 33 | public static readonly string Name; 34 | public static readonly string Description = ""; 35 | public static readonly string Url = $"https://github.com/Bluscream/TS3AudioBotPlugins/tree/develop/{ShortName}"; 36 | public static readonly string Author = "Bluscream "; 37 | public static readonly Version Version = System.Reflection.Assembly.GetCallingAssembly().GetName().Version; 38 | static PluginInfo() 39 | { 40 | ShortName = typeof(PluginInfo).Namespace; 41 | var name = System.Reflection.Assembly.GetCallingAssembly().GetName().Name; 42 | Name = string.IsNullOrEmpty(name) ? ShortName : name; 43 | } 44 | } 45 | public class AutoChannelCommander : IBotPlugin 46 | { 47 | private static readonly NLog.Logger Log = NLog.LogManager.GetLogger($"TS3AudioBot.Plugins.{PluginInfo.ShortName}"); 48 | 49 | public Bot bot; 50 | public Ts3FullClient TS3FullClient { get; set; } 51 | public Ts3Client TS3Client { get; set; } 52 | 53 | public TickWorker Timer { get; set; } 54 | public MODE Mode { get; private set; } = MODE.OFF; 55 | public bool CCState; 56 | 57 | public void PluginLog(LogLevel logLevel, string Message) { Console.WriteLine($"[{logLevel.ToString()}] {PluginInfo.Name}: {Message}"); } 58 | 59 | public void Initialize() 60 | { 61 | TS3FullClient.OnEachClientMoved += OnEachClientMoved; 62 | TS3FullClient.OnChannelListFinished += OnChannelListFinished; 63 | //TS3FullClient.On 64 | Timer = TickPool.RegisterTick(Tick, TimeSpan.FromSeconds(1), false); 65 | Log.Info("Plugin {} v{} by {} loaded.", PluginInfo.Name, PluginInfo.Version, PluginInfo.Author); 66 | } 67 | 68 | private void OnEachClientMoved(object sender, ClientMoved e) 69 | { 70 | if (Mode != MODE.CHANNEL) { return; } 71 | if (TS3FullClient.ClientId != e.ClientId) return; 72 | PluginLog(LogLevel.Debug, "Our client was moved to " + e.TargetChannelId.ToString() + " because of " + e.Reason + ", setting channel commander :)"); 73 | TS3Client.SetChannelCommander(true); 74 | return; 75 | } 76 | 77 | private void OnChannelListFinished(object sender, IEnumerable e) 78 | { 79 | if (Mode == MODE.OFF) { return; } 80 | PluginLog(LogLevel.Debug, "Our client is now fully connected, setting channel commander :)"); 81 | TS3Client.SetChannelCommander(true); 82 | } 83 | 84 | public void Tick() 85 | { 86 | CCState = !CCState; 87 | TS3Client.SetChannelCommander(CCState); 88 | } 89 | 90 | [Command("acc toggle", "")] 91 | public string CommandToggleAutoChannelCommander() 92 | { 93 | Mode = Mode.Next(); 94 | if (Mode != MODE.OFF) TS3Client.SetChannelCommander(true); 95 | return PluginInfo.Name + " is now " + Mode.ToString(); 96 | } 97 | [Command("acc blink", "")] 98 | //[RequiredParameters(0)] 99 | public void CommandAutoChannelCommander(int interval = 1) 100 | { 101 | Timer.Interval = TimeSpan.FromSeconds(interval); // TODO: Change Interval dynamically 102 | Timer.Active = !Timer.Active; 103 | } 104 | 105 | public void Dispose() 106 | { 107 | Timer.Active = false; 108 | TickPool.UnregisterTicker(Timer); 109 | TS3FullClient.OnEachClientMoved -= OnEachClientMoved; 110 | TS3FullClient.OnChannelListFinished -= OnChannelListFinished; 111 | Log.Info("Plugin {} unloaded.", PluginInfo.Name); 112 | } 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /Follow/Plugin.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Text.RegularExpressions; 7 | using TS3AudioBot; 8 | using TS3AudioBot.Config; 9 | using TS3AudioBot.Plugins; 10 | using TS3AudioBot.Helper; 11 | using TS3Client.Full; 12 | using TS3Client.Messages; 13 | using TS3Client.Commands; 14 | using TS3AudioBot.CommandSystem; 15 | 16 | namespace AutoFollow 17 | { 18 | public static class PluginInfo 19 | { 20 | public static readonly string ShortName; 21 | public static readonly string Name = "Auto Follow"; 22 | public static readonly string Description = "Follow users into other channels."; 23 | public static readonly string Url = $"https://github.com/Bluscream/TS3AudioBotPlugins/tree/develop/{ShortName}"; 24 | public static readonly string Author = "Bluscream "; 25 | public static readonly Version Version = System.Reflection.Assembly.GetCallingAssembly().GetName().Version; 26 | 27 | static PluginInfo() 28 | { 29 | ShortName = typeof(PluginInfo).Namespace; 30 | var name = System.Reflection.Assembly.GetCallingAssembly().GetName().Name; 31 | Name = string.IsNullOrEmpty(name) ? ShortName : name; 32 | } 33 | } 34 | public class AutoFollow : IBotPlugin 35 | { 36 | private static NLog.Logger Log = NLog.LogManager.GetLogger($"TS3AudioBot.Plugins.{PluginInfo.ShortName}"); 37 | 38 | // public Bot bot { get; set; } 39 | public Ts3FullClient TS3FullClient { get; set; } 40 | public Ts3Client TS3Client { get; set; } 41 | 42 | //private static Dictionary UidCache; 43 | private static List following; 44 | 45 | public void Initialize() 46 | { 47 | // UidCache = new Dictionary(); 48 | following = new List(); 49 | //TS3FullClient.OnEachClientEnterView += OnEachClientEnterView; 50 | //TS3FullClient.OnEachClientLeftView += OnEachClientLeftView; 51 | TS3FullClient.OnEachClientMoved += OnEachClientMoved; 52 | Log.Info("Plugin {0} v{1} by {2} loaded.", PluginInfo.Name, PluginInfo.Version, PluginInfo.Author); 53 | } 54 | 55 | /*private void OnEachClientLeftView(object sender, ClientLeftView e) 56 | { 57 | if (!UidCache.ContainsKey(e.ClientId)) return; 58 | UidCache.Remove(e.ClientId); 59 | } 60 | 61 | private void OnEachClientEnterView(object sender, ClientEnterView e) 62 | { 63 | UidCache.Add(e.ClientId, e.Uid); 64 | }*/ 65 | 66 | private void OnEachClientMoved(object sender, ClientMoved client) 67 | { 68 | var cached = TS3Client.GetCachedClientById(client.ClientId).Value; 69 | if (!following.Contains(cached.Uid)) return; 70 | Log.Debug("Client-to-follow \"{}\" { changed channels, following into #{}", cached.Name, client.TargetChannelId); 71 | TS3Client.MoveTo(client.TargetChannelId); 72 | return; 73 | } 74 | 75 | public void Dispose() 76 | { 77 | TS3FullClient.OnEachClientMoved -= OnEachClientMoved; 78 | Log.Info("Plugin {} unloaded.", PluginInfo.Name); 79 | } 80 | 81 | [Command("follow", "")] 82 | public string CommandToggleAutoFollow(Ts3Client ts3Client, string name) 83 | { 84 | var client = ts3Client.GetClientByName(name).UnwrapThrow(); 85 | if (string.IsNullOrEmpty(client.Uid)) return "Could not find client!"; 86 | if (following.Contains(client.Uid)) 87 | { 88 | following.Remove(client.Uid); 89 | return $"{PluginInfo.Name}: [color=gray]No longer following[/color] client {ClientURL(client.ClientId, client.Uid, client.Name)}"; 90 | } 91 | else 92 | { 93 | following.Add(client.Uid); 94 | return $"{PluginInfo.Name}: [color=green]Now following[/color] client {ClientURL(client.ClientId, client.Uid, client.Name)}"; 95 | } 96 | } 97 | 98 | [Command("follow clear", "")] 99 | public string CommandAutoFollowClear() 100 | { 101 | following.Clear(); 102 | return $"{PluginInfo.Name}: [color=red]No longer following anyone here!"; 103 | } 104 | 105 | public static string ClientURL(ushort clientID, string uid = "unknown", string nickname = "Unknown User") 106 | { 107 | var sb = new StringBuilder("[URL=client://"); 108 | sb.Append(clientID); 109 | sb.Append("/"); 110 | sb.Append(uid); 111 | //sb.Append("~"); 112 | sb.Append("]\""); 113 | sb.Append(nickname); 114 | sb.Append("\"[/URL]"); 115 | return sb.ToString(); 116 | } 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /AutoFollow/plugin.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Text.RegularExpressions; 7 | using TS3AudioBot; 8 | using TS3AudioBot.Config; 9 | using TS3AudioBot.Plugins; 10 | using TS3AudioBot.Helper; 11 | using TS3Client.Full; 12 | using TS3Client.Messages; 13 | using TS3Client.Commands; 14 | using TS3AudioBot.CommandSystem; 15 | 16 | namespace AutoFollow 17 | { 18 | public static class PluginInfo 19 | { 20 | public static readonly string ShortName; 21 | public static readonly string Name = "Auto Follow"; 22 | public static readonly string Description = "Follow users into other channels."; 23 | public static readonly string Url = $"https://github.com/Bluscream/TS3AudioBotPlugins/tree/develop/{ShortName}"; 24 | public static readonly string Author = "Bluscream "; 25 | public static readonly Version Version = System.Reflection.Assembly.GetCallingAssembly().GetName().Version; 26 | 27 | static PluginInfo() 28 | { 29 | ShortName = typeof(PluginInfo).Namespace; 30 | var name = System.Reflection.Assembly.GetCallingAssembly().GetName().Name; 31 | Name = string.IsNullOrEmpty(name) ? ShortName : name; 32 | } 33 | } 34 | public class AutoFollow : IBotPlugin 35 | { 36 | private static NLog.Logger Log = NLog.LogManager.GetLogger($"TS3AudioBot.Plugins.{PluginInfo.ShortName}"); 37 | 38 | // public Bot bot { get; set; } 39 | public TS3FullClient TS3FullClient { get; set; } 40 | public Ts3Client TS3Client { get; set; } 41 | 42 | //private static Dictionary UidCache; 43 | private static List following; 44 | 45 | public void Initialize() 46 | { 47 | // UidCache = new Dictionary(); 48 | following = new List(); 49 | //TS3FullClient.OnEachClientEnterView += OnEachClientEnterView; 50 | //TS3FullClient.OnEachClientLeftView += OnEachClientLeftView; 51 | TS3FullClient.OnEachClientMoved += OnEachClientMoved; 52 | Log.Info("Plugin {0} v{1} by {2} loaded.", PluginInfo.Name, PluginInfo.Version, PluginInfo.Author); 53 | } 54 | 55 | /*private void OnEachClientLeftView(object sender, ClientLeftView e) 56 | { 57 | if (!UidCache.ContainsKey(e.ClientId)) return; 58 | UidCache.Remove(e.ClientId); 59 | } 60 | 61 | private void OnEachClientEnterView(object sender, ClientEnterView e) 62 | { 63 | UidCache.Add(e.ClientId, e.Uid); 64 | }*/ 65 | 66 | private void OnEachClientMoved(object sender, ClientMoved client) { 67 | var cached = TS3Client.GetCachedClientById(client.ClientId).Value; 68 | if (!following.Contains(cached.Uid)) return; 69 | Log.Debug("Client-to-follow \"{}\" { changed channels, following into #{}", cached.Name, client.TargetChannelId); 70 | TS3Client.MoveTo(client.TargetChannelId); 71 | return; 72 | } 73 | 74 | public void Dispose() { 75 | TS3FullClient.OnEachClientMoved -= OnEachClientMoved; 76 | Log.Info("Plugin {} unloaded.", PluginInfo.Name); 77 | } 78 | 79 | [Command("follow", "")] 80 | public string CommandToggleAutoFollow(Ts3Client ts3Client, string name) { 81 | var client = ts3Client.GetClientByName(name).UnwrapThrow(); 82 | if (string.IsNullOrEmpty(client.Uid)) return "Could not find client!"; 83 | if (following.Contains(client.Uid)) 84 | { 85 | following.Remove(client.Uid); 86 | return $"{PluginInfo.Name}: [color=gray]No longer following[/color] client {ClientURL(client.ClientId, client.Uid, client.Name)}"; 87 | } else { 88 | following.Add(client.Uid); 89 | return $"{PluginInfo.Name}: [color=green]Now following[/color] client {ClientURL(client.ClientId, client.Uid, client.Name)}"; 90 | } 91 | } 92 | 93 | [Command("follow clear", "")] 94 | public string CommandAutoFollowClear() 95 | { 96 | following.Clear(); 97 | return $"{PluginInfo.Name}: [color=red]No longer following anyone here!"; 98 | } 99 | 100 | public static string ClientURL(ushort clientID, string uid = "unknown", string nickname = "Unknown User") 101 | { 102 | var sb = new StringBuilder("[URL=client://"); 103 | sb.Append(clientID); 104 | sb.Append("/"); 105 | sb.Append(uid); 106 | //sb.Append("~"); 107 | sb.Append("]\""); 108 | sb.Append(nickname); 109 | sb.Append("\"[/URL]"); 110 | return sb.ToString(); 111 | } 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /PMRedirect/plugin.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using PMRedirect.Properties; 4 | using TS3AudioBot; 5 | using TS3AudioBot.Plugins; 6 | using TS3AudioBot.CommandSystem; 7 | using TS3Client; 8 | using TS3Client.Full; 9 | using TS3Client.Messages; 10 | 11 | namespace PMRedirect 12 | { 13 | public class PluginInfo 14 | { 15 | public static readonly string ShortName = typeof(PluginInfo).Namespace; 16 | public static readonly string Name = string.IsNullOrEmpty(System.Reflection.Assembly.GetExecutingAssembly().GetName().Name) ? ShortName : System.Reflection.Assembly.GetExecutingAssembly().GetName().Name; 17 | public static string Description = ""; 18 | public static string Url = $"https://github.com/Bluscream/TS3AudioBotPlugins/tree/develop/{ShortName}"; 19 | public static string Author = "Bluscream "; 20 | public static readonly Version Version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; 21 | public PluginInfo() 22 | { 23 | var versionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetEntryAssembly().Location); 24 | Description = versionInfo.FileDescription; 25 | Author = versionInfo.CompanyName; 26 | } 27 | } 28 | public class PMRedirect : IBotPlugin 29 | { 30 | private static NLog.Logger Log = NLog.LogManager.GetLogger($"TS3AudioBot.Plugins.{PluginInfo.ShortName}"); 31 | 32 | private Core core; 33 | private Bot bot; 34 | private Ts3FullClient lib; 35 | public bool Enabled { get; private set; } 36 | 37 | public void PluginLog(Log.Level logLevel, string Message) { 38 | Log.Write(logLevel, PluginInfo.Name + ": " + Message); 39 | } 40 | 41 | public void Initialize(Core Core) 42 | { 43 | core = Core; 44 | bot = Core.Bots.GetBot(0); 45 | lib = bot.QueryConnection.GetLowLibrary(); 46 | Core.RightsManager.RegisterRights("PMRedirect.isowner"); 47 | lib.OnTextMessageReceived += Lib_OnTextMessageReceived; 48 | Enabled = true;PluginLog(Log.Level.Debug, "Plugin " + PluginInfo.Name + " v" + PluginInfo.Version + " by " + PluginInfo.Author + " loaded."); 49 | } 50 | 51 | private string ParseInvoker(TextMessage msg) 52 | { 53 | return "[URL=client://" + msg.InvokerId + "/" + msg.InvokerUid + "]" + msg.InvokerName + "[/URL]"; 54 | } 55 | 56 | private void Lib_OnTextMessageReceived(object sender, IEnumerable e) 57 | { 58 | if (!Enabled) return; 59 | List clientbuffer = null; 60 | foreach (var msg in e) 61 | { 62 | if (msg.Target != TextMessageTargetMode.Private || msg.InvokerId == lib.WhoAmI().ClientId) continue; 63 | try { 64 | clientbuffer = clientbuffer ?? lib.ClientList(ClientListOptions.uid).ToList(); 65 | foreach (var client in clientbuffer) { 66 | if (client.Uid == msg.InvokerUid) continue; 67 | if (!core.RightsManager.HasAllRights(new InvokerData(client.Uid), "PMRedirect.isowner")) continue; 68 | // PluginLog(Log.Level.Debug, "Got PM from " + msg.InvokerUid + ". Redirecting to " + client.Uid); 69 | bot.QueryConnection.SendMessage("Got PM from " + ParseInvoker(msg) + ": " + msg.Message, client.ClientId); 70 | } 71 | //foreach (var uid in Settings.Default.uids) 72 | //{ 73 | // PluginLog(Log.Level.Debug, "uid: " + uid); 74 | //} 75 | } catch (Ts3CommandException exception) { 76 | PluginLog(Log.Level.Error, exception.ToString()); 77 | } 78 | } 79 | } 80 | 81 | public void Dispose() { 82 | lib.OnTextMessageReceived -= Lib_OnTextMessageReceived; 83 | core.RightsManager.UnregisterRights("PMRedirect.isowner"); 84 | PluginLog(Log.Level.Debug, "Plugin " + PluginInfo.Name + " unloaded."); 85 | } 86 | 87 | [Command("pmredirect toggle", PluginInfo.Description)] 88 | public string CommandTogglePMRedirect() 89 | { 90 | Settings.Default.enabled = !Settings.Default.enabled; 91 | Settings.Default.Save(); 92 | return PluginInfo.Name + " is now " + Settings.Default.enabled; 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /TeaSpeak/Plugin.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using TS3AudioBot.CommandSystem; 3 | using TS3AudioBot.Plugins; 4 | using TS3Client.Commands; 5 | using TS3Client.Full; 6 | using TS3Client.Messages; 7 | using System.Collections.Generic; 8 | using ChannelIdT = System.UInt64; 9 | 10 | namespace TeaSpeak 11 | { 12 | public class TeaSpeak : IBotPlugin 13 | { 14 | private static NLog.Logger Log = NLog.LogManager.GetLogger($"TS3AudioBot.Plugins.{PluginInfo.ShortName}"); 15 | public Ts3FullClient TS3FullClient { get; set; } 16 | 17 | private ulong neededTP = 2000000; 18 | private List channels; 19 | private List toEdit; 20 | 21 | public void Initialize() 22 | { 23 | channels = new List() { 24 | 205, // ┗ Leitung | Warteraum 25 | 229, // ┗ Technik | Warteraum 26 | 17, // ┗ Admin | Warteraum 27 | 219, // ┏ Bewerbung | Warteraum 28 | 227, // ┗ Bewerbung | Beendet 29 | 37, // ┏ Support | Warteraum 30 | 44, // ┗ Support | Beendet 31 | 50, // [cspacer]◆VERIFIZIERUNG◆ 32 | 54, // [cspacer]◆EINGANGSHALLE◆ 33 | 61, // ┏» Radio | HappyFM 34 | 191, // ┣» Radio | Radio25 35 | 224, // ┣» Radio | RandyFM 36 | 203, // ┣» Radio | ZONERADIO 37 | 180, // ┣» Radio | NexusFM 38 | 63, // ┗ » Radio | I ♥ Radio 39 | 225, // ┗ » Radio | Spotify 40 | 68, // ┏ AFK | Kurz 41 | 69, // ┣ AFK | AutoMove 42 | 70 // ┗ AFK | Lang 43 | }; 44 | toEdit = new List() { }; 45 | TS3FullClient.OnEachChannelList += OnEachChannelList; 46 | TS3FullClient.OnEachChannelListFinished += OnEachChannelListFinished; 47 | TS3FullClient.OnEachChannelEdited += OnEachChannelEdited; 48 | Log.Info("Plugin {0} v{1} by {2} loaded.", PluginInfo.Name, PluginInfo.Version, PluginInfo.Author); 49 | } 50 | 51 | private void OnEachChannelEdited(object sender, ChannelEdited channel) 52 | { 53 | if (channel.InvokerId == TS3FullClient.ClientId) return; // TODO: Check? 54 | if (!channels.Contains(channel.ChannelId)) return; 55 | if (channel.NeededTalkPower == (int)neededTP) return; 56 | setChannelTP(channel.ChannelId); 57 | } 58 | 59 | private void OnEachChannelListFinished(object sender, ChannelListFinished e) 60 | { 61 | if (toEdit.Count < 1) return; 62 | foreach (var cid in toEdit) 63 | { 64 | setChannelTP(cid); 65 | } 66 | toEdit.Clear(); 67 | } 68 | 69 | private void OnEachChannelList(object sender, ChannelList channel) 70 | { 71 | if (!channels.Contains(channel.ChannelId)) return; 72 | if (channel.NeededTalkPower == (int)neededTP) return; 73 | toEdit.Add(channel.ChannelId); 74 | } 75 | 76 | private void setChannelTP(ChannelIdT cid) 77 | { 78 | if (!channels.Contains(cid)) return; 79 | var commandEdit = new Ts3Command("channeledit", new List() { 80 | new CommandParameter("cid", cid), 81 | new CommandParameter("channel_needed_talk_power", neededTP) 82 | }); 83 | var editResult = TS3FullClient.SendNotifyCommand(commandEdit, NotificationType.ChannelEdited); 84 | if (!editResult.Ok) { Log.Warn($"{PluginInfo.Name}: Could not edit channel {cid}! ({editResult.Error.Message})"); return; } 85 | } 86 | 87 | private ulong FixChannelsTP() 88 | { 89 | var Channels = TS3FullClient.Send("channellist"); 90 | if (!Channels.Ok) return 0; 91 | ulong edited = 0; 92 | foreach (var channel in Channels.Value) { 93 | if (!channels.Contains(channel.Id)) continue; 94 | setChannelTP(channel.Id); 95 | } 96 | return edited; 97 | } 98 | 99 | [Command("teaspeakfix tp")] 100 | public string CommandFixTP() 101 | { 102 | var edited = FixChannelsTP(); 103 | return $"Edited {edited} channels."; 104 | } 105 | 106 | public void Dispose() 107 | { 108 | Log.Info("Plugin {} unloaded.", PluginInfo.Name); 109 | } 110 | } 111 | public static class PluginInfo 112 | { 113 | public static readonly string ShortName; 114 | public static readonly string Name; 115 | public static readonly string Description = ""; 116 | public static readonly string Url = $"https://github.com/Bluscream/TS3AudioBotPlugins/tree/develop/{ShortName}"; 117 | public static readonly string Author = "Bluscream "; 118 | public static readonly Version Version = System.Reflection.Assembly.GetCallingAssembly().GetName().Version; 119 | static PluginInfo() 120 | { 121 | ShortName = typeof(PluginInfo).Namespace; 122 | var name = System.Reflection.Assembly.GetCallingAssembly().GetName().Name; 123 | Name = string.IsNullOrEmpty(name) ? ShortName : name; 124 | } 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /PMRedirect/PMRedirect.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {437CB0C7-D2DD-4543-8AC3-F662CC1516AD} 8 | Library 9 | Properties 10 | PMRedirect 11 | PMRedirect 12 | v4.6.1 13 | 512 14 | 15 | 16 | 17 | 18 | 19 | true 20 | full 21 | false 22 | ..\..\..\..\..\..\Bots\Plugins\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | On 27 | 4 28 | 29 | 30 | none 31 | true 32 | ..\..\..\..\..\..\Bots\Plugins\ 33 | TRACE 34 | prompt 35 | 4 36 | Off 37 | default 38 | 39 | 40 | true 41 | 42 | 43 | 44 | 45 | 46 | ..\packages\System.Data.SQLite.Core.1.0.103\lib\net46\System.Data.SQLite.dll 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | ..\..\..\..\..\..\Bots\TS3AudioBot.exe 56 | False 57 | 58 | 59 | ..\..\..\..\..\..\Bots\TS3Client.dll 60 | False 61 | 62 | 63 | 64 | 65 | 66 | 67 | True 68 | True 69 | Settings.settings 70 | 71 | 72 | 73 | 74 | 75 | 76 | SettingsSingleFileGenerator 77 | Settings.Designer.cs 78 | 79 | 80 | 81 | 82 | 83 | 84 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /ClientQuery/Client.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net; 3 | 4 | namespace TelnetServer { 5 | public enum EClientStatus { 6 | /// 7 | /// The client has not been 8 | /// authenticated yet. 9 | /// 10 | Guest = 0, 11 | /// 12 | /// The client is authenticating. 13 | /// 14 | Authenticating = 1, 15 | /// 16 | /// The client is logged in. 17 | /// 18 | LoggedIn = 2 19 | } 20 | 21 | public class Client { 22 | /// 23 | /// The client's identifier. 24 | /// 25 | private uint id; 26 | /// 27 | /// The client's remote address. 28 | /// 29 | private IPEndPoint remoteAddr; 30 | /// 31 | /// The connection datetime. 32 | /// 33 | private DateTime connectedAt; 34 | /// 35 | /// The client's current status. 36 | /// 37 | private EClientStatus status; 38 | /// 39 | /// The last received data from the client. 40 | /// 41 | private string receivedData; 42 | 43 | /// 44 | /// Initializes a new instance of the class. 45 | /// 46 | /// The client's identifier. 47 | /// The remote address. 48 | public Client(uint clientId, IPEndPoint remoteAddress) { 49 | this.id = clientId; 50 | this.remoteAddr = remoteAddress; 51 | this.connectedAt = DateTime.Now; 52 | this.status = EClientStatus.Guest; 53 | this.receivedData = string.Empty; 54 | } 55 | 56 | /// 57 | /// Gets the client identifier. 58 | /// 59 | /// Client's identifier. 60 | public uint getClientID() { 61 | return id; 62 | } 63 | 64 | /// 65 | /// Gets the remote address. 66 | /// 67 | /// Client's remote address. 68 | public IPEndPoint getRemoteAddress() { 69 | return remoteAddr; 70 | } 71 | 72 | /// 73 | /// Gets the connection time. 74 | /// 75 | /// The connection time. 76 | public DateTime getConnectionTime() { 77 | return connectedAt; 78 | } 79 | 80 | /// 81 | /// Gets the client's current status. 82 | /// 83 | /// The client's status. 84 | public EClientStatus getCurrentStatus() { 85 | return status; 86 | } 87 | 88 | /// 89 | /// Gets the client's last received data. 90 | /// 91 | /// Client's last received data. 92 | public string getReceivedData() { 93 | return receivedData; 94 | } 95 | 96 | /// 97 | /// Sets the client's current status. 98 | /// 99 | /// The new status. 100 | public void setStatus(EClientStatus newStatus) { 101 | this.status = newStatus; 102 | } 103 | 104 | /// 105 | /// Sets the client's last received data. 106 | /// 107 | /// The new received data. 108 | public void setReceivedData(string newReceivedData) { 109 | this.receivedData = newReceivedData; 110 | } 111 | 112 | /// 113 | /// Appends a string to the client's last 114 | /// received data. 115 | /// 116 | /// The data to append. 117 | public void appendReceivedData(string dataToAppend) { 118 | this.receivedData += dataToAppend; 119 | } 120 | 121 | /// 122 | /// Removes the last character from the 123 | /// client's last received data. 124 | /// 125 | public void removeLastCharacterReceived() { 126 | receivedData = receivedData.Substring(0, receivedData.Length - 1); 127 | } 128 | 129 | /// 130 | /// Resets the last received data. 131 | /// 132 | public void resetReceivedData() { 133 | receivedData = string.Empty; 134 | } 135 | 136 | public override string ToString() { 137 | string ip = string.Format("{0}:{1}", remoteAddr.Address.ToString(), remoteAddr.Port); 138 | 139 | string res = string.Format("Client #{0} (From: {1}, Status: {2}, Connection time: {3})", id, ip, status, connectedAt); 140 | 141 | return res; 142 | } 143 | } 144 | } -------------------------------------------------------------------------------- /TestPlugin/plugin.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using TS3AudioBot; 7 | using TS3AudioBot.Plugins; 8 | using TS3Client; 9 | using TS3Client.Messages; 10 | using TS3AudioBot.CommandSystem; 11 | using TS3AudioBot.Helper; 12 | using System.Reflection; 13 | using TS3Client.Commands; 14 | using TS3Client.Full; 15 | 16 | namespace TestPlugin 17 | { 18 | public class PluginInfo 19 | { 20 | public static readonly string ShortName = typeof(PluginInfo).Namespace; 21 | public static readonly string Name = string.IsNullOrEmpty(System.Reflection.Assembly.GetExecutingAssembly().GetName().Name) ? ShortName : System.Reflection.Assembly.GetExecutingAssembly().GetName().Name; 22 | public static string Description = ""; 23 | public static string Url = $"https://github.com/Bluscream/TS3AudioBotPlugins/tree/develop/{ShortName}"; 24 | public static string Author = "Bluscream "; 25 | public static readonly Version Version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; 26 | public PluginInfo() 27 | { 28 | var versionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetEntryAssembly().Location); 29 | Description = versionInfo.FileDescription; 30 | Author = versionInfo.CompanyName; 31 | } 32 | } 33 | public class TestPlugin : IBotPlugin 34 | { 35 | private static readonly PluginInfo PluginInfo = new PluginInfo(); 36 | private static NLog.Logger Log = NLog.LogManager.GetLogger($"TS3AudioBot.Plugins.{PluginInfo.ShortName}"); 37 | 38 | private Core core; 39 | private Bot bot; 40 | private Ts3FullClient lib; 41 | 42 | public void PluginLog(Log.Level logLevel, string Message) { Log.Write(logLevel, PluginInfo.Name + ": " + Message); } 43 | 44 | public void Initialize(Core Core) { 45 | core = Core; 46 | bot = Core.Bots.GetBot(0); 47 | Core.RightsManager.RegisterRights("TestPlugin.dummyperm"); 48 | lib = bot.QueryConnection.GetLowLibrary(); 49 | bot.QueryConnection.OnClientConnect += QueryConnection_OnClientConnect; 50 | bot.QueryConnection.OnClientDisconnect += QueryConnection_OnClientDisconnect; 51 | bot.QueryConnection.OnMessageReceived += QueryConnection_OnMessageReceived; 52 | bot.PlayManager.AfterResourceStarted += PlayManager_AfterResourceStarted; 53 | PluginLog(Log.Level.Debug, "Plugin " + PluginInfo.Name + " v" + PluginInfo.Version + " by " + PluginInfo.Author + " loaded."); 54 | 55 | } 56 | 57 | private void PlayManager_AfterResourceStarted(object sender, PlayInfoEventArgs e) { 58 | Console.WriteLine("sd"); 59 | var title = e.ResourceData.ResourceTitle; 60 | var length = 2.0m.ToString(bot.PlayerConnection.Length.ToString()); 61 | bot.QueryConnection.SendChannelMessage("Now playing " + title + " (" + length + ")"); 62 | } 63 | 64 | private void QueryConnection_OnMessageReceived(object sender, TextMessage e) { 65 | Console.WriteLine("got message " + e.Message); 66 | bot.QueryConnection.SendMessage(e.Message, e.InvokerId); 67 | } 68 | 69 | private void QueryConnection_OnClientDisconnect(object sender, ClientLeftView e) { 70 | bot.QueryConnection.SendMessage("ciao", e.ClientId); 71 | } 72 | 73 | private void QueryConnection_OnClientConnect(object sender, ClientEnterView e) { 74 | bot.QueryConnection.SendMessage("hallo", e.ClientId); 75 | } 76 | 77 | public void SendChannelMessage(string Message) { 78 | bot.QueryConnection.ChangeName(PluginInfo.Name); 79 | bot.QueryConnection.SendChannelMessage(Message); 80 | bot.QueryConnection.ChangeName("Bluscream's Bitch"); 81 | } 82 | 83 | public void Dispose() { 84 | bot.QueryConnection.OnClientConnect -= QueryConnection_OnClientConnect; 85 | bot.QueryConnection.OnClientDisconnect -= QueryConnection_OnClientDisconnect; 86 | bot.QueryConnection.OnMessageReceived -= QueryConnection_OnMessageReceived; 87 | core.RightsManager.UnregisterRights("TestPlugin.dummyperm"); 88 | PluginLog(Log.Level.Debug, "Plugin " + PluginInfo.Name + " unloaded."); 89 | } 90 | 91 | [Command("isowner", "Bla")] 92 | public string CommandCheckOwner(ExecutionInformation info) { 93 | return info.HasRights("TestPlugin.dummyperm").ToString(); 94 | } 95 | 96 | [Command("tprequest", "Request Talk Power!")] 97 | public string CommandTPRequest(string name, int number) { 98 | var owner = bot.QueryConnection.GetClientByName("Bluscream").UnwrapThrow(); 99 | return "Hi " + name + ", you choose " + number + ". My owner is " + owner.Uid; 100 | } 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /RegistriertChannel/RegistriertChannel.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {9ED174DF-9421-419C-9099-A402DB9CF97D} 8 | Library 9 | Properties 10 | RegistriertChannel 11 | RegistriertChannel 12 | v4.6.1 13 | 512 14 | 15 | 16 | 17 | 18 | 19 | true 20 | full 21 | false 22 | ..\..\..\..\..\..\Bots\Plugins\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | On 27 | 4 28 | 29 | 30 | none 31 | true 32 | ..\..\..\..\..\..\Bots\Plugins\ 33 | TRACE 34 | prompt 35 | 4 36 | Off 37 | default 38 | 39 | 40 | true 41 | 42 | 43 | 44 | ..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.dll 45 | 46 | 47 | ..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.SqlServer.dll 48 | 49 | 50 | 51 | 52 | 53 | ..\packages\System.Data.SQLite.Core.1.0.105.2\lib\net46\System.Data.SQLite.dll 54 | 55 | 56 | ..\packages\System.Data.SQLite.EF6.1.0.105.2\lib\net46\System.Data.SQLite.EF6.dll 57 | 58 | 59 | ..\packages\System.Data.SQLite.Linq.1.0.105.2\lib\net46\System.Data.SQLite.Linq.dll 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | ..\..\..\..\..\..\Bots\TS3AudioBot.exe 69 | False 70 | 71 | 72 | ..\..\..\..\..\..\Bots\TS3Client.dll 73 | False 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | project.fragment.lock.json 46 | artifacts/ 47 | 48 | *_i.c 49 | *_p.c 50 | *_i.h 51 | *.ilk 52 | *.meta 53 | *.obj 54 | *.pch 55 | *.pdb 56 | *.pgc 57 | *.pgd 58 | *.rsp 59 | *.sbr 60 | *.tlb 61 | *.tli 62 | *.tlh 63 | *.tmp 64 | *.tmp_proj 65 | *.log 66 | *.vspscc 67 | *.vssscc 68 | .builds 69 | *.pidb 70 | *.svclog 71 | *.scc 72 | 73 | # Chutzpah Test files 74 | _Chutzpah* 75 | 76 | # Visual C++ cache files 77 | ipch/ 78 | *.aps 79 | *.ncb 80 | *.opendb 81 | *.opensdf 82 | *.sdf 83 | *.cachefile 84 | *.VC.db 85 | *.VC.VC.opendb 86 | 87 | # Visual Studio profiler 88 | *.psess 89 | *.vsp 90 | *.vspx 91 | *.sap 92 | 93 | # TFS 2012 Local Workspace 94 | $tf/ 95 | 96 | # Guidance Automation Toolkit 97 | *.gpState 98 | 99 | # ReSharper is a .NET coding add-in 100 | _ReSharper*/ 101 | *.[Rr]e[Ss]harper 102 | *.DotSettings.user 103 | 104 | # JustCode is a .NET coding add-in 105 | .JustCode 106 | 107 | # TeamCity is a build add-in 108 | _TeamCity* 109 | 110 | # DotCover is a Code Coverage Tool 111 | *.dotCover 112 | 113 | # NCrunch 114 | _NCrunch_* 115 | .*crunch*.local.xml 116 | nCrunchTemp_* 117 | 118 | # MightyMoose 119 | *.mm.* 120 | AutoTest.Net/ 121 | 122 | # Web workbench (sass) 123 | .sass-cache/ 124 | 125 | # Installshield output folder 126 | [Ee]xpress/ 127 | 128 | # DocProject is a documentation generator add-in 129 | DocProject/buildhelp/ 130 | DocProject/Help/*.HxT 131 | DocProject/Help/*.HxC 132 | DocProject/Help/*.hhc 133 | DocProject/Help/*.hhk 134 | DocProject/Help/*.hhp 135 | DocProject/Help/Html2 136 | DocProject/Help/html 137 | 138 | # Click-Once directory 139 | publish/ 140 | 141 | # Publish Web Output 142 | *.[Pp]ublish.xml 143 | *.azurePubxml 144 | # TODO: Comment the next line if you want to checkin your web deploy settings 145 | # but database connection strings (with potential passwords) will be unencrypted 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 150 | # checkin your Azure Web App publish settings, but sensitive information contained 151 | # in these scripts will be unencrypted 152 | PublishScripts/ 153 | 154 | # NuGet Packages 155 | *.nupkg 156 | # The packages folder can be ignored because of Package Restore 157 | **/packages/* 158 | # except build/, which is used as an MSBuild target. 159 | !**/packages/build/ 160 | # Uncomment if necessary however generally it will be regenerated when needed 161 | #!**/packages/repositories.config 162 | # NuGet v3's project.json files produces more ignoreable files 163 | *.nuget.props 164 | *.nuget.targets 165 | 166 | # Microsoft Azure Build Output 167 | csx/ 168 | *.build.csdef 169 | 170 | # Microsoft Azure Emulator 171 | ecf/ 172 | rcf/ 173 | 174 | # Windows Store app package directories and files 175 | AppPackages/ 176 | BundleArtifacts/ 177 | Package.StoreAssociation.xml 178 | _pkginfo.txt 179 | 180 | # Visual Studio cache files 181 | # files ending in .cache can be ignored 182 | *.[Cc]ache 183 | # but keep track of directories ending in .cache 184 | !*.[Cc]ache/ 185 | 186 | # Others 187 | ClientBin/ 188 | ~$* 189 | *~ 190 | *.dbmdl 191 | *.dbproj.schemaview 192 | *.jfm 193 | *.pfx 194 | *.publishsettings 195 | node_modules/ 196 | orleans.codegen.cs 197 | 198 | # Since there are multiple workflows, uncomment next line to ignore bower_components 199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 200 | #bower_components/ 201 | 202 | # RIA/Silverlight projects 203 | Generated_Code/ 204 | 205 | # Backup & report files from converting an old project file 206 | # to a newer Visual Studio version. Backup files are not needed, 207 | # because we have git ;-) 208 | _UpgradeReport_Files/ 209 | Backup*/ 210 | UpgradeLog*.XML 211 | UpgradeLog*.htm 212 | 213 | # SQL Server files 214 | *.mdf 215 | *.ldf 216 | 217 | # Business Intelligence projects 218 | *.rdl.data 219 | *.bim.layout 220 | *.bim_*.settings 221 | 222 | # Microsoft Fakes 223 | FakesAssemblies/ 224 | 225 | # GhostDoc plugin setting file 226 | *.GhostDoc.xml 227 | 228 | # Node.js Tools for Visual Studio 229 | .ntvs_analysis.dat 230 | 231 | # Visual Studio 6 build log 232 | *.plg 233 | 234 | # Visual Studio 6 workspace options file 235 | *.opt 236 | 237 | # Visual Studio LightSwitch build output 238 | **/*.HTMLClient/GeneratedArtifacts 239 | **/*.DesktopClient/GeneratedArtifacts 240 | **/*.DesktopClient/ModelManifest.xml 241 | **/*.Server/GeneratedArtifacts 242 | **/*.Server/ModelManifest.xml 243 | _Pvt_Extensions 244 | 245 | # Paket dependency manager 246 | .paket/paket.exe 247 | paket-files/ 248 | 249 | # FAKE - F# Make 250 | .fake/ 251 | 252 | # JetBrains Rider 253 | .idea/ 254 | *.sln.iml 255 | 256 | # CodeRush 257 | .cr/ 258 | 259 | # Python Tools for Visual Studio (PTVS) 260 | __pycache__/ 261 | *.pyc 262 | /NowPlaying_ 263 | /NowPlaying_/Properties/AssemblyInfo.cs 264 | /NowPlaying_/Properties/Settings.Designer.cs 265 | /NowPlaying_/Properties/Settings.settings 266 | /NowPlaying_/app.config 267 | /NowPlaying_/NowPlaying_.csproj 268 | /NowPlaying_/plugin.cs 269 | /BewerbungNotify/Class1.cs 270 | /BewerbungNotify/Plugin.cs -------------------------------------------------------------------------------- /ServerLog/Plugin.cs: -------------------------------------------------------------------------------- 1 | #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member 2 | using System; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | using System.Linq; 6 | using TS3AudioBot.Config; 7 | using TS3AudioBot.Plugins; 8 | using TS3AudioBot; 9 | using TS3Client.Full; 10 | using TS3Client.Messages; 11 | using TS3AudioBot.CommandSystem; 12 | using System.Text; 13 | using LiteDB; 14 | using IniParser; 15 | using IniParser.Model; 16 | using TS3Client.Commands; 17 | 18 | namespace ServerLog 19 | { 20 | #region PluginInfo 21 | public static class PluginInfo 22 | { 23 | public static readonly string ShortName; 24 | public static readonly string Name; 25 | public static readonly string Description = ""; 26 | public static readonly string Url = $"https://github.com/Bluscream/TS3AudioBotPlugins/tree/develop/{ShortName}"; 27 | public static readonly string Author = "Bluscream "; 28 | public static readonly Version Version = System.Reflection.Assembly.GetCallingAssembly().GetName().Version; 29 | 30 | static PluginInfo() 31 | { 32 | ShortName = typeof(PluginInfo).Namespace; 33 | var name = System.Reflection.Assembly.GetCallingAssembly().GetName().Name; 34 | Name = string.IsNullOrEmpty(name) ? ShortName : name; 35 | } 36 | } 37 | #endregion 38 | public class LogEntry 39 | { 40 | public DateTime TimeStamp { get; set; } 41 | public TS3Client.LogLevel LogLevel { get; set; } 42 | public string Event { get; set; } 43 | public string Message { get; set; } 44 | } 45 | public class ServerLog : IBotPlugin 46 | { 47 | #region Imports 48 | private static NLog.Logger Log = NLog.LogManager.GetLogger($"TS3AudioBot.Plugins.{PluginInfo.ShortName}"); 49 | public Bot Bot { get; set; } 50 | public Ts3FullClient TS3FullClient { get; set; } 51 | //public Ts3Client TS3Client { get; set; } 52 | public ConfBot ConfBot { get; set; } 53 | public ConfRoot ConfRoot { get; set; } 54 | public BotManager BotManager { get; set; } 55 | //public PlayManager BotPlayer { get; set; } 56 | //public IPlayerConnection PlayerConnection { get; set; } 57 | //public IVoiceTarget targetManager { get; set; } 58 | //public ConfHistory confHistory { get; set; } 59 | #endregion 60 | #region Variables 61 | private static string LogPath; private static string IndexPath; 62 | private static FileIniDataParser ConfigParser; 63 | private static IniData IndexFile; 64 | private static LiteDatabase dataBase; 65 | private List> monitoring = new List>(); 66 | private static string lastServerName; 67 | #endregion 68 | private ServerLog() 69 | { 70 | } 71 | 72 | public void Initialize() 73 | { 74 | TS3FullClient.OnEachInitServer += OnEachInitServer; 75 | LogPath = Path.Combine(ConfRoot.Plugins.Path.Value, PluginInfo.ShortName); 76 | IndexPath = Path.Combine(LogPath, "index.ini"); 77 | ConfigParser = new FileIniDataParser(); 78 | if (!File.Exists(IndexPath)) 79 | { 80 | if (!Directory.Exists(LogPath)) Directory.CreateDirectory(LogPath); 81 | IndexFile = new IniData(); 82 | IndexFile.Sections.Add(new SectionData("servers")); 83 | ConfigParser.WriteFile(IndexPath, IndexFile); 84 | Log.Warn("Config for plugin {} created!", PluginInfo.Name); 85 | } 86 | else { IndexFile = ConfigParser.ReadFile(IndexPath); } 87 | TS3FullClient.OnChannelListFinished += OnChannelListFinished; 88 | var success = InitServer(); 89 | Log.Info("Plugin {0} v{1} by {2} loaded {3}.", PluginInfo.Name, PluginInfo.Version, PluginInfo.Author, success); 90 | } 91 | 92 | private enum LogStatus { 93 | NOT_CONNECTED, 94 | ALREADY_MONITORED, 95 | MONITORING 96 | } 97 | private LogStatus InitServer() 98 | { 99 | var whoami = TS3FullClient.WhoAmI(); 100 | if (!whoami.Ok) return LogStatus.NOT_CONNECTED; 101 | var suid = whoami.Value.VirtualServerUid; 102 | foreach (var server in monitoring) { 103 | if (server.Item1 == suid) { return LogStatus.ALREADY_MONITORED; } 104 | } 105 | dataBase = new LiteDatabase(Path.Combine(LogPath, $"{suid}.db")); 106 | monitoring.Add(new Tuple(suid, Bot.Name)); 107 | IndexFile["servers"][suid] = lastServerName; 108 | lastServerName = null; 109 | ConfigParser.WriteFile(IndexPath, IndexFile); 110 | TS3FullClient.OnEachClientUpdated += OnEachClientUpdated; 111 | TS3FullClient. 112 | return LogStatus.MONITORING; 113 | } 114 | 115 | private void OnEachInitServer(object sender, InitServer e) 116 | { 117 | lastServerName = e.Name; 118 | } 119 | 120 | private void OnChannelListFinished(object sender, IEnumerable e) 121 | { 122 | InitServer(); 123 | } 124 | 125 | #region Events 126 | private void OnEachClientUpdated(object sender, ClientUpdated e) 127 | { 128 | var col = dataBase.GetCollection("Server"); 129 | col.Insert(new LogEntry{ TimeStamp = DateTime.Now, LogLevel = TS3Client.LogLevel.Info, Event = "Client Updated", Message = $"Client ID: {e.ClientId}" }); 130 | } 131 | #endregion 132 | #region Commands 133 | [Command("serverlog status", "")] 134 | public string CommandServerLogStatus() 135 | { 136 | var sb = new StringBuilder(); 137 | sb.AppendLine($"{PluginInfo.Name} Status:"); 138 | sb.AppendLine($"Bot: {Bot.Name}"); 139 | var suid = TS3FullClient.WhoAmI().Value.VirtualServerUid; 140 | sb.AppendLine($"DB: {Path.Combine(LogPath, $"{suid}.db")}"); 141 | sb.AppendLine($"Monitoring {monitoring.Count}: {monitoring.ToString()}"); 142 | sb.AppendLine($"Current: {suid}"); 143 | return sb.ToString(); 144 | } 145 | #endregion 146 | public void Dispose() { 147 | TS3FullClient.OnEachClientUpdated -= OnEachClientUpdated; 148 | TS3FullClient.OnChannelListFinished -= OnChannelListFinished; 149 | TS3FullClient.OnEachInitServer -= OnEachInitServer; 150 | dataBase.Dispose(); 151 | Log.Info("Plugin {} unloaded.", PluginInfo.Name); 152 | } 153 | } 154 | } 155 | #pragma warning restore CS1591 // Missing XML comment for publicly visible type or member 156 | -------------------------------------------------------------------------------- /VersionVerify/Plugin.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using TS3AudioBot.Config; 7 | using TS3AudioBot.Plugins; 8 | using TS3AudioBot; 9 | using TS3AudioBot.CommandSystem; 10 | using TS3Client.Full; 11 | using TS3Client.Messages; 12 | using TS3Client; 13 | using TS3AudioBot.CommandSystem.Text; 14 | using System.Text.RegularExpressions; 15 | 16 | using ClientIdT = System.UInt16; 17 | using ClientUidT = System.String; 18 | 19 | namespace VersionVerify 20 | { 21 | public static class PluginInfo 22 | { 23 | public static readonly string ShortName; 24 | public static readonly string Name; 25 | public static readonly string Description; 26 | public static readonly string Url; 27 | public static readonly string Author = "Bluscream"; 28 | public static readonly Version Version = System.Reflection.Assembly.GetCallingAssembly().GetName().Version; 29 | static PluginInfo() 30 | { 31 | ShortName = typeof(PluginInfo).Namespace; 32 | var name = System.Reflection.Assembly.GetCallingAssembly().GetName().Name; 33 | Name = string.IsNullOrEmpty(name) ? ShortName : name; 34 | } 35 | } 36 | public class VersionVerify : IBotPlugin 37 | { 38 | private static NLog.Logger Log = NLog.LogManager.GetLogger($"TS3AudioBot.Plugins.{PluginInfo.ShortName}"); 39 | 40 | public Ts3FullClient TS3FullClient { get; set; } 41 | public Ts3Client TS3Client { get; set; } 42 | public ConfRoot ConfRoot { get; set; } 43 | 44 | public static readonly byte[] Ts3VerionSignPublicKey = Convert.FromBase64String("UrN1jX0dBE1vulTNLCoYwrVpfITyo+NBuq/twbf9hLw="); 45 | public static Lazy VersionRegex = new Lazy(() => new Regex(@"^(3.(\?\.)*\?|(\d\.)+(\d|\?)(-[a-z]*)?) \[Build: (\d+)\]$", RegexOptions.Compiled)); 46 | 47 | private static List whitelistUID = new List() { }; 48 | private static List whitelistSGID = new List() { 2,204,203,210,254,252,228,268 }; 49 | private bool PluginEnabled = true; 50 | 51 | public static string TruncateLongString(string str, int maxLength) 52 | { 53 | if (string.IsNullOrEmpty(str)) 54 | return str; 55 | return str.Substring(0, Math.Min(str.Length, maxLength)); 56 | } 57 | 58 | public void Initialize() 59 | { 60 | TS3FullClient.OnEachClientEnterView += OnEachClientEnterView; 61 | Log.Info("Plugin {0} v{1} by {2} loaded.", PluginInfo.Name, PluginInfo.Version, PluginInfo.Author); 62 | } 63 | 64 | private void CheckClient(ClientIdT id, ClientType type, ClientUidT uid, ulong[] sgids, string version, string platform, string sign, string name = null) 65 | { 66 | if (id == TS3FullClient.ClientId) return; 67 | if (type != ClientType.Full) return; 68 | if (whitelistUID.Contains(uid)) return; 69 | /*Log.Debug("whitelistSGID: " + string.Join(", ", whitelistSGID)); 70 | Log.Debug("sgids: " + string.Join(", ", sgids)); 71 | Log.Debug("Intersect-> " + string.Join(", ", whitelistSGID.Intersect(sgids))); 72 | Log.Debug("Intersect<- " + string.Join(", ", sgids.Intersect(whitelistSGID))); 73 | Log.Debug("Any: " + whitelistSGID.Intersect(sgids).Any());*/ 74 | if (whitelistSGID.Intersect(sgids).Any()) return; 75 | // new VersionSign(version, platform, sign); 76 | if (string.IsNullOrWhiteSpace(platform) || string.IsNullOrWhiteSpace(version)) { TakeAction(id, uid, name, version, platform, sign); return; } 77 | if (sign != null) { 78 | if (string.IsNullOrWhiteSpace(sign)) { TakeAction(id, uid, name, version, platform, sign); return; } 79 | byte[] ver = Encoding.ASCII.GetBytes(platform + sign); 80 | if (!Chaos.NaCl.Ed25519.Verify(Convert.FromBase64String(sign), ver, Ts3VerionSignPublicKey)) { 81 | TakeAction(id, uid, name, version, platform, sign); return; 82 | } 83 | } 84 | var parsed = VersionRegex.Value.Match(version); 85 | if (!parsed.Success) { TakeAction(id, uid, name, version, platform, sign); return; } 86 | if (parsed.Groups[1].Value == "3.?.?") { TakeAction(id, uid, name, version, platform, sign, "?"); return; } 87 | var build_valid = Int32.TryParse(parsed.Groups[6].Value, out Int32 version_unix); 88 | if (!build_valid) { TakeAction(id, uid, name, version, platform, sign); return; } 89 | Int32 now_unix = (Int32)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds; 90 | if (version_unix > now_unix) { TakeAction(id, uid, name, version, platform, sign, "Aus der Zukunft O.o"); return; } 91 | } 92 | 93 | private void OnEachClientEnterView(object sender, ClientEnterView client) { 94 | if (!PluginEnabled) return; 95 | try { 96 | var clientInfo = TS3Client.GetClientInfoById(client.ClientId).Value; 97 | CheckClient(client.ClientId, client.ClientType, client.Uid, client.ServerGroups, clientInfo.ClientVersion, clientInfo.ClientPlatform, clientInfo.ClientVersionSign, client.Name); 98 | } catch (Exception ex) { Log.Error(ex.Message); } 99 | } 100 | 101 | private void TakeAction(ClientIdT clientId, ClientUidT uid, string name, string version, string platform, string sign, string Reason = "Ungültige Version!") 102 | { 103 | Log.Warn("Client {} ({}) has an invalid version: ({}, {}, {})", name, uid, version, platform, sign); 104 | TS3FullClient.KickClientFromServer(clientId, Reason); 105 | } 106 | 107 | [Command("plugin toggle versionverify", "")] 108 | public string CommandCheckName(InvokerData invoker) 109 | { 110 | PluginEnabled = !PluginEnabled; 111 | return $"{(PluginEnabled?"Enabled":"Disabled")} {PluginInfo.Name}"; 112 | } 113 | 114 | [Command("version check name", "")] 115 | public string CommandCheckName(InvokerData invoker, params string[] _name) 116 | { 117 | var name = string.Join(" ", _name); 118 | var c = TS3Client.GetClientByName(name).Unwrap(); 119 | var client = TS3Client.GetClientInfoById(c.ClientId).Value; 120 | CheckClient(c.ClientId, c.ClientType, c.Uid, client.ServerGroups, client.ClientVersion, client.ClientPlatform, client.ClientVersionSign, c.Name); 121 | return $"Checked {client.Name}"; 122 | } 123 | 124 | public void Dispose() 125 | { 126 | TS3FullClient.OnEachClientEnterView -= OnEachClientEnterView; 127 | Log.Info("Plugin {} unloaded.", PluginInfo.Name); 128 | } 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /MinecraftLink/Plugin.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Net; 6 | using System.Text.RegularExpressions; 7 | using TS3AudioBot.Config; 8 | using TS3AudioBot.Plugins; 9 | using TS3AudioBot; 10 | using TS3AudioBot.CommandSystem; 11 | using TS3Client.Full; 12 | using TS3Client.Audio; 13 | using TS3Client; 14 | using TS3AudioBot.History; 15 | using TS3AudioBot.Helper; 16 | using Newtonsoft.Json; 17 | using IniParser; 18 | using IniParser.Model; 19 | using TS3Client.Commands; 20 | using Newtonsoft.Json; 21 | 22 | using ClientIdT = System.UInt16; 23 | using ChannelIdT = System.UInt64; 24 | using ClientUidT = System.String; 25 | using TS3Client.Messages; 26 | using System.Text; 27 | using TS3AudioBot.Sessions; 28 | using TS3AudioBot.CommandSystem.Text; 29 | 30 | namespace MinecraftLink 31 | { 32 | public class PluginInfo 33 | { 34 | public static readonly string ShortName = typeof(PluginInfo).Namespace; 35 | public static readonly string Name = string.IsNullOrEmpty(System.Reflection.Assembly.GetExecutingAssembly().GetName().Name) ? ShortName : System.Reflection.Assembly.GetExecutingAssembly().GetName().Name; 36 | public static string Description = ""; 37 | public static string Url = $"https://github.com/Bluscream/TS3AudioBotPlugins/tree/develop/{ShortName}"; 38 | public static string Author = "Bluscream "; 39 | public static readonly Version Version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; 40 | public PluginInfo() 41 | { 42 | var versionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetEntryAssembly().Location); 43 | Description = versionInfo.FileDescription; 44 | Author = versionInfo.CompanyName; 45 | } 46 | } 47 | 48 | public class MinceraftProfile 49 | { 50 | public string id { get; set; } 51 | public string name { get; set; } 52 | public string error { get; set; } 53 | public string errorMessage { get; set; } 54 | } 55 | 56 | public class MinecraftLink : IBotPlugin 57 | { 58 | private static readonly PluginInfo PluginInfo = new PluginInfo(); 59 | private static NLog.Logger Log = NLog.LogManager.GetLogger($"TS3AudioBot.Plugins.{PluginInfo.ShortName}"); 60 | 61 | public Ts3FullClient TS3FullClient { get; set; } 62 | public Ts3Client TS3Client { get; set; } 63 | public ConfRoot ConfRoot { get; set; } 64 | 65 | private static FileIniDataParser ConfigParser; 66 | private static string PluginConfigFile; 67 | private static IniData PluginConfig; 68 | 69 | private static string CacheDir; 70 | 71 | private bool LinkingEnabled = true; 72 | 73 | public static string TruncateLongString(string str, int maxLength) 74 | { 75 | if (string.IsNullOrEmpty(str)) 76 | return str; 77 | return str.Substring(0, Math.Min(str.Length, maxLength)); 78 | } 79 | public static string ClientURL(ushort clientID, string uid = "unknown", string nickname = "Unknown User") 80 | { 81 | var sb = new StringBuilder("[URL=client://"); 82 | sb.Append(clientID); 83 | sb.Append("/"); 84 | sb.Append(uid); 85 | //sb.Append("~"); 86 | sb.Append("]\""); 87 | sb.Append(nickname); 88 | sb.Append("\"[/URL]"); 89 | return sb.ToString(); 90 | } 91 | 92 | public void Initialize() 93 | { 94 | LoadConfig(); 95 | PluginConfigFile = Path.Combine(ConfRoot.Plugins.Path.Value, $"{PluginInfo.ShortName}", "cache"); 96 | TS3FullClient.OnEachClientEnterView += OnEachClientEnterView; 97 | Log.Info("Plugin {0} v{1} by {2} loaded.", PluginInfo.Name, PluginInfo.Version, PluginInfo.Author); 98 | } 99 | 100 | private void OnEachClientEnterView(object sender, ClientEnterView client) 101 | { 102 | if (!LinkingEnabled) return; 103 | if (client.ClientType == ClientType.Query) return; 104 | if (client.ClientId == TS3FullClient.ClientId) return; 105 | } 106 | 107 | private Tuple getMcProfileFromName(string name) 108 | { 109 | var url = $"https://api.mojang.com/users/profiles/minecraft/{name}"; 110 | using (var w = new WebClient()) 111 | { 112 | var json_data = string.Empty; 113 | try { 114 | json_data = w.DownloadString(url); 115 | if (string.IsNullOrEmpty(json_data)) return string.Empty; 116 | var parsed = JsonConvert.DeserializeObject(json_data); 117 | if (string.IsNullOrEmpty(parsed.id)) return null; 118 | return parsed.id; 119 | } 120 | catch (Exception) { return null; } 121 | } 122 | 123 | private bool HeadIcon() 124 | { 125 | 126 | return true; 127 | } 128 | 129 | [Command("link", "")] 130 | public string CommandAcceptToS(InvokerData invoker, string input) 131 | { 132 | if (!LinkingEnabled) return PluginConfig["Templates"]["Linking Disabled"]; 133 | var mcuuid = getMcUuidFromName(input); 134 | // Add icon 135 | return PluginConfig["Templates"]["Linked Response"].Replace("%mcname%",mcname).Replace("%mcuuid%",mcuuid); 136 | } 137 | 138 | private void LoadConfig() 139 | { 140 | PluginConfigFile = Path.Combine(ConfRoot.Plugins.Path.Value, $"{PluginInfo.ShortName}.ini"); 141 | if (ConfigParser == null) ConfigParser = new FileIniDataParser(); 142 | if (!File.Exists(PluginConfigFile)) 143 | { 144 | PluginConfig = new IniData(); 145 | var section = "Templates"; 146 | PluginConfig[section]["Linked Response"] = @"[color=green]Du wurdest erfolgreich mit dem Minecraft Account [url=https://mcuuid.net/?q=%mcuuid%]%mcname%[/url]"; // .Mod().Color(Color.Green).ToString() 147 | PluginConfig[section]["Linking Disabled"] = "Minecraft linking is currently disabled!"; 148 | section = "Icons"; 149 | PluginConfig[section]["URL"] = "https://cravatar.eu/helmavatar/%mcuuid%/16.png"; 150 | ConfigParser.WriteFile(PluginConfigFile, PluginConfig); 151 | Log.Warn("Config for plugin {} created, please modify it and reload!", PluginInfo.Name); 152 | return; 153 | } 154 | else { PluginConfig = ConfigParser.ReadFile(PluginConfigFile); } 155 | } 156 | 157 | public void Dispose() 158 | { 159 | TS3FullClient.OnEachClientEnterView -= OnEachClientEnterView; 160 | if (ConfigParser == null) ConfigParser = new FileIniDataParser(); 161 | ConfigParser.WriteFile(PluginConfigFile, PluginConfig); 162 | Log.Info("Plugin {} unloaded.", PluginInfo.Name); 163 | } 164 | } 165 | } 166 | -------------------------------------------------------------------------------- /RegistriertChannel/plugin.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data.SQLite; 4 | using System.IO; 5 | using System.Linq; 6 | using TS3AudioBot; 7 | using TS3AudioBot.Plugins; 8 | using TS3AudioBot.CommandSystem; 9 | using TS3Client.Full; 10 | using TS3Client.Messages; 11 | 12 | namespace RegistriertChannel 13 | { 14 | public class PluginInfo 15 | { 16 | public static readonly string ShortName = typeof(PluginInfo).Namespace; 17 | public static readonly string Name = string.IsNullOrEmpty(System.Reflection.Assembly.GetExecutingAssembly().GetName().Name) ? ShortName : System.Reflection.Assembly.GetExecutingAssembly().GetName().Name; 18 | public static string Description = ""; 19 | public static string Url = $"https://github.com/Bluscream/TS3AudioBotPlugins/tree/develop/{ShortName}"; 20 | public static string Author = "Bluscream "; 21 | public static readonly Version Version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; 22 | public PluginInfo() 23 | { 24 | var versionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetEntryAssembly().Location); 25 | Description = versionInfo.FileDescription; 26 | Author = versionInfo.CompanyName; 27 | } 28 | } 29 | public class RegistriertChannel : IBotPlugin 30 | { 31 | private static readonly PluginInfo PluginInfo = new PluginInfo(); 32 | private static NLog.Logger Log = NLog.LogManager.GetLogger($"TS3AudioBot.Plugins.{PluginInfo.ShortName}"); 33 | 34 | private SQLiteConnection db; 35 | private Bot bot; 36 | private Ts3FullClient lib; 37 | public bool Enabled { get; private set; } 38 | public PluginInfo pluginInfo = new PluginInfo(); 39 | public void PluginLog(Log.Level logLevel, string Message) { Log.Write(logLevel, PluginInfo.Name + ": " + Message); } 40 | private readonly List clientUIDs = new List(); 41 | 42 | public string welcomeMSG = "Hey {nickname} du bist leider nicht registriert,\n" + 43 | "deshalb hast du hier nur eine Chance talkpower zu bekommen falls ein Moderator im channel ist.\n" + 44 | "Um dich auf diesem Teamspeak Server zu registrieren musst du folgendes tun:\n\n" + 45 | "1. Auf den Minecraft Server [color=green]gommehd.net[/color] joinen.\n" + 46 | "2. Im Minecraft chat [color=red]/ts set {uid}[/color] eingeben.\n" + 47 | "3. Im Teamspeak Chat dem User [URL=client://0/serveradmin~Gomme-Bot]Gomme-Bot[/URL] deinen Minecraft Namen schreiben (Groß/Kleinschreibung beachten)\n" + 48 | "4. Wenn die Registrierung erfolgreich warst erhälst du die Server Gruppe \"Registriert\". Es kann eine Zeit lang dauern bis dein Minecraft Kopf hinter deinem Namen erscheint."; 49 | 50 | public void Initialize(Core Core) { 51 | var dbpath = Path.Combine(Directory.GetCurrentDirectory(), "RegistriertChannel.db"); 52 | var firstStart = File.Exists(dbpath); 53 | if (firstStart) SQLiteConnection.CreateFile(dbpath); 54 | db = new SQLiteConnection("Data Source=" + dbpath + ";Version=3;"); 55 | db.Open(); 56 | if (firstStart) new SQLiteCommand("create table optout (uid varchar(28))", db).ExecuteNonQuery(); 57 | 58 | bot = Core.Bots.GetBot(0); 59 | lib = bot.QueryConnection.GetLowLibrary(); 60 | lib.OnClientMoved += Lib_OnClientMoved; 61 | lib.OnTextMessageReceived += Lib_OnTextMessageReceived; 62 | Enabled = true; PluginLog(Log.Level.Debug, "Plugin " + PluginInfo.Name + " v" + PluginInfo.Version + " by " + PluginInfo.Author + " loaded."); 63 | } 64 | 65 | private void Lib_OnTextMessageReceived(object sender, IEnumerable e) { 66 | if (!Enabled) return; 67 | foreach (var msg in e) 68 | { 69 | if (msg.Message.ToLower() != "!stop") continue; 70 | var cmd = new SQLiteCommand("insert into optout (uid) values (@uid)", db); 71 | cmd.Parameters.AddWithValue("@uid", msg.InvokerUid); 72 | cmd.ExecuteNonQuery(); 73 | bot.QueryConnection.SendMessage("Erfolgreich abgemeldet.", msg.InvokerId); 74 | } 75 | } 76 | 77 | private void Lib_OnClientMoved(object sender, IEnumerable e) { 78 | if (!Enabled) return; 79 | foreach (var client in e) 80 | { 81 | if (lib.WhoAmI().ChannelId == client.TargetChannelId) continue; 82 | var clientinfo = lib.ClientInfo(client.ClientId); 83 | if (!clientUIDs.Contains(clientinfo.Uid)) continue; 84 | if (!clientinfo.ServerGroups.Contains(Convert.ToUInt64(13))) continue; 85 | var welcomemsg = welcomeMSG.Replace("{nickname}", clientinfo.NickName).Replace("{uid}", clientinfo.Uid); 86 | PluginLog(Log.Level.Debug, "\n" + welcomemsg + "\n"); 87 | bot.QueryConnection.SendMessage(welcomemsg, client.ClientId); 88 | clientUIDs.Add(clientinfo.Uid); 89 | } 90 | } 91 | 92 | public void Dispose() 93 | { 94 | lib.OnClientMoved -= Lib_OnClientMoved; 95 | lib.OnTextMessageReceived -= Lib_OnTextMessageReceived; 96 | db.Close(); 97 | PluginLog(Log.Level.Debug, "Plugin " + PluginInfo.Name + " unloaded."); 98 | } 99 | 100 | [Command("registriertchannel toggle", PluginInfo.Description)] 101 | public string CommandToggleRegistriertChannel() { 102 | Enabled = !Enabled; 103 | return PluginInfo.Name + " is now " + Enabled; 104 | } 105 | 106 | [Command("registriertchannel list", PluginInfo.Description)] 107 | public string CommandRegistriertChannelList() 108 | { 109 | return string.Join(", ", clientUIDs); 110 | } 111 | 112 | [Command("registriertchannel msg", PluginInfo.Description)] 113 | public string CommandRegistriertChannelMSG() 114 | { 115 | var whoami = lib.WhoAmI(); 116 | return welcomeMSG.Replace("{nickname}", whoami.NickName).Replace("{uid}", whoami.Uid); 117 | } 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /NoDirectConnect/Plugin.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Net; 6 | using System.Text.RegularExpressions; 7 | using TS3AudioBot.Config; 8 | using TS3AudioBot.Plugins; 9 | using TS3AudioBot; 10 | using TS3AudioBot.CommandSystem; 11 | using TS3Client.Full; 12 | using TS3Client.Audio; 13 | using TS3Client; 14 | using TS3AudioBot.History; 15 | using TS3AudioBot.Helper; 16 | using Newtonsoft.Json; 17 | using TS3Client.Commands; 18 | 19 | using ClientIdT = System.UInt16; 20 | using ChannelIdT = System.UInt64; 21 | using ClientUidT = System.String; 22 | using TS3Client.Messages; 23 | using System.Text; 24 | using TS3AudioBot.Sessions; 25 | 26 | namespace NoDirectConnect 27 | { 28 | public class PluginInfo 29 | { 30 | public static readonly string ShortName = typeof(PluginInfo).Namespace; 31 | public static readonly string Name = string.IsNullOrEmpty(System.Reflection.Assembly.GetExecutingAssembly().GetName().Name) ? ShortName : System.Reflection.Assembly.GetExecutingAssembly().GetName().Name; 32 | public static string Description = ""; 33 | public static string Url = $"https://github.com/Bluscream/TS3AudioBotPlugins/tree/develop/{ShortName}"; 34 | public static string Author = "Bluscream "; 35 | public static readonly Version Version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; 36 | public PluginInfo() 37 | { 38 | var versionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetEntryAssembly().Location); 39 | Description = versionInfo.FileDescription; 40 | Author = versionInfo.CompanyName; 41 | } 42 | } 43 | 44 | public class NoDirectConnect : IBotPlugin 45 | { 46 | private static readonly PluginInfo PluginInfo = new PluginInfo(); 47 | private static NLog.Logger Log = NLog.LogManager.GetLogger($"TS3AudioBot.Plugins.{PluginInfo.ShortName}"); 48 | 49 | public Ts3FullClient TS3FullClient { get; set; } 50 | public Ts3Client TS3Client { get; set; } 51 | public ConfRoot ConfRoot { get; set; } 52 | 53 | private bool Initialized = false; 54 | private static Dictionary clientCache; 55 | private static Dictionary timeoutCache; 56 | private static ChannelIdT defaultChannelID = 0; 57 | private static string KickMessage = "Nutze die Eingangshalle!"; 58 | private static TimeSpan maxTimeOutPassed = TimeSpan.FromMinutes(2); 59 | 60 | public void Initialize() 61 | { 62 | clientCache = new Dictionary(); 63 | timeoutCache = new Dictionary(); 64 | TS3FullClient.OnEachClientEnterView += OnEachClientEnterView; 65 | TS3FullClient.OnEachClientLeftView += OnEachClientLeftView; 66 | TS3FullClient.OnEachChannelList += OnEachChannelList; 67 | TS3FullClient.OnEachChannelListFinished += OnEachChannelListFinished; 68 | GetDefaultChannel(); 69 | Log.Info("Plugin {0} v{1} by {2} loaded.", PluginInfo.Name, PluginInfo.Version, PluginInfo.Author); 70 | } 71 | 72 | private void GetDefaultChannel() 73 | { 74 | var channels = TS3FullClient.Send("channellist"); 75 | if (channels.Ok) 76 | { 77 | foreach (var channel in channels.Value) 78 | { 79 | if (channel.IsDefault) { defaultChannelID = channel.Id; return; } 80 | } 81 | Log.Error("No default channel found!"); 82 | } else { Log.Error("Unable to get channel list: {}", channels.Error.Message); } 83 | } 84 | 85 | private void OnEachChannelList(object sender, ChannelList channel) 86 | { 87 | if (!channel.IsDefault) return; 88 | defaultChannelID = channel.ChannelId; 89 | } 90 | 91 | private void OnEachChannelListFinished(object sender, ChannelListFinished e) 92 | { 93 | if (Initialized) return; 94 | Initialized = true; 95 | } 96 | 97 | private void OnEachClientEnterView(object sender, ClientEnterView client) 98 | { 99 | if (!clientCache.ContainsKey(client.ClientId)) 100 | clientCache.Add(client.ClientId, client.Uid); 101 | if (!Initialized) return; 102 | if (client.SourceChannelId > 0) return; 103 | if (defaultChannelID < 1) return; 104 | if (client.TargetChannelId == defaultChannelID) return; 105 | if (timeoutCache.ContainsKey(client.Uid)) 106 | { 107 | var timeout = timeoutCache[client.Uid]; 108 | var timeoutvalid = (timeout - DateTime.Now) < maxTimeOutPassed; 109 | Log.Debug("Found matching {} timeout for client {} ({}): {}", (timeoutvalid?"valid":"invalid"), client.Name, client.Uid, timeout); 110 | timeoutCache.Remove(client.Uid); 111 | if (timeoutvalid) return; 112 | } 113 | Log.Debug("Client {} ({}) tried to join into channel {} ({})", client.Name, client.Uid, client.TargetChannelId, defaultChannelID); 114 | TS3FullClient.KickClientFromChannel(client.ClientId, KickMessage); 115 | } 116 | 117 | private void OnEachClientLeftView(object sender, ClientLeftView client) 118 | { 119 | if (!Initialized) return; 120 | if (clientCache.ContainsKey(client.ClientId)) { 121 | if (client.Reason == Reason.Timeout) { 122 | var uid = clientCache[client.ClientId]; 123 | if (timeoutCache.ContainsKey(uid)) 124 | Log.Debug("Client {} timed out, adding him to timeout cache.", uid); 125 | timeoutCache.Add(uid, DateTime.Now); 126 | } 127 | clientCache.Remove(client.ClientId); 128 | } 129 | } 130 | 131 | [Command("plugin info nodirectconnect", "")] 132 | public string CommandInfo() 133 | { 134 | var sb = new StringBuilder(PluginInfo.Name); 135 | sb.AppendLine(); 136 | sb.AppendLine($"Initialized: {Initialized}"); 137 | sb.AppendLine($"defaultChannelID: {defaultChannelID}"); 138 | sb.AppendLine($"KickMessage: {KickMessage}"); 139 | sb.AppendLine($"clients ({clientCache.Count}): {string.Join(",", clientCache)}"); 140 | sb.AppendLine($"timeouts ({timeoutCache.Count}): {string.Join(",", timeoutCache)}"); 141 | // GetDefaultChannel(); 142 | return sb.ToString(); 143 | } 144 | 145 | [Command("nodirectconnect clear", "")] 146 | public string CommandClear() 147 | { 148 | var cleared = timeoutCache.Count; 149 | timeoutCache.Clear(); 150 | return $"Cleared timeout cache with {cleared} timeouts."; 151 | } 152 | 153 | public void Dispose() 154 | { 155 | clientCache.Clear();timeoutCache.Clear(); 156 | TS3FullClient.OnEachChannelListFinished -= OnEachChannelListFinished; 157 | TS3FullClient.OnEachChannelList -= OnEachChannelList; 158 | TS3FullClient.OnEachClientLeftView -= OnEachClientLeftView; 159 | TS3FullClient.OnEachClientEnterView -= OnEachClientEnterView; 160 | Log.Info("Plugin {} unloaded.", PluginInfo.Name); 161 | } 162 | } 163 | } 164 | -------------------------------------------------------------------------------- /MetaData/plugin.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using TS3AudioBot; 3 | using TS3AudioBot.Plugins; 4 | using TS3AudioBot.CommandSystem; 5 | using TS3AudioBot.Helper; 6 | using TS3Client.Commands; 7 | using TS3Client.Full; 8 | using System.Text; 9 | 10 | namespace MetaData 11 | { 12 | public class PluginInfo 13 | { 14 | public static readonly string ShortName = typeof(PluginInfo).Namespace; 15 | public static readonly string Name = string.IsNullOrEmpty(System.Reflection.Assembly.GetExecutingAssembly().GetName().Name) ? ShortName : System.Reflection.Assembly.GetExecutingAssembly().GetName().Name; 16 | public static string Description = ""; 17 | public static string Url = $"https://github.com/Bluscream/TS3AudioBotPlugins/tree/develop/{ShortName}"; 18 | public static string Author = "Bluscream "; 19 | public static readonly Version Version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; 20 | public PluginInfo() 21 | { 22 | var versionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetEntryAssembly().Location); 23 | Description = versionInfo.FileDescription; 24 | Author = versionInfo.CompanyName; 25 | } 26 | } 27 | public class MetaData : IBotPlugin 28 | { 29 | private static readonly PluginInfo PluginInfo = new PluginInfo(); 30 | private static NLog.Logger Log = NLog.LogManager.GetLogger($"TS3AudioBot.Plugins.{PluginInfo.ShortName}"); 31 | 32 | private Core core; 33 | private Bot bot; 34 | private Ts3FullClient lib; 35 | public string[] badges = { 36 | "1cb07348-34a4-4741-b50f-c41e584370f7", // TeamSpeak Addon Author 37 | "50bbdbc8-0f2a-46eb-9808-602225b49627", // Gamescom 2016 38 | "d95f9901-c42d-4bac-8849-7164fd9e2310", // Paris Games Week 2016 39 | "62444179-0d99-42ba-a45c-c6b1557d079a", // Gamescom 2014 40 | "d95f9901-c42d-4bac-8849-7164fd9e2310", // Paris Games Week 2014 41 | "450f81c1-ab41-4211-a338-222fa94ed157", // TeamSpeak Addon Developer (Bronze) 42 | "c9e97536-5a2d-4c8e-a135-af404587a472", // TeamSpeak Addon Developer (Silver) 43 | "94ec66de-5940-4e38-b002-970df0cf6c94", // TeamSpeak Addon Developer (Gold) 44 | "534c9582-ab02-4267-aec6-2d94361daa2a", // Gamescom 2017 45 | "34dbfa8f-bd27-494c-aa08-a312fc0bb240", // Gamescom Hero 2017 46 | "7d9fa2b1-b6fa-47ad-9838-c239a4ddd116", // MIFCOM 47 | "f81ad44d-e931-47d1-a3ef-5fd160217cf8", // 4Netplayers customer 48 | "f22c22f1-8e2d-4d99-8de9-f352dc26ac5b", // Rocket Beans TV 49 | }; 50 | 51 | public bool Enabled { get; private set; } 52 | public TickWorker Timer { get; private set; } 53 | public PluginInfo pluginInfo = new PluginInfo(); 54 | 55 | public void PluginLog(Log.Level logLevel, string Message) { 56 | Log.Write(logLevel, PluginInfo.Name + ": " + Message); 57 | } 58 | 59 | public void Initialize(Core Core) { 60 | core = Core; 61 | bot = Core.Bots.GetBot(0); 62 | lib = bot.QueryConnection.GetLowLibrary(); 63 | lib.OnConnected += Lib_OnConnected; 64 | Enabled = true; PluginLog(Log.Level.Debug, "Plugin " + PluginInfo.Name + " v" + PluginInfo.Version + " by " + PluginInfo.Author + " loaded."); 65 | } 66 | 67 | private void SetMetaData() { 68 | var af = core.ConfigManager.GetDataStruct("AudioFramework", true); 69 | var qc = core.ConfigManager.GetDataStruct("QueryConnection", true); 70 | var metaData = "\nQueryConnection::AudioBitrate=" + qc.AudioBitrate; 71 | metaData += "\nAudioFramework::AudioMode=" + af.AudioMode; 72 | metaData += "\nAudioFramework::DefaultVolume=" + af.DefaultVolume; 73 | metaData += "\nQueryConnection::Address=" + qc.Address; 74 | metaData += "\nQueryConnection::DefaultNickname=" + qc.DefaultNickname; 75 | metaData += "\nQueryConnection::IdentityLevel=" + qc.IdentityLevel; 76 | lib.Send("clientupdate", new CommandParameter("client_meta_data", metaData)); 77 | } 78 | 79 | private void Lib_OnConnected(object sender, EventArgs e) { 80 | if (!Enabled) { return; } 81 | PluginLog(Log.Level.Debug, "Our client is now connected, setting meta data"); 82 | SetMetaData(); 83 | lib.Send("clientupdate", new CommandParameter("client_badges", "overwolf=0:badges=94ec66de-5940-4e38-b002-970df0cf6c94")); 84 | //Timer = RegisterTick(() => SetMetaData(), TimeSpan.FromSeconds(60), true); 85 | } 86 | private int currentBadge; 87 | public void SetRandomBadge() { 88 | currentBadge = (currentBadge + 1) % badges.Length; 89 | var build = new StringBuilder("overwolf=1:badges="); 90 | for (int i = 0; i < 15; i++) 91 | build.Append(badges[(currentBadge + i) % badges.Length] + ","); 92 | build.Length--; 93 | lib.Send("clientupdate", new CommandParameter("client_badges", build.ToString())); 94 | } 95 | 96 | public void Dispose() { 97 | lib.OnConnected -= Lib_OnConnected; 98 | //TickPool.UnregisterTick(Timer); 99 | PluginLog(Log.Level.Debug, "Plugin " + PluginInfo.Name + " unloaded."); 100 | } 101 | 102 | [Command("metadata toggle", PluginInfo.Description)] 103 | public string CommandToggleMetaData() { 104 | Enabled = !Enabled; 105 | return PluginInfo.Name + " is now " + Enabled; 106 | } 107 | 108 | [Command("metadata refresh", PluginInfo.Description)] 109 | public string CommandRefreshMetaData() { 110 | SetMetaData(); 111 | return PluginInfo.Name + ": refreshed Meta Data"; 112 | } 113 | 114 | [Command("metadata badges", PluginInfo.Description)] 115 | public string CommandSetClientBadges(string Badges) { 116 | lib.Send("clientupdate", new CommandParameter("client_badges", Badges)); 117 | PluginLog(Log.Level.Info, "Set Badges to: " + Badges); 118 | return PluginInfo.Name + ": set Badges to " + Badges; 119 | } 120 | 121 | [Command("metadata togglebadges", PluginInfo.Description)] 122 | public string CommandSetClientToggleBadges() { 123 | if (!Timer.Active) { 124 | Timer = TickPool.RegisterTick(SetRandomBadge, TimeSpan.FromMilliseconds(500), true); 125 | return "Auto toggeling badges"; 126 | } else { 127 | Timer.Active = false; 128 | Timer = null; 129 | return "Stopped toggeling badges"; 130 | } 131 | } 132 | } 133 | } 134 | --------------------------------------------------------------------------------