public override void Use(Player p, string message, CommandData data) { RelayBot bot = Bot; if (message.CaselessEq("reset") || message.CaselessEq("reconnect")) { if (!bot.Enabled) { p.Message("{0} is not enabled", bot.RelayName); } bot.Reset(); } else if (message.CaselessEq("connect")) { string err = bot.Connect(); if (err != null) { p.Message("{0} bot {1}", bot.RelayName, err); } } else if (message.CaselessEq("disconnect")) { bot.Disconnect("Disconnecting IRC bot"); } else { Help(p); } }
protected void Use(Player p, string message, RelayBot bot) { if (message.CaselessEq("reset") || message.CaselessEq("reconnect")) { if (!bot.Enabled) { p.Message("{0} is not enabled", bot.RelayName); } bot.Reset(); } else if (message.CaselessEq("connect")) { if (!bot.Enabled) { p.Message("{0} is not enabled", bot.RelayName); } bot.Connect(); } else if (message.CaselessEq("disconnect")) { bot.Disconnect("Disconnecting IRC bot"); } else { Help(p); } }