public override void OnPluginMessage(BotShell bot, PluginMessage message) { try { if (message.Command != "announce") { return; } if (message.Args.Length < 3) { return; } string group = (string)message.Args[0]; if (group == null || group == string.Empty) { return; } string source = (string)message.Args[1]; if (source == null || source == string.Empty) { return; } string sender = (string)message.Args[2]; if (sender == null || sender == string.Empty) { return; } string msg = (string)message.Args[3]; if (msg == null || msg == string.Empty) { return; } string formattedMessage = bot.ColorHighlight + "Message from " + HTML.CreateColorString(bot.ColorHeaderHex, sender) + " on " + HTML.CreateColorString(bot.ColorHeaderHex, source) + " »» " + bot.ColorNormal + msg; string[] members = this._friendsList.GetOnlineMembers(group, true); bot.SendPrivateMessage(sender, bot.ColorHighlight + "Sending out an announcement to " + HTML.CreateColorString(bot.ColorHeaderHex, members.Length.ToString()) + " members"); foreach (string member in members) { bot.SendPrivateMessage(bot.GetUserID(member), formattedMessage, AoLib.Net.PacketQueue.Priority.Low, true); } members = this._friendsList.GetOnlineMembers(group, false); bot.SendReplyMessage(this.InternalName, message, (object)members); } catch (Exception ex) { Console.WriteLine(ex.ToString()); throw new Exception("exception", ex); } }