Beispiel #1
0
 public IrcLine Absorb(IrcLine line)
 {
     IrcLine clone = line.Clone ();
     Mask = clone.Mask;
     Method = clone.Method;
     Data = clone.Data;
     return this;
 }
Beispiel #2
0
 public void callCommand(string commandName, IrcLine line, string chan, string rest)
 {
     try {
         typeof(CommandHandler).GetMethod("cmd_"+commandName.Substring (Config.CmdPrefix.Length).ToUpper ()).Invoke(CmdHandler, new object[] {this, line.Mask.Nick, chan, rest});
     } catch (NullReferenceException) {
         Msg (line.Mask.Nick, "Unknown command "+commandName);
     }
 }
Beispiel #3
0
 public void onNumericMethod(string toCall, IrcLine line)
 {
     try {
         typeof(IrcBot).GetMethod (toCall.TrimWhitespace ()).Invoke (this, new object[] {line});
     } catch (NullReferenceException) {
         Console.WriteLine ("[WARNING] Numeric Method "+toCall+" not implemented (yet).");
     }
 }
Beispiel #4
0
 public void onNames(IrcLine iline)
 {
     string[] splitteddata = iline.Data.Split(":");
     string[] nicks = splitteddata[1].Split (" ");
     int length = iline.Data.IndexOf (":")-iline.Data.IndexOf ("#");
     string channelName = iline.Data.Substring (iline.Data.IndexOf("#"), length-1);
     Channels.Add (new IrcChannel(channelName, nicks.ToList ()));
     Console.WriteLine (Channels.Last().Identifier);
     Console.WriteLine (Channels.Last ().Contains.First ());
     /* Woo for IrcChannel Semantics! */
 }
Beispiel #5
0
 public bool Exec(string cmd, IrcLine iline)
 {
     return Write (cmd+" "+iline.Data);
 }