From 2d7f345c40cac79a93ff394406df865f22ed953a Mon Sep 17 00:00:00 2001 From: Toastie Date: Sun, 7 Jul 2024 18:10:58 +1200 Subject: [PATCH] Updated Common files --- src/EllieBot/_common/Creds.cs | 2 +- src/EllieBot/_common/DbService.cs | 2 +- src/EllieBot/_common/Interaction/EllieInteraction.cs | 2 +- src/EllieBot/_common/Interaction/EllieInteractionService.cs | 3 ++- .../_common/Interaction/Models/EllieButtonInteraction.cs | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/EllieBot/_common/Creds.cs b/src/EllieBot/_common/Creds.cs index 02b62b2..295b1de 100644 --- a/src/EllieBot/_common/Creds.cs +++ b/src/EllieBot/_common/Creds.cs @@ -34,7 +34,7 @@ public sealed class Creds : IBotCredentials Go to https://dashy.elliebot.net/me and login with your discord account Go to the Keys page and click "Generate New Key" and copy it here You and anyone else with the permission to run `.prompt` command will be able to use natural language to run bot's commands. - For example '@Bot how's the weather in Paris' will return the current weather in Paris as if you were to run `.weather Paris` command + For example '@Bot how's the weather in Paris' will return the current weather in Paris as if you were to run `.weather Paris` command. """)] public string EllieAiToken { get; set; } diff --git a/src/EllieBot/_common/DbService.cs b/src/EllieBot/_common/DbService.cs index cdff91f..46d2016 100644 --- a/src/EllieBot/_common/DbService.cs +++ b/src/EllieBot/_common/DbService.cs @@ -11,5 +11,5 @@ public abstract class DbService public abstract Task SetupAsync(); public abstract DbContext CreateRawDbContext(string dbType, string connString); - public abstract DbContext GetDbContext(); + public abstract EllieContext GetDbContext(); } \ No newline at end of file diff --git a/src/EllieBot/_common/Interaction/EllieInteraction.cs b/src/EllieBot/_common/Interaction/EllieInteraction.cs index c35cebd..05b258f 100644 --- a/src/EllieBot/_common/Interaction/EllieInteraction.cs +++ b/src/EllieBot/_common/Interaction/EllieInteraction.cs @@ -29,7 +29,7 @@ public abstract class EllieInteractionBase _onlyAuthor = onlyAuthor; _singleUse = singleUse; _clearAfter = clearAfter; - + _interactionCompletedSource = new(TaskCreationOptions.RunContinuationsAsynchronously); Client = client; diff --git a/src/EllieBot/_common/Interaction/EllieInteractionService.cs b/src/EllieBot/_common/Interaction/EllieInteractionService.cs index 2cdfe30..813ba1f 100644 --- a/src/EllieBot/_common/Interaction/EllieInteractionService.cs +++ b/src/EllieBot/_common/Interaction/EllieInteractionService.cs @@ -29,7 +29,8 @@ public class EllieInteractionService : IEllieInteractionService, IEService Func onTrigger, in T state, bool singleUse = true, - bool clearAfter = true) + bool clearAfter = true + ) => Create(userId, button, ((Func>)((data) diff --git a/src/EllieBot/_common/Interaction/Models/EllieButtonInteraction.cs b/src/EllieBot/_common/Interaction/Models/EllieButtonInteraction.cs index 80f5c92..0a80839 100644 --- a/src/EllieBot/_common/Interaction/Models/EllieButtonInteraction.cs +++ b/src/EllieBot/_common/Interaction/Models/EllieButtonInteraction.cs @@ -10,7 +10,7 @@ public sealed class EllieButtonInteractionHandler : EllieInteractionBase bool onlyAuthor, bool singleUse = true, bool clearAfter = true) - : base(client, authorId, button.CustomId, onAction, onlyAuthor, singleUse) + : base(client, authorId, button.CustomId, onAction, onlyAuthor, singleUse, clearAfter) { Button = button; }