public static void Main(string[] args) { var client = new UVIrcClient(); var bot = new IrcBot<UVIrcClient>(client); bot.Client.Connect("127.0.0.1", new IrcUserRegistrationInfo() { NickName = "txdv-bot", UserName = "******", RealName = "txdv bot", }); var adminPlugin = new AdminPlugin<UVIrcClient>("bentkus"); bot.Plugin(adminPlugin); bot.Plugin(new Greeter<UVIrcClient>()); bot.Plugin(new DatabasePlugin<UVIrcClient>(adminPlugin)); bot.Plugin(new JoinPlugin<UVIrcClient>(adminPlugin)); UVTimer.Once(TimeSpan.FromSeconds(1), () => client.Channels.Join("#help")); var stdin = new TTY(0); stdin.Read(Encoding.Default, (line) => { line = line.Trim(); switch (line) { case "quit": Loop.Default.Stop(); break; default: break; } }); stdin.Resume(); Loop.Default.Run(); }
public static void Main(string[] args) { var client = new UVIrcClient(); var bot = new IrcBot <UVIrcClient>(client); bot.Client.Connect("127.0.0.1", new IrcUserRegistrationInfo() { NickName = "txdv-bot", UserName = "******", RealName = "txdv bot", }); var adminPlugin = new AdminPlugin <UVIrcClient>("bentkus"); bot.Plugin(adminPlugin); bot.Plugin(new Greeter <UVIrcClient>()); bot.Plugin(new DatabasePlugin <UVIrcClient>(adminPlugin)); bot.Plugin(new JoinPlugin <UVIrcClient>(adminPlugin)); UVTimer.Once(TimeSpan.FromSeconds(1), () => client.Channels.Join("#help")); var stdin = new TTY(0); stdin.Read(Encoding.Default, (line) => { line = line.Trim(); switch (line) { case "quit": Loop.Default.Stop(); break; default: break; } }); stdin.Resume(); Loop.Default.Run(); }
public static void Main(string[] args) { var context = Context.Create(); IrcBot bot = new IrcBot(context); bot.SendDelay = 0; var adminPlugin = new AdminPlugin("txdv"); bot.Plugin(adminPlugin); bot.Plugin(new TestPlugin(adminPlugin)); bot.Plugin(new FloodPlugin()); //bot.SendDelay = 0; bot.Connect(new string[] { "127.0.0.1" }, 6667, delegate { bot.ActiveChannelSyncing = true; bot.Login("bot", "test bot"); bot.RfcJoin("#six"); }); context.Start(); }
public TestPlugin(AdminPlugin plugin) { AdminPlugin = plugin; On = true; }
public JoinPlugin(AdminPlugin <T> plugin) { AdminPlugin = plugin; }
public DatabasePlugin(AdminPlugin <T> plugin) { AdminPlugin = plugin; On = true; }