From 034cb9e50f11ee14a78b362850ac2228c428e016 Mon Sep 17 00:00:00 2001 From: Fabio Gaming Date: Wed, 8 May 2024 17:17:28 +0200 Subject: [PATCH] =?UTF-8?q?Projektdateien=20hinzuf=C3=BCgen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Amino.NET.Interactions.sln | 25 +++++++ .../Amino.NET.Interactions.csproj | 13 ++++ Amino.NET.Interactions/Attributes/Command.cs | 24 +++++++ .../Attributes/EnabledInDms.cs | 18 +++++ .../Attributes/PermissionGroup.cs | 28 ++++++++ Amino.NET.Interactions/InteractionBase.cs | 15 ++++ Amino.NET.Interactions/InteractionsClient.cs | 71 +++++++++++++++++++ Amino.NET.Interactions/Objects/Interaction.cs | 20 ++++++ .../Objects/InteractionModule.cs | 12 ++++ 9 files changed, 226 insertions(+) create mode 100644 Amino.NET.Interactions.sln create mode 100644 Amino.NET.Interactions/Amino.NET.Interactions.csproj create mode 100644 Amino.NET.Interactions/Attributes/Command.cs create mode 100644 Amino.NET.Interactions/Attributes/EnabledInDms.cs create mode 100644 Amino.NET.Interactions/Attributes/PermissionGroup.cs create mode 100644 Amino.NET.Interactions/InteractionBase.cs create mode 100644 Amino.NET.Interactions/InteractionsClient.cs create mode 100644 Amino.NET.Interactions/Objects/Interaction.cs create mode 100644 Amino.NET.Interactions/Objects/InteractionModule.cs diff --git a/Amino.NET.Interactions.sln b/Amino.NET.Interactions.sln new file mode 100644 index 0000000..c897580 --- /dev/null +++ b/Amino.NET.Interactions.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.8.34330.188 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Amino.NET.Interactions", "Amino.NET.Interactions\Amino.NET.Interactions.csproj", "{A276DEEE-67F4-413E-AD98-9682115EF271}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A276DEEE-67F4-413E-AD98-9682115EF271}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A276DEEE-67F4-413E-AD98-9682115EF271}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A276DEEE-67F4-413E-AD98-9682115EF271}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A276DEEE-67F4-413E-AD98-9682115EF271}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {02D099D6-D8D6-47C0-9C42-D03D37F8D53F} + EndGlobalSection +EndGlobal diff --git a/Amino.NET.Interactions/Amino.NET.Interactions.csproj b/Amino.NET.Interactions/Amino.NET.Interactions.csproj new file mode 100644 index 0000000..12cdba7 --- /dev/null +++ b/Amino.NET.Interactions/Amino.NET.Interactions.csproj @@ -0,0 +1,13 @@ + + + + net7.0 + enable + enable + + + + + + + diff --git a/Amino.NET.Interactions/Attributes/Command.cs b/Amino.NET.Interactions/Attributes/Command.cs new file mode 100644 index 0000000..c0adca3 --- /dev/null +++ b/Amino.NET.Interactions/Attributes/Command.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Amino.Interactions.Attributes +{ + public class Command : Attribute + { + public string CommandName { get; } + public string CommandDescription { get; } + public string CommunityId { get; } + + public Command(string commandName, string commandDescription = null, string communityId = null) + { + this.CommandName = commandName; + this.CommunityId = communityId; + this.CommandDescription = commandDescription; + } + + + } +} diff --git a/Amino.NET.Interactions/Attributes/EnabledInDms.cs b/Amino.NET.Interactions/Attributes/EnabledInDms.cs new file mode 100644 index 0000000..060ff77 --- /dev/null +++ b/Amino.NET.Interactions/Attributes/EnabledInDms.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Amino.Interactions.Attributes +{ + public class EnabledInDms : Attribute + { + public bool IsEnabledInDms { get; } = true; + + public EnabledInDms(bool isEnabledInDms) + { + IsEnabledInDms = isEnabledInDms; + } + } +} diff --git a/Amino.NET.Interactions/Attributes/PermissionGroup.cs b/Amino.NET.Interactions/Attributes/PermissionGroup.cs new file mode 100644 index 0000000..9745e64 --- /dev/null +++ b/Amino.NET.Interactions/Attributes/PermissionGroup.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Amino.Interactions.Attributes +{ + public class PermissionGroup + { + public enum PermissionGroups + { + All, + Chat_Staff, + Staff, + Curator, + Leader, + Agent + } + + public PermissionGroups RequiredPermission { get; set; } = PermissionGroups.All; + + public PermissionGroup(PermissionGroups permissionGroup) + { + this.RequiredPermission = permissionGroup; + } + } +} diff --git a/Amino.NET.Interactions/InteractionBase.cs b/Amino.NET.Interactions/InteractionBase.cs new file mode 100644 index 0000000..4c07d39 --- /dev/null +++ b/Amino.NET.Interactions/InteractionBase.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Amino.Interactions +{ + public class InteractionBase + { + public Objects.Interaction Context; + + + } +} diff --git a/Amino.NET.Interactions/InteractionsClient.cs b/Amino.NET.Interactions/InteractionsClient.cs new file mode 100644 index 0000000..907cf3e --- /dev/null +++ b/Amino.NET.Interactions/InteractionsClient.cs @@ -0,0 +1,71 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; + +namespace Amino.Interactions +{ + public partial class InteractionsClient + { + + public Dictionary InteractionModules; + public Queue InteractionQueue; + + public enum LogLevels + { + None, + Debug, + Warning, + Error + } + + private Amino.Client AminoClient; + public int InteractionCooldown = 2000; + public string InteractionPrefix = "/"; + public bool IgnoreSelf = true; + public LogLevels LogLevel = LogLevels.None; + + + + public InteractionsClient(Amino.Client client) + { + this.AminoClient = client; + this.InteractionQueue = new Queue(); + this.InteractionModules = new Dictionary(); + _ = Task.Run(async () => { HandleInteractionQueue(); }); + } + + + public Task RegisterModule() where T : InteractionBase + { + + } + + public Task RegisterModules(Assembly entrypoint) + { + + } + + public bool HandleInteraction(Objects.Interaction interaction) + { + + } + + private async Task HandleInteractionQueue() + { + while(true) + { + if(InteractionQueue.Count != 0) + { + HandleInteraction(InteractionQueue.Dequeue()); + } + await Task.Delay(this.InteractionCooldown); + } + } + + + } +} diff --git a/Amino.NET.Interactions/Objects/Interaction.cs b/Amino.NET.Interactions/Objects/Interaction.cs new file mode 100644 index 0000000..84d6959 --- /dev/null +++ b/Amino.NET.Interactions/Objects/Interaction.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Amino.Interactions.Objects +{ + public class Interaction + { + public string InteractionChatId { get; set; } + public string InteractionName { get; set; } + public Amino.Client AminoClient { get; set; } + public Objects.InteractionModule BaseModule { get; set; } + public Amino.Objects.Message Message { get; set; } + public long InteractionTimestamp { get; set; } + public string InteractionId { get; set; } + + } +} diff --git a/Amino.NET.Interactions/Objects/InteractionModule.cs b/Amino.NET.Interactions/Objects/InteractionModule.cs new file mode 100644 index 0000000..8845494 --- /dev/null +++ b/Amino.NET.Interactions/Objects/InteractionModule.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Amino.Interactions.Objects +{ + public class InteractionModule + { + } +}