-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
29c0d66
commit 034cb9e
Showing
9 changed files
with
226 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Amino.NET" Version="1.6.0" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
|
||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
|
||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<string, Objects.InteractionModule> InteractionModules; | ||
public Queue<Objects.Interaction> 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<Objects.Interaction>(); | ||
this.InteractionModules = new Dictionary<string, Objects.InteractionModule>(); | ||
_ = Task.Run(async () => { HandleInteractionQueue(); }); | ||
} | ||
|
||
|
||
public Task RegisterModule<T>() 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); | ||
} | ||
} | ||
|
||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; } | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
{ | ||
} | ||
} |