From 580b4dfe7bbf874194506d4550d99076b7d2f40f Mon Sep 17 00:00:00 2001 From: spiral Date: Mon, 28 Nov 2022 17:45:26 -0500 Subject: [PATCH] feat(bot): add interaction logging info for debugging with Discord --- PluralKit.Bot/Handlers/InteractionCreated.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/PluralKit.Bot/Handlers/InteractionCreated.cs b/PluralKit.Bot/Handlers/InteractionCreated.cs index 43721175..1c1f3498 100644 --- a/PluralKit.Bot/Handlers/InteractionCreated.cs +++ b/PluralKit.Bot/Handlers/InteractionCreated.cs @@ -1,5 +1,7 @@ using Autofac; +using Serilog; + using Myriad.Gateway; using Myriad.Types; @@ -9,17 +11,20 @@ public class InteractionCreated: IEventHandler { private readonly InteractionDispatchService _interactionDispatch; private readonly ILifetimeScope _services; + private readonly ILogger _logger; - public InteractionCreated(InteractionDispatchService interactionDispatch, ILifetimeScope services) + public InteractionCreated(InteractionDispatchService interactionDispatch, ILifetimeScope services, ILogger logger) { _interactionDispatch = interactionDispatch; _services = services; + _logger = logger; } public async Task Handle(int shardId, InteractionCreateEvent evt) { if (evt.Type == Interaction.InteractionType.MessageComponent) { + _logger.Information($"Discord debug: got interaction with ID {evt.Id} from custom ID {evt.Data?.CustomId}"); var customId = evt.Data?.CustomId; if (customId == null) return;