From 3103df856c1c832c838dbea43d3d08a697fa39cd Mon Sep 17 00:00:00 2001 From: Ske Date: Sun, 21 Jul 2019 03:44:26 +0200 Subject: [PATCH] Only log deleted messages if they were found previously --- PluralKit.Core/Stores.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/PluralKit.Core/Stores.cs b/PluralKit.Core/Stores.cs index e42e49ef..9a5ca0c0 100644 --- a/PluralKit.Core/Stores.cs +++ b/PluralKit.Core/Stores.cs @@ -223,9 +223,8 @@ namespace PluralKit { public async Task Delete(ulong id) { using (var conn = await _conn.Obtain()) - await conn.ExecuteAsync("delete from messages where mid = @Id", new { Id = id }); - - _logger.Information("Deleted message {Message}", id); + if (await conn.ExecuteAsync("delete from messages where mid = @Id", new { Id = id }) > 0) + _logger.Information("Deleted message {Message}", id); } public async Task Count()