internal static void ChatSentHandler(object sender, ChatSentEventArgs args) { bool enabled = ConfigKey.IRCBotForwardFromServer.Enabled(); switch (args.MessageType) { case ChatMessageType.Global: if (enabled) { SendChannelMessage(args.Player.ClassyName + Color.IRCReset + ": " + args.Message); } else if (args.Message.StartsWith("#")) { SendChannelMessage(args.Player.ClassyName + Color.IRCReset + ": " + args.Message.Substring(1)); } break; case ChatMessageType.Me: case ChatMessageType.Say: if (enabled) { SendAction(args.FormattedMessage); } break; } }
//Used only for non-public chat private void ProcessOutgoingChat(ChatSentEventArgs e) { StringBuilder sb = new StringBuilder(); switch (e.Type) { case ChatType.Normal: sb.Append(": "); break; case ChatType.Whisper: sb.Append(" whisper: "); break; case ChatType.Shout: sb.Append(" shout: "); break; } sb.Append(e.Message); ChatBufferItem item = new ChatBufferItem( DateTime.Now, string.Format("(channel {0}) {1}", e.Channel, client.Self.Name), client.Self.AgentID, sb.ToString(), ChatBufferTextStyle.StatusDarkBlue); ProcessBufferItem(item, true); sb = null; }
private void netcom_ChatSent(object sender, ChatSentEventArgs e) { if (e.Channel == 0) { return; } ProcessOutgoingChat(e); }
private void netcom_ChatSent(object sender, ChatSentEventArgs e) { tabs["chat"].Highlight(); }