private void OnIrcWelcome(object sender, IrcEventArgs e) { Irc.Join(Settings.Default.IrcChannel); }
private void OnIrcPrivMsg(object sender, IrcEventArgs e) { for (int i = 0; i < e.Args[1].Length; i++) if (!Settings.Default.AllowedChatChars.Contains(e.Args[1][i])) return; Broadcast("§7[IRC] " + e.Prefix.Nickname + ":§f " + e.Args[1], sendToIrc: false); e.Handled = true; }
private void Irc_Received(object sender, IrcEventArgs e) { if (e.Handled) return; switch (e.Command) { case "PRIVMSG": OnIrcPrivMsg(sender, e); break; case "NOTICE": OnIrcNotice(sender, e); break; case "001": OnIrcWelcome(sender, e); break; } }
private void OnIrcWelcome(object sender, IrcEventArgs e) { Irc.Join(ChraftConfig.IrcChannel); }
private void OnIrcNotice(object sender, IrcEventArgs e) { for (int i = 0; i < e.Args[1].Length; i++) if (!ChraftConfig.AllowedChatChars.Contains(e.Args[1][i])) return; Broadcast("§c[IRC] " + e.Prefix.Nickname + ":§f " + e.Args[1], sendToIrc: false); e.Handled = true; }
private void OnReceive(HostMask prefix, string command, string[] args) { if (Received != null) { IrcEventArgs e = new IrcEventArgs(prefix, command, args); Received.Invoke(this, e); if (e.Handled) return; } switch (command) { case "NICK": OnNick(prefix, args); break; case "PING": OnPing(args); break; case "001": OnWelcome(args); break; case "002": OnYourHost(args); break; case "003": OnCreated(args); break; case "004": OnMyInfo(args); break; } }