forked from Bluscream/TS3AudioBotPlugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClass1.cs
58 lines (52 loc) · 1.95 KB
/
Class1.cs
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using System;
using TS3AudioBot;
using TS3AudioBot.Plugins;
using TS3AudioBot.CommandSystem;
using TS3Client.Full;
namespace TestPlugin
{
public class TestPlugin : ITabPlugin
{
private MainBot bot;
private Ts3FullClient lib;
public class PluginInfo
{
public static readonly string Name = typeof(PluginInfo).Namespace;
public const string Description = "Test Description";
public const string Url = "test";
public const string Author = "Bluscream <[email protected]>";
public const int Version = 1337;
}
public void PluginLog(Log.Level logLevel, string Message) {
switch (logLevel)
{
case Log.Level.Debug:
Console.ForegroundColor = ConsoleColor.Cyan;
break;
case Log.Level.Warning:
Console.ForegroundColor = ConsoleColor.Yellow;
break;
case Log.Level.Error:
Console.ForegroundColor = ConsoleColor.Red;
break;
}
Log.Write(logLevel, Message);
Console.ResetColor();
}
public void Initialize(Core mainBot) {
bot = mainBot.Bots.GetBot(0);
lib = bot.QueryConnection.GetLowLibrary<Ts3FullClient>();
mainBot.RightsManager.RegisterRights("TestPlugin.dummyperm");
//lib.OnErrorEvent()
PluginLog(Log.Level.Debug, "Plugin " + PluginInfo.Name + " v" + PluginInfo.Version + " by " + PluginInfo.Author + " loaded.");
}
public void Dispose() {
mainBot.RightsManager.UnregisterRights("TestPlugin.dummyperm");
PluginLog(Log.Level.Debug, "Plugin " + PluginInfo.Name + " unloaded.");
}
[Command("tester", "Test Description")]
public void CommandTest(string str) {
lib.SendGlobalMessage(str);
}
}
}