Skip to content

Commit 15d5e79

Browse files
committed
Added XML Comments
1 parent 6681d71 commit 15d5e79

5 files changed

Lines changed: 76 additions & 3 deletions

File tree

Amino.NET.Interactions/Amino.NET.Interactions.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<PackageLicenseExpression>MIT</PackageLicenseExpression>
2121
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
2222
<IncludeSymbols>False</IncludeSymbols>
23+
<GenerateDocumentationFile>True</GenerateDocumentationFile>
2324
</PropertyGroup>
2425

2526
<ItemGroup>

Amino.NET.Interactions/Attributes/Command.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
namespace Amino.Interactions.Attributes
88
{
9+
/// <summary>
10+
/// This Attribute defines a Module to be a command
11+
/// </summary>
912
public class Command : Attribute
1013
{
1114
public string CommandName { get; }

Amino.NET.Interactions/Attributes/EnabledInDms.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
namespace Amino.Interactions.Attributes
88
{
9+
/// <summary>
10+
/// This Attribute defines if a Module can be used in DMs and or DM Groups
11+
/// </summary>
12+
/// <remarks>Note: Using this attribute will not have any effect on your program as it is not fully implemented yet. You can still have it and update your project dependencies later for this take effect.</remarks>
913
public class EnabledInDms : Attribute
1014
{
1115
public bool IsEnabledInDms { get; } = true;

Amino.NET.Interactions/Attributes/PermissionGroup.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
namespace Amino.Interactions.Attributes
88
{
9+
/// <summary>
10+
/// With this Attribute you can determine what permission level is required in order for a user to be able to use your module
11+
/// </summary>
12+
/// <remarks>Note: Using this attribute will not have any effect on your program as it is not fully implemented yet. You can still have it and update your project dependencies later for this take effect.</remarks>
913
public class PermissionGroup : Attribute
1014
{
1115
public enum PermissionGroups

Amino.NET.Interactions/InteractionsClient.cs

Lines changed: 64 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,36 +10,87 @@
1010
using System.Text.Json;
1111
using System.Threading.Tasks;
1212
using System.Xml;
13+
using static System.Net.WebRequestMethods;
1314

1415
namespace Amino.Interactions
1516
{
1617
public partial class InteractionsClient
1718
{
1819

20+
/// <summary>
21+
/// A Dictionary of all currently registered Modules, stored as: commandName:InteactionModule
22+
/// </summary>
1923
public Dictionary<string, Objects.InteractionModule> InteractionModules;
24+
/// <summary>
25+
/// A Queue for all currently Queued up interactions, this is only useful if <see cref="AutoHandleInteractions"/> is checked
26+
/// </summary>
2027
public Queue<Objects.Interaction> InteractionQueue;
2128

29+
/// <summary>
30+
/// An enum type of all LogLevels you can choose for you InteractionsClient
31+
/// </summary>
2232
public enum LogLevels
2333
{
34+
/// <summary>
35+
/// Indicates that no Logging is being done
36+
/// </summary>
2437
None = 0,
38+
/// <summary>
39+
/// Indicates that you want to receive all log events
40+
/// </summary>
2541
Debug = 1,
42+
/// <summary>
43+
/// Indicates that you want to receive only Warnings
44+
/// </summary>
2645
Warning = 2,
46+
/// <summary>
47+
/// Indicates that you want to receive only Errors
48+
/// </summary>
2749
Error = 3
2850
}
2951

3052
private Amino.Client AminoClient;
53+
54+
/// <summary>
55+
/// The cooldown for your <see cref="InteractionQueue"/>, only useful if <see cref="AutoHandleInteractions"/> is checked
56+
/// </summary>
57+
/// <remarks>Note: You can currently not edit the property as the Automatic interaction queue is not implemented</remarks>
3158
public int InteractionCooldown { get; } = 2000;
59+
/// <summary>
60+
/// This sets the Prefix for your commands, default is /
61+
/// </summary>
3262
public string InteractionPrefix = "/";
3363

64+
/// <summary>
65+
/// This determines if the InteractionsClient should ignore its own interactions, default is true
66+
/// </summary>
3467
public bool IgnoreSelf = true;
68+
69+
/// <summary>
70+
/// The LogLevel you set for the <see cref="Log"/> event
71+
/// </summary>
3572
public LogLevels LogLevel = LogLevels.None;
36-
public bool AutoHandleInteractions { get; } = false;
3773

74+
/// <summary>
75+
/// This determines if your Interactions should be automatically handled, the default is false
76+
/// </summary>
77+
/// <remarks>Note: You can currently not edit the property as the Automatic interaction queue is not implemented</remarks>
78+
public bool AutoHandleInteractions { get; } = false;
3879

80+
/// <summary>
81+
/// The event that fires when an Interaction is detected
82+
/// </summary>
3983
public event Action<Interaction> InteractionCreated;
84+
/// <summary>
85+
/// The event that fires when a Log is created
86+
/// </summary>
4087
public event Action<LogMessage> Log;
4188

4289

90+
/// <summary>
91+
/// The contructor of your InteractionsClient
92+
/// </summary>
93+
/// <param name="client">Your <see cref="Amino.Client"/> you want to use for this InteractionsClient, note that you should not turn off the websocket and that you must be logged in</param>
4394
public InteractionsClient(Amino.Client client)
4495
{
4596
this.AminoClient = client;
@@ -81,7 +132,10 @@ private void HandleMessageSocket(Amino.Objects.Message message)
81132
}
82133
}
83134

84-
135+
/// <summary>
136+
/// This function registers a single module into <see cref="InteractionModules"/>
137+
/// </summary>
138+
/// <typeparam name="T">Any Class / Module that has a valid structure, see <seealso href="https://github.com/Amino-NET-Group/Amino.NET.Interactions"/> to see how it works</typeparam>
85139
public Task RegisterModule<T>() where T : InteractionBase
86140
{
87141
Type moduleType = typeof(T);
@@ -135,7 +189,10 @@ public Task RegisterModule<T>() where T : InteractionBase
135189
}
136190

137191

138-
192+
/// <summary>
193+
/// Registers all valid Modules of a given <see cref="Assembly"/>
194+
/// </summary>
195+
/// <param name="entrypoint">The Assembly you are passing in</param>
139196
public Task RegisterModules(Assembly entrypoint)
140197
{
141198
var moduleTypes = entrypoint.GetTypes().Where(t => typeof(InteractionBase).IsAssignableFrom(t) && !t.IsAbstract);
@@ -197,6 +254,10 @@ public Task RegisterModules(Assembly entrypoint)
197254
return Task.CompletedTask;
198255
}
199256

257+
/// <summary>
258+
/// A function that allows you to redirect an <see cref="Interaction"/> to its corresponding module
259+
/// </summary>
260+
/// <param name="interactionContext">The Interaction you pass in as Context</param>
200261
public void HandleInteraction(Objects.Interaction interactionContext)
201262
{
202263
List<object> args = new List<object>() { interactionContext };

0 commit comments

Comments
 (0)