Merge branch 'vnext'

This commit is contained in:
13xforever
2025-12-22 16:22:17 +05:00
2 changed files with 12 additions and 4 deletions

View File

@@ -18,8 +18,8 @@ internal static class SqlConfiguration
foreach (var stateVar in setVars)
if (stateVar.Value is string value)
Config.InMemorySettings[stateVar.Key[ConfigVarPrefix.Length ..]] = value;
if (!Config.InMemorySettings.TryGetValue(nameof(Config.GoogleApiCredentials), out var googleCreds) ||
string.IsNullOrEmpty(googleCreds))
if (!Config.InMemorySettings.TryGetValue(nameof(Config.GoogleApiCredentials), out var googleCreds)
|| string.IsNullOrEmpty(googleCreds))
{
if (Path.Exists(Config.GoogleApiConfigPath))
{

View File

@@ -21,7 +21,15 @@ public static class AntiSpamMessageHandler
#endif
var msg = args.Message;
if (msg.Content is not { Length: > 0 })
if (msg is { Components: [{ Type: (DiscordComponentType)20 }] }
&& !args.Channel.IsOfftopicChannel())
{
await msg.DeleteAsync().ConfigureAwait(false);
Config.Log.Debug($"Removed checkpoint spam message from user {author.Username} ({author.Id}) in #{msg.Channel?.Name}");
return false;
}
if (msg.Content is not { Length: >0 })
return true;
if (MessageCache.TryGetValue(author.Id, out var item)
@@ -42,7 +50,7 @@ public static class AntiSpamMessageHandler
}
catch (Exception e)
{
Config.Log.Warn(e, $"Faled to delete spam message from user {author.Username} ({author.Id}) in #{msg.Channel?.Name} {msg.JumpLink}");
Config.Log.Warn(e, $"Failed to delete spam message from user {author.Username} ({author.Id}) in #{msg.Channel?.Name} {msg.JumpLink}");
}
try
{