Skip to content

Commit 034cb9e

Browse files
committed
Projektdateien hinzufügen.
1 parent 29c0d66 commit 034cb9e

File tree

9 files changed

+226
-0
lines changed

9 files changed

+226
-0
lines changed

Amino.NET.Interactions.sln

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.8.34330.188
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Amino.NET.Interactions", "Amino.NET.Interactions\Amino.NET.Interactions.csproj", "{A276DEEE-67F4-413E-AD98-9682115EF271}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{A276DEEE-67F4-413E-AD98-9682115EF271}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{A276DEEE-67F4-413E-AD98-9682115EF271}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{A276DEEE-67F4-413E-AD98-9682115EF271}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{A276DEEE-67F4-413E-AD98-9682115EF271}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {02D099D6-D8D6-47C0-9C42-D03D37F8D53F}
24+
EndGlobalSection
25+
EndGlobal
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net7.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="Amino.NET" Version="1.6.0" />
11+
</ItemGroup>
12+
13+
</Project>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace Amino.Interactions.Attributes
8+
{
9+
public class Command : Attribute
10+
{
11+
public string CommandName { get; }
12+
public string CommandDescription { get; }
13+
public string CommunityId { get; }
14+
15+
public Command(string commandName, string commandDescription = null, string communityId = null)
16+
{
17+
this.CommandName = commandName;
18+
this.CommunityId = communityId;
19+
this.CommandDescription = commandDescription;
20+
}
21+
22+
23+
}
24+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace Amino.Interactions.Attributes
8+
{
9+
public class EnabledInDms : Attribute
10+
{
11+
public bool IsEnabledInDms { get; } = true;
12+
13+
public EnabledInDms(bool isEnabledInDms)
14+
{
15+
IsEnabledInDms = isEnabledInDms;
16+
}
17+
}
18+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace Amino.Interactions.Attributes
8+
{
9+
public class PermissionGroup
10+
{
11+
public enum PermissionGroups
12+
{
13+
All,
14+
Chat_Staff,
15+
Staff,
16+
Curator,
17+
Leader,
18+
Agent
19+
}
20+
21+
public PermissionGroups RequiredPermission { get; set; } = PermissionGroups.All;
22+
23+
public PermissionGroup(PermissionGroups permissionGroup)
24+
{
25+
this.RequiredPermission = permissionGroup;
26+
}
27+
}
28+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace Amino.Interactions
8+
{
9+
public class InteractionBase
10+
{
11+
public Objects.Interaction Context;
12+
13+
14+
}
15+
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Reflection;
5+
using System.Runtime.CompilerServices;
6+
using System.Text;
7+
using System.Threading.Tasks;
8+
9+
namespace Amino.Interactions
10+
{
11+
public partial class InteractionsClient
12+
{
13+
14+
public Dictionary<string, Objects.InteractionModule> InteractionModules;
15+
public Queue<Objects.Interaction> InteractionQueue;
16+
17+
public enum LogLevels
18+
{
19+
None,
20+
Debug,
21+
Warning,
22+
Error
23+
}
24+
25+
private Amino.Client AminoClient;
26+
public int InteractionCooldown = 2000;
27+
public string InteractionPrefix = "/";
28+
public bool IgnoreSelf = true;
29+
public LogLevels LogLevel = LogLevels.None;
30+
31+
32+
33+
public InteractionsClient(Amino.Client client)
34+
{
35+
this.AminoClient = client;
36+
this.InteractionQueue = new Queue<Objects.Interaction>();
37+
this.InteractionModules = new Dictionary<string, Objects.InteractionModule>();
38+
_ = Task.Run(async () => { HandleInteractionQueue(); });
39+
}
40+
41+
42+
public Task RegisterModule<T>() where T : InteractionBase
43+
{
44+
45+
}
46+
47+
public Task RegisterModules(Assembly entrypoint)
48+
{
49+
50+
}
51+
52+
public bool HandleInteraction(Objects.Interaction interaction)
53+
{
54+
55+
}
56+
57+
private async Task HandleInteractionQueue()
58+
{
59+
while(true)
60+
{
61+
if(InteractionQueue.Count != 0)
62+
{
63+
HandleInteraction(InteractionQueue.Dequeue());
64+
}
65+
await Task.Delay(this.InteractionCooldown);
66+
}
67+
}
68+
69+
70+
}
71+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace Amino.Interactions.Objects
8+
{
9+
public class Interaction
10+
{
11+
public string InteractionChatId { get; set; }
12+
public string InteractionName { get; set; }
13+
public Amino.Client AminoClient { get; set; }
14+
public Objects.InteractionModule BaseModule { get; set; }
15+
public Amino.Objects.Message Message { get; set; }
16+
public long InteractionTimestamp { get; set; }
17+
public string InteractionId { get; set; }
18+
19+
}
20+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace Amino.Interactions.Objects
8+
{
9+
public class InteractionModule
10+
{
11+
}
12+
}

0 commit comments

Comments
 (0)