Skip to content

Commit

Permalink
Adds partial XML doc
Browse files Browse the repository at this point in the history
  • Loading branch information
gehongyan committed Mar 16, 2023
1 parent 0f89483 commit fe1e9bc
Show file tree
Hide file tree
Showing 230 changed files with 1,076 additions and 2,504 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<IsPackable>false</IsPackable>
<LangVersion>latestmajor</LangVersion>
<RootNamespace>Kook.Net.Samples.ReactionRoleBot</RootNamespace>
<NoWarn>NU1803</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand All @@ -17,7 +18,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Serilog" Version="2.12.0" />
<PackageReference Include="Serilog.AspNetCore" Version="6.0.1" />
<PackageReference Include="Serilog.AspNetCore" Version="6.1.0" />
<PackageReference Include="Serilog.Extensions.Hosting" Version="5.0.1" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<IsPackable>false</IsPackable>
<LangVersion>latestmajor</LangVersion>
<RootNamespace>Kook.Net.Samples.SimpleBot</RootNamespace>
<NoWarn>NU1803</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 0 additions & 2 deletions samples/Kook.Net.Samples.SimpleBot/Program.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// See https://aka.ms/new-console-template for more information

using Kook;
using Kook.Rest;
using Kook.WebSocket;
using System.Collections.Immutable;

class Program
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<IsPackable>false</IsPackable>
<LangVersion>latestmajor</LangVersion>
<RootNamespace>Kook.Net.Samples.TextCommands</RootNamespace>
<NoWarn>NU1803</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 0 additions & 2 deletions samples/Kook.Net.Samples.TextCommands/Modules/PublicModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
using Kook.Commands;
using Kook.Rest;
using Kook.WebSocket;
using System.IO;
using System.Threading.Tasks;
using TextCommandFramework.Services;

namespace TextCommandFramework.Modules;
Expand Down
4 changes: 0 additions & 4 deletions samples/Kook.Net.Samples.TextCommands/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
using Kook.Commands;
using Kook.WebSocket;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using TextCommandFramework.Services;

namespace TextCommandFramework;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
using Kook.Commands;
using Kook.WebSocket;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Reflection;
using System.Threading.Tasks;

namespace TextCommandFramework.Services;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
using System.IO;
using System.Net.Http;
using System.Threading.Tasks;

namespace TextCommandFramework.Services;

public class PictureService
Expand Down
2 changes: 0 additions & 2 deletions src/Kook.Net.Commands/Attributes/AliasAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

namespace Kook.Commands;

/// <summary>
Expand Down
11 changes: 9 additions & 2 deletions src/Kook.Net.Commands/Attributes/CommandAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

namespace Kook.Commands;

/// <summary>
Expand All @@ -16,6 +14,9 @@ public class CommandAttribute : Attribute
/// Specifies the <see cref="RunMode" /> of the command. This affects how the command is executed.
/// </summary>
public RunMode RunMode { get; set; } = RunMode.Default;
/// <summary>
/// Indicates whether extra arguments should be ignored for this command.
/// </summary>
public bool? IgnoreExtraArgs { get; }

/// <inheritdoc />
Expand All @@ -32,6 +33,12 @@ public CommandAttribute(string text)
{
Text = text;
}
/// <summary>
/// Initializes a new <see cref="CommandAttribute" /> attribute with the specified name
/// and mode of whether to ignore extra arguments.
/// </summary>
/// <param name="text"> The name of the command. </param>
/// <param name="ignoreExtraArgs"> Whether to ignore extra arguments. </param>
public CommandAttribute(string text, bool ignoreExtraArgs)
{
Text = text;
Expand Down
2 changes: 0 additions & 2 deletions src/Kook.Net.Commands/Attributes/DontAutoLoadAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

namespace Kook.Commands;

/// <summary>
Expand Down
2 changes: 0 additions & 2 deletions src/Kook.Net.Commands/Attributes/DontInjectAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

namespace Kook.Commands;

/// <summary>
Expand Down
2 changes: 0 additions & 2 deletions src/Kook.Net.Commands/Attributes/GroupAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

namespace Kook.Commands;

/// <summary>
Expand Down
2 changes: 0 additions & 2 deletions src/Kook.Net.Commands/Attributes/NameAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

namespace Kook.Commands;

// Override public name of command/module
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

namespace Kook.Commands;

/// <summary>
Expand Down
13 changes: 6 additions & 7 deletions src/Kook.Net.Commands/Attributes/OverrideTypeReaderAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using System.Reflection;

namespace Kook.Commands;
Expand All @@ -8,17 +7,17 @@ namespace Kook.Commands;
/// </summary>
/// <remarks>
/// This attribute will override the <see cref="Kook.Commands.TypeReader"/> to be used when parsing for the
/// desired type in the command. This is useful when one wishes to use a particular
/// desired type in the command. This is useful when one wishes to use a particular
/// <see cref="Kook.Commands.TypeReader"/> without affecting other commands that are using the same target
/// type.
/// <note type="warning">
/// If the given type reader does not inherit from <see cref="Kook.Commands.TypeReader"/>, an
/// If the given type reader does not inherit from <see cref="Kook.Commands.TypeReader"/>, an
/// <see cref="ArgumentException"/> will be thrown.
/// </note>
/// </remarks>
/// <example>
/// In this example, the <see cref="TimeSpan"/> will be read by a custom
/// <see cref="Kook.Commands.TypeReader"/>, <c>FriendlyTimeSpanTypeReader</c>, instead of the
/// In this example, the <see cref="TimeSpan"/> will be read by a custom
/// <see cref="Kook.Commands.TypeReader"/>, <c>FriendlyTimeSpanTypeReader</c>, instead of the
/// <see cref="TimeSpanTypeReader"/> shipped by Kook.Net.
/// <code language="cs">
/// [Command("time")]
Expand All @@ -31,8 +30,8 @@ public sealed class OverrideTypeReaderAttribute : Attribute
{
private static readonly TypeInfo TypeReaderTypeInfo = typeof(TypeReader).GetTypeInfo();

/// <summary>
/// Gets the specified <see cref="TypeReader"/> of the parameter.
/// <summary>
/// Gets the specified <see cref="TypeReader"/> of the parameter.
/// </summary>
public Type TypeReader { get; }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.Threading.Tasks;

namespace Kook.Commands;

/// <summary>
Expand Down
3 changes: 0 additions & 3 deletions src/Kook.Net.Commands/Attributes/PreconditionAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.Threading.Tasks;

namespace Kook.Commands;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.Threading.Tasks;

namespace Kook.Commands;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.Threading.Tasks;

namespace Kook.Commands;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.Threading.Tasks;

namespace Kook.Commands;

/// <summary>
Expand Down Expand Up @@ -33,11 +30,19 @@ public class RequireUserAttribute : PreconditionAttribute
{
private readonly ulong _userId;

/// <summary>
/// Initializes a new <see cref="RequireUserAttribute" /> attribute with the specified user identifier.
/// </summary>
/// <param name="userId"> The identifier of the user. </param>
public RequireUserAttribute(ulong userId)
{
_userId = userId;
}

/// <summary>
/// Initializes a new <see cref="RequireUserAttribute" /> attribute with the specified user.
/// </summary>
/// <param name="user"> An <see cref="IUser"/> representing the user. </param>
public RequireUserAttribute(IUser user)
{
_userId = user.Id;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.Threading.Tasks;

namespace Kook.Commands;

/// <summary>
Expand Down
2 changes: 0 additions & 2 deletions src/Kook.Net.Commands/Attributes/PriorityAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

namespace Kook.Commands;

/// <summary>
Expand Down
2 changes: 0 additions & 2 deletions src/Kook.Net.Commands/Attributes/RemainderAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

namespace Kook.Commands;

/// <summary>
Expand Down
9 changes: 7 additions & 2 deletions src/Kook.Net.Commands/Attributes/RemarksAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

namespace Kook.Commands;

// Extension of the Cosmetic Summary, for Groups, Commands, and Parameters
Expand All @@ -9,8 +7,15 @@ namespace Kook.Commands;
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
public class RemarksAttribute : Attribute
{
/// <summary>
/// Gets the remarks of the command.
/// </summary>
public string Text { get; }

/// <summary>
/// Initializes a new <see cref="RemarksAttribute" /> attribute with the specified remarks.
/// </summary>
/// <param name="text"></param>
public RemarksAttribute(string text)
{
Text = text;
Expand Down
9 changes: 7 additions & 2 deletions src/Kook.Net.Commands/Attributes/SummaryAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

namespace Kook.Commands;

// Cosmetic Summary, for Groups and Commands
Expand All @@ -9,8 +7,15 @@ namespace Kook.Commands;
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Parameter, AllowMultiple = false, Inherited = true)]
public class SummaryAttribute : Attribute
{
/// <summary>
/// Gets the summary of the command.
/// </summary>
public string Text { get; }

/// <summary>
/// Initializes a new <see cref="SummaryAttribute" /> attribute with the specified summary.
/// </summary>
/// <param name="text"></param>
public SummaryAttribute(string text)
{
Text = text;
Expand Down
Loading

0 comments on commit fe1e9bc

Please sign in to comment.