コード例 #1
0
ファイル: Bot.cs プロジェクト: epicvrvs/LinguisticsBot
 protected override void OnMessage(User user, string target, string message)
 {
     Console.WriteLine("[{0}] <{1}@{2}> {3}", target, user.Nick, user.Host, message);
     foreach (var pair in MatchHandlers)
     {
         Match match = Regex.Match(message, pair.Key);
         if (match.Success)
         {
             pair.Value(match, user, target, message);
             break;
         }
     }
 }
コード例 #2
0
ファイル: Client.cs プロジェクト: epicvrvs/BIRCh
 protected virtual void OnJoin(User user, string channel)
 {
 }
コード例 #3
0
ファイル: Client.cs プロジェクト: epicvrvs/BIRCh
 protected virtual void OnInvite(User user, string channel)
 {
 }
コード例 #4
0
ファイル: Client.cs プロジェクト: epicvrvs/BIRCh
 protected virtual void OnQuit(User user, string message)
 {
 }
コード例 #5
0
ファイル: Client.cs プロジェクト: epicvrvs/BIRCh
 protected virtual void OnNotice(User user, string target, string message)
 {
 }
コード例 #6
0
ファイル: Client.cs プロジェクト: epicvrvs/BIRCh
 protected virtual void OnMode(User user, string target, string modes)
 {
 }
コード例 #7
0
ファイル: Bot.cs プロジェクト: epicvrvs/LinguisticsBot
 void OnOED(Match match, User user, string target, string message)
 {
     string phonemes = "";
     bool success = OED.GetOEDIPA(match.Groups[1].Value, ref phonemes);
     string response;
     if (success)
         response = phonemes;
     else
         response = "Request failed";
     Respond(user, target, response);
 }
コード例 #8
0
ファイル: Bot.cs プロジェクト: epicvrvs/LinguisticsBot
 void OnIPA(Match match, User user, string target, string message)
 {
     string translation = XSAMPA.TranslateText(match.Groups[1].Value);
     Respond(user, target, translation);
 }
コード例 #9
0
ファイル: Bot.cs プロジェクト: epicvrvs/LinguisticsBot
 protected override void OnInvite(User user, string channel)
 {
     JoinChannel(channel);
 }
コード例 #10
0
ファイル: Bot.cs プロジェクト: epicvrvs/LinguisticsBot
        void Respond(User user, string target, string line)
        {
            bool isPrivateMessage = target.Length > 0 && target[0] != '#';
            if (isPrivateMessage)
                SendMessage(user.Nick, line);
            else

                SendMessage(target, line);
        }
コード例 #11
0
ファイル: Bot.cs プロジェクト: epicvrvs/LinguisticsBot
 void OnVersion(Match match, User user, string target, string message)
 {
     int revision = Assembly.GetCallingAssembly().GetName().Version.Revision;
     string response = string.Format("\x01VERSION From the entrails to the dirt, r{0}\x01", revision);
     SendNotice(user.Nick, response);
 }