fix start spam false positives

This commit is contained in:
Gurge44 committed 2026-06-12 18:21:19 +02:00
1 parent 4954d01467
commit 0d94760321
1 file changed
+31 -23
+31 -23
View File
@@ -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);