mirror of
https://github.com/RPCS3/discord-bot.git
synced 2026-01-31 01:25:22 +01:00
Merge branch 'vnext'
This commit is contained in:
@@ -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))
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user