Exemple #1
0
 void Bot_OnMessage(Network network, Irc.IrcEventArgs e)
 {
     if (IsMatch("^tell \\?$", e.Data.Message)) {
         AnswerWithNotice(network, e, FormatBold("Use of Tell plugin:"));
         AnswerWithNotice(network, e, FormatItalic("tell <recipient> <message>") + " - Tells <recipient> the <message> the next time he joins.");
     }
     else if (IsMatch("^tell (?<target>.*?) (?<message>.*)$", e.Data.Message)) {
         List<TellInfo> l = LoadFromFile<List<TellInfo>>("Tell");
         TellInfo t = new TellInfo();
         t.Date = DateTime.Now;
         t.Name = e.Data.Nick;
         t.Network = network.Name;
         t.Target = Matches["target"].ToString();
         t.Text = Matches["message"].ToString();
         l.Add(t);
         SaveToFile<List<TellInfo>>(l, "Tell");
         AnswerWithNotice(network, e, "I'll tell your message.");
     }
 }
Exemple #2
0
 void Bot_OnMessage(Network network, Irc.IrcEventArgs e)
 {
     if (IsMatch("^tell \\?$", e.Data.Message))
     {
         AnswerWithNotice(network, e, FormatBold("Use of Tell plugin:"));
         AnswerWithNotice(network, e, FormatItalic("tell <recipient> <message>") + " - Tells <recipient> the <message> the next time he joins.");
     }
     else if (IsMatch("^tell (?<target>.*?) (?<message>.*)$", e.Data.Message))
     {
         List <TellInfo> l = LoadFromFile <List <TellInfo> >("Tell");
         TellInfo        t = new TellInfo();
         t.Date    = DateTime.Now;
         t.Name    = e.Data.Nick;
         t.Network = network.Name;
         t.Target  = Matches["target"].ToString();
         t.Text    = Matches["message"].ToString();
         l.Add(t);
         SaveToFile <List <TellInfo> >(l, "Tell");
         AnswerWithNotice(network, e, "I'll tell your message.");
     }
 }