コード例 #1
0
ファイル: AlertMeReborn.cs プロジェクト: parrot-dev/AlertMe
 private async void ShoutReceived(object sender, ff14bot.Managers.ChatEventArgs e)
 {
     if (Settings.Current.Shout.Enabled)
     {
         var  msg    = e.ChatLogEntry.Contents;
         var  author = e.ChatLogEntry.SenderDisplayName;
         bool match  = false;
         if (authorCheck(author))
         {
             match = msgMatchesCrit(Settings.Current.Shout, msg);
             if (match)
             {
                 SndPlayer.play("chat.wav");
                 Log.Bot.Print("[Shout] Message received");
                 if (Settings.Current.Shout.PushBulletEnabled && Settings.Current.pushBullet.Enabled)
                 {
                     await new PushBullet.Note("AlertMe", String.Format("From: {0}\r\n{1} {2}", author, '[' + Log.Chat.Channels.Shout.ToString() + ']', msg)).Push();
                 }
             }
         }
         if (match || Settings.Current.chatLog.LogAll)
         {
             Log.Chat.PrintMsg(Log.Chat.Channels.Shout, msg, author);
         }
     }
 }
コード例 #2
0
        private async void EmoteMessageReceived(object sender, ff14bot.Managers.ChatEventArgs e)
        {
            if (Settings.current.Emote.Enabled)
            {
                var  msg    = e.ChatLogEntry.Contents;
                var  author = e.ChatLogEntry.SenderDisplayName;
                bool match  = false;
                if (authorCheck(author))
                {
                    match = msgMatchesCrit(Settings.current.Emote, msg);
                    if (match)
                    {
                        SndPlayer.play("emote.wav");
                        Log.Bot.print("收到来自[情感动作]的消息");

                        if (Settings.current.Emote.Reply && !Replied)
                        {
                            await Task.Delay(5000);

                            ChatManager.SendChat("/p " + Settings.current.Emote.ReplyText);
                            Replied = true;
                            await Task.Delay(300000);

                            Replied = false;
                        }
                    }
                }
                if (match || Settings.current.chatLog.LogAll)
                {
                    Log.Chat.printMsg(Log.Chat.Channels.Emote, msg, author);
                }
            }
        }
コード例 #3
0
ファイル: AlertMeReborn.cs プロジェクト: parrot-dev/AlertMe
        private async void TellReceived(object sender, ff14bot.Managers.ChatEventArgs e)
        {
            if (Settings.Current.PM.Enabled)
            {
                var msg    = e.ChatLogEntry.Contents;
                var author = e.ChatLogEntry.SenderDisplayName;

                SndPlayer.play("pm.wav");
                Log.Bot.Print("[PM] message received");
                Log.Chat.PrintMsg(Log.Chat.Channels.Pm, msg, author);
                if (Settings.Current.PM.PushBulletEnabled && Settings.Current.pushBullet.Enabled)
                {
                    await new PushBullet.Note("AlertMe", String.Format("From: {0}\r\n{1} {2}", author, '[' + Log.Chat.Channels.Pm.ToString() + ']', msg)).Push();
                }
            }
        }