mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-19 15:51:58 +00:00
fix start spam false positives
This commit is contained in:
1 parent
4954d01467
commit
0d94760321
1 file changed
+31
-23
+31
-23
@@ -147,34 +147,42 @@ public static class SpamManager
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private static readonly string[] StartWords =
|
||||
[
|
||||
"start",
|
||||
"started",
|
||||
"begin",
|
||||
"commence",
|
||||
"proceed",
|
||||
|
||||
// Russian
|
||||
"старт",
|
||||
"начни",
|
||||
"начинай",
|
||||
"го",
|
||||
"гоу",
|
||||
private static readonly Dictionary<SupportedLangs, string[]> StartWords = new()
|
||||
{
|
||||
[SupportedLangs.English] =
|
||||
[
|
||||
"start",
|
||||
"begin",
|
||||
"commence"
|
||||
],
|
||||
|
||||
// Chinese
|
||||
"开",
|
||||
"开始",
|
||||
"快开",
|
||||
[SupportedLangs.Russian] =
|
||||
[
|
||||
// Russian
|
||||
"старт",
|
||||
"начни",
|
||||
"начинай",
|
||||
"гоу"
|
||||
],
|
||||
|
||||
// Pinyin
|
||||
"kai",
|
||||
"kaishi"
|
||||
];
|
||||
[SupportedLangs.SChinese] =
|
||||
[
|
||||
"开始",
|
||||
"快开"
|
||||
],
|
||||
|
||||
[SupportedLangs.TChinese] =
|
||||
[
|
||||
"开始",
|
||||
"快开"
|
||||
]
|
||||
};
|
||||
|
||||
private static bool ContainsStart(string text)
|
||||
{
|
||||
if (!StartWords.TryGetValue(GetUserTrueLang(), out string[] words)) return false;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(text))
|
||||
return false;
|
||||
|
||||
@@ -183,7 +191,7 @@ public static class SpamManager
|
||||
|
||||
string normalized = Normalize(text);
|
||||
|
||||
foreach (string word in StartWords)
|
||||
foreach (string word in words)
|
||||
{
|
||||
string target = Normalize(word);
|
||||
|
||||
|
||||
Reference in new issue
Block a user