diff --git a/CompatBot/Commands/Processors/CommandErroredHandler.cs b/CompatBot/Commands/Processors/CommandErroredHandler.cs index 731f8f82..bcd1c5c5 100644 --- a/CompatBot/Commands/Processors/CommandErroredHandler.cs +++ b/CompatBot/Commands/Processors/CommandErroredHandler.cs @@ -28,7 +28,11 @@ internal static partial class CommandErroredHandler Context: TextCommandContext tctx }) { - if (tctx.Prefix == Config.CommandPrefix || tctx.Prefix == Config.AutoRemoveCommandPrefix) + // if it has a command prefix, check that it's not a random string of punctuation + if ((tctx.Prefix == Config.CommandPrefix + || tctx.Prefix == Config.AutoRemoveCommandPrefix) + && tctx.Message.Content[tctx.Prefix.Length ..] is {Length: >0} args + && !char.IsPunctuation(args[0])) { try { diff --git a/CompatBot/Database/BotDb.cs b/CompatBot/Database/BotDb.cs index bb45e265..bc8bf600 100644 --- a/CompatBot/Database/BotDb.cs +++ b/CompatBot/Database/BotDb.cs @@ -20,6 +20,7 @@ internal class BotDb: DbContext public DbSet Kot { get; set; } = null!; public DbSet Doggo { get; set; } = null!; public DbSet ForcedNicknames { get; set; } = null!; + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { var dbPath = DbImporter.GetDbPath("bot.db", Environment.SpecialFolder.ApplicationData);