浏览代码

Added message cleaning for detecting nicknames

tags/3.1.0
Teknikode 5 年前
父节点
当前提交
0f034bff74
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4
    1
      Modules/Spam Control/Spam_Control.cs

+ 4
- 1
Modules/Spam Control/Spam_Control.cs 查看文件

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading;
using Combot.IRCServices;
using Combot.IRCServices.Messaging;
@@ -125,7 +126,9 @@ namespace Combot.Modules.Plugins
bool unbanResponse = Convert.ToBoolean(GetOptionValue("Unban Response"));

// Check for highlight spam
List<string> splitMessage = message.Message.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).ToList();
Regex regEx = new Regex(@"[^a-zA-Z0-9_\-\[\]`\^|\\]");
string cleanMessage = regEx.Replace(message.Message, " ");
List<string> splitMessage = cleanMessage.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).ToList();
Channel channel = Bot.IRC.Channels.Find(chan => chan.Name == message.Channel);
if (channel != null)
{

正在加载...
取消
保存