mirror of
https://github.com/RPCS3/discord-bot.git
synced 2026-01-31 01:25:22 +01:00
more checks when to delete old text commands
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
@@ -20,6 +20,7 @@ internal class BotDb: DbContext
|
||||
public DbSet<Kot> Kot { get; set; } = null!;
|
||||
public DbSet<Doggo> Doggo { get; set; } = null!;
|
||||
public DbSet<ForcedNickname> ForcedNicknames { get; set; } = null!;
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
var dbPath = DbImporter.GetDbPath("bot.db", Environment.SpecialFolder.ApplicationData);
|
||||
|
||||
Reference in New Issue
Block a user