dev: Removed discrim from the database

add: .translateflags command
add: captcha to timely, configurable in .conf gambling
change: change bonuses for patreon rewards
fix: nunchi message color fix
This commit is contained in:
Kwoth
2024-11-02 16:23:58 +00:00
parent 12f4ce7f2a
commit 4b12e4e923
29 changed files with 7782 additions and 333 deletions

View File

@@ -201,9 +201,12 @@ public sealed partial class GoogleApiService : IGoogleApiService, INService
{
string text;
if (!Languages.ContainsKey(sourceLanguage) || !Languages.ContainsKey(targetLanguage))
if (!Languages.ContainsKey(targetLanguage))
throw new ArgumentException(nameof(sourceLanguage) + "/" + nameof(targetLanguage));
if (string.IsNullOrWhiteSpace(sourceLanguage) || !Languages.ContainsKey(sourceLanguage))
sourceLanguage = "auto";
var url = new Uri(string.Format(
"https://translate.googleapis.com/translate_a/single?client=gtx&sl={0}&tl={1}&dt=t&q={2}",
@@ -223,7 +226,7 @@ public sealed partial class GoogleApiService : IGoogleApiService, INService
private string ConvertToLanguageCode(string language)
{
Languages.TryGetValue(language, out var mode);
return mode;
return string.IsNullOrWhiteSpace(mode) ? language : mode;
}
}

View File

@@ -154,7 +154,6 @@ public sealed partial class GoogleApiService
}
Languages = langs;
}
}