public static void OnQueryMessage(object sender, IrcEventArgs e) { if (e.Data.From == "[email protected]") { System.Console.WriteLine("[" + DateTime.Now.ToString("HH:mm:ss") + "] Query: " + e.Data.Nick + " | " + e.Data.Message); switch (e.Data.MessageArray[0]) { case "host": irc.SendMessage(SendType.Message, e.Data.Nick, "e.Data.From: " + e.Data.From); irc.SendMessage(SendType.Message, e.Data.Nick, "e.Data.Host: " + e.Data.Host); irc.SendMessage(SendType.Message, e.Data.Nick, "e.Data.Ident: " + e.Data.Ident); irc.SendMessage(SendType.Message, e.Data.Nick, "e.Data.Nick: " + e.Data.Nick); break; case "join": irc.RfcJoin(e.Data.MessageArray[1]); break; case "leave": case "part": irc.RfcPart(e.Data.MessageArray[1]); break; case "die": Exit(); break; case "add": if (e.Data.MessageArray.Length > 1) { RandomDogFromFile.Add(e.Data.MessageArray[1]); } break; } } else { irc.SendMessage(SendType.Message, e.Data.Nick, "Bark! You are not my owner."); } }
public static void OnMessage(object sender, IrcEventArgs e) { switch (e.Data.MessageArray[0].ToLower()) { // LIST case "!list": System.Console.WriteLine("[" + DateTime.Now.ToString("HH:mm:ss") + "] " + e.Data.Channel + " - " + e.Data.Nick + " | " + e.Data.Message); irc.SendMessage(SendType.Message, e.Data.Channel, "!dog !dogpic !dogpics"); irc.SendMessage(SendType.Message, e.Data.Channel, "!randomdog !random.dog"); irc.SendMessage(SendType.Message, e.Data.Channel, "!randomcat !random.cat"); irc.SendMessage(SendType.Message, e.Data.Channel, "!awoo !woof !meow"); irc.SendMessage(SendType.Message, e.Data.Channel, "!oida"); break; // RANDOM DOG SELFHOSTED case "!dog": case "!dogpic": case "!dogpics": System.Console.WriteLine("[" + DateTime.Now.ToString("HH:mm:ss") + "] " + e.Data.Channel + " - " + e.Data.Nick + " | " + e.Data.Message); irc.SendMessage(SendType.Message, e.Data.Channel, RandomDogFromFile.Get() + " 🐾"); break; case "!add": if (e.Data.MessageArray.Length > 1) { RandomDogFromFile.Add(e.Data.MessageArray[1]); } break; // RANDOM DOG case "!drecksvieh": case "!randomdog": case "!random.dog": System.Console.WriteLine("[" + DateTime.Now.ToString("HH:mm:ss") + "] " + e.Data.Channel + " - " + e.Data.Nick + " | " + e.Data.Message); irc.SendMessage(SendType.Message, e.Data.Channel, RandomDog.Get() + " 🐾"); break; // RANDOM CAT case "!randomcat": case "!random.cat": Console.WriteLine("[" + DateTime.Now.ToString("HH:mm:ss") + "] " + e.Data.Channel + " - " + e.Data.Nick + " | " + e.Data.Message); irc.SendMessage(SendType.Message, e.Data.Channel, RandomCat.Get() + " 🐾"); break; // REACTION COMMANDS case "!awoo": Console.WriteLine("[" + DateTime.Now.ToString("HH:mm:ss") + "] " + e.Data.Channel + " - " + e.Data.Nick + " | " + e.Data.Message); irc.SendMessage(SendType.Message, e.Data.Channel, "Awoo!"); break; case "!woof": Console.WriteLine("[" + DateTime.Now.ToString("HH:mm:ss") + "] " + e.Data.Channel + " - " + e.Data.Nick + " | " + e.Data.Message); irc.SendMessage(SendType.Message, e.Data.Channel, "Woof!"); break; case "!meow": Console.WriteLine("[" + DateTime.Now.ToString("HH:mm:ss") + "] " + e.Data.Channel + " - " + e.Data.Nick + " | " + e.Data.Message); irc.SendMessage(SendType.Message, e.Data.Channel, "meow!"); break; case "!oida": if (e.Data.MessageArray.Length > 1) { Console.WriteLine("[" + DateTime.Now.ToString("HH:mm:ss") + "] " + e.Data.Channel + " - " + e.Data.Nick + " | " + e.Data.Message); irc.SendMessage(SendType.Message, e.Data.Channel, "Oida " + e.Data.MessageArray[1] + "!"); break; } else { Console.WriteLine("[" + DateTime.Now.ToString("HH:mm:ss") + "] " + e.Data.Channel + " - " + e.Data.Nick + " | " + e.Data.Message); irc.SendMessage(SendType.Message, e.Data.Channel, "Oida!"); break; } } }