Esempio n. 1
0
        private void File_OnMessageReceived(object sender, OnMessageReceivedArgs e)
        {
            /*
             * Метод мута пользователя , если тот напишет слово из файла
             */
            string[] Censor         = null;
            string   for_search     = e.ChatMessage.Message;
            string   directory_file = @"C:\Users\Rumaruka\Desktop\rmkboter\TwitchChatBot\ModedList\sensor.txt";

            if (File.Exists(directory_file))
            {
                Censor = File.ReadAllLines(directory_file);
            }
            if (Censor != null)
            {
                bool found = false;
                foreach (string word in Censor)
                {
                    if (for_search.ToLower().Contains(word))
                    {
                        found = true;
                    }
                }
                if (found)
                {
                    Console.WriteLine(found);
                    var reply = $"{e.ChatMessage.Username}, уходи с матом.";
                    TimeoutUserExt.TimeoutUser(client, e.ChatMessage.Username, TimeSpan.FromMinutes(10), message: reply);
                    found = false;

                    if (e.ChatMessage.IsBroadcaster)
                    {
                        client.SendMessage(e.ChatMessage.Channel, "Test");
                        found = false;
                    }
                }
            }
        }
Esempio n. 2
0
 private void ViolatesProtections(string username, bool sub, bool mod, ChatMessage message)
 {
     try
     {
         if (sub)
         {
             return;
         }
         if (mod)
         {
             return;
         }
         if (ViolateCapsProtection(message.Message))
         {
             var reply = $"@{username}, пожалуйста не капси.";
             TimeoutUserExt.TimeoutUser(client, username, TimeSpan.FromMinutes(10), message: reply);
         }
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }
Esempio n. 3
0
        //Caps Protection Ending

        //Рулетка
        private void RuletkaMuted(string username, bool sub, bool mod)
        {
            var reply = $"@{username}, я попал.";

            TimeoutUserExt.TimeoutUser(client, username, TimeSpan.FromSeconds(10), message: reply);
        }