Exemple #1
0
 public async Task SuperChatRoute(object sender, ReceivedDanmakuArgs e)
 {
     // check user eligibility
     if (!Conf.CheckUserEligibility(e))
     {
         return;
     }
     // check content eligibility
     if (!Conf.CheckKeywordEligibility(e))
     {
         return;
     }
     // check length rule
     if (!Conf.CheckDanmakuLength(e))
     {
         return;
     }
     Bridge.ALog("规则检查通过,准备朗读");
     await TTSPlayer.UnifiedPlay(ProcessSuperChat(e), Vars.CurrentConf.SuperChatIgnoreRandomDitch);
 }
Exemple #2
0
        public async Task CommentRoute(object sender, ReceivedMessageArgs e)
        {
            // check user eligibility
            if (!Conf.CheckUserEligibility(e))
            {
                return;
            }
            // check content eligibility
            if (!Conf.CheckKeywordEligibility(e))
            {
                return;
            }
            // check length rule
            if (!Conf.CheckDanmakuLength(e))
            {
                return;
            }
            Bridge.ALog("规则检查通过,准备朗读");
            if (Vars.CurrentConf.VoiceReplyFirst)
            {
                var hitAnyRule = await TTSPlayer.PlayVoiceReply(e.Message);

                if (!hitAnyRule || !Vars.CurrentConf.IgnoreIfHitVoiceReply)
                {
                    await TTSPlayer.UnifiedPlay(ProcessDanmaku(e));
                }
            }
            else
            {
                var hitAnyRule = Vars.CurrentConf.VoiceReplyRules.Any(x => x.Matches(e.Message));
                if (!hitAnyRule || !Vars.CurrentConf.IgnoreIfHitVoiceReply)
                {
                    await TTSPlayer.UnifiedPlay(ProcessDanmaku(e));
                }
                await TTSPlayer.PlayVoiceReply(e.Message);
            }
        }