NadekoBot.Extensions should now be fully annotated with nullable reference types as well as many classes from NadekoBot.Common

This commit is contained in:
Kwoth
2021-12-28 10:44:00 +01:00
parent 0634470a8a
commit 59f5056035
543 changed files with 1895 additions and 1448 deletions

View File

@@ -1,4 +1,4 @@
using System.Runtime.CompilerServices;
using System.Runtime.CompilerServices;
namespace NadekoBot.Common.Attributes;
@@ -9,4 +9,4 @@ public sealed class AliasesAttribute : AliasAttribute
: base(CommandNameLoadHelper.GetAliasesFor(memberName))
{
}
}
}

View File

@@ -1,4 +1,4 @@
namespace NadekoBot.Common.Attributes;
namespace NadekoBot.Common.Attributes;
public static class CommandNameLoadHelper
{
@@ -26,4 +26,4 @@ public static class CommandNameLoadHelper
: methodName;
return toReturn;
}
}
}

View File

@@ -1,4 +1,4 @@
using System.Runtime.CompilerServices;
using System.Runtime.CompilerServices;
namespace NadekoBot.Common.Attributes;
@@ -10,4 +10,4 @@ public sealed class NadekoCommandAttribute : CommandAttribute
=> this.MethodName = memberName.ToLowerInvariant();
public string MethodName { get; }
}
}

View File

@@ -1,4 +1,4 @@
namespace NadekoBot.Common.Attributes;
namespace NadekoBot.Common.Attributes;
[AttributeUsage(AttributeTargets.Class)]
internal sealed class NadekoModuleAttribute : GroupAttribute
@@ -7,4 +7,4 @@ internal sealed class NadekoModuleAttribute : GroupAttribute
: base(moduleName)
{
}
}
}

View File

@@ -1,4 +1,4 @@
namespace NadekoBot.Common.Attributes;
namespace NadekoBot.Common.Attributes;
[AttributeUsage(AttributeTargets.Method)]
public sealed class NadekoOptionsAttribute : Attribute
@@ -7,4 +7,4 @@ public sealed class NadekoOptionsAttribute : Attribute
public NadekoOptionsAttribute(Type t)
=> this.OptionType = t;
}
}

View File

@@ -1,4 +1,4 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
namespace NadekoBot.Common.Attributes;
@@ -17,4 +17,4 @@ public sealed class OwnerOnlyAttribute : PreconditionAttribute
: PreconditionResult.FromError("Not owner")
);
}
}
}

View File

@@ -1,4 +1,4 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
namespace NadekoBot.Common.Attributes;
@@ -33,4 +33,4 @@ public sealed class RatelimitAttribute : PreconditionAttribute
return Task.FromResult(PreconditionResult.FromError(msgContent));
}
}
}

View File

@@ -1,9 +1,9 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
using NadekoBot.Modules.Administration.Services;
namespace Discord;
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
[AttributeUsage(AttributeTargets.Method)]
public class UserPermAttribute : RequireUserPermissionAttribute
{
public override Task<PreconditionResult> CheckPermissionsAsync(
@@ -27,4 +27,4 @@ public class UserPermAttribute : RequireUserPermissionAttribute
: base(permission)
{
}
}
}