Browse Source

Apply consistency to attributes in the commands extension

This resolves #527.

Not sure if I missed any, putting this up for review.
pull/928/head
Christopher F 7 years ago
parent
commit
ea31188453
12 changed files with 19 additions and 20 deletions
  1. +1
    -1
      src/Discord.Net.Commands/Attributes/AliasAttribute.cs
  2. +2
    -2
      src/Discord.Net.Commands/Attributes/CommandAttribute.cs
  3. +2
    -2
      src/Discord.Net.Commands/Attributes/DontAutoLoadAttribute.cs
  4. +1
    -1
      src/Discord.Net.Commands/Attributes/DontInjectAttribute.cs
  5. +2
    -2
      src/Discord.Net.Commands/Attributes/GroupAttribute.cs
  6. +1
    -1
      src/Discord.Net.Commands/Attributes/NameAttribute.cs
  7. +2
    -2
      src/Discord.Net.Commands/Attributes/OverrideTypeReaderAttribute.cs
  8. +1
    -2
      src/Discord.Net.Commands/Attributes/ParameterPreconditionAttribute.cs
  9. +1
    -1
      src/Discord.Net.Commands/Attributes/PriorityAttribute.cs
  10. +2
    -2
      src/Discord.Net.Commands/Attributes/RemainderAttribute.cs
  11. +2
    -2
      src/Discord.Net.Commands/Attributes/RemarksAttribute.cs
  12. +2
    -2
      src/Discord.Net.Commands/Attributes/SummaryAttribute.cs

+ 1
- 1
src/Discord.Net.Commands/Attributes/AliasAttribute.cs View File

@@ -3,7 +3,7 @@ using System;
namespace Discord.Commands namespace Discord.Commands
{ {
/// <summary> Provides aliases for a command. </summary> /// <summary> Provides aliases for a command. </summary>
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public class AliasAttribute : Attribute public class AliasAttribute : Attribute
{ {
/// <summary> The aliases which have been defined for the command. </summary> /// <summary> The aliases which have been defined for the command. </summary>


+ 2
- 2
src/Discord.Net.Commands/Attributes/CommandAttribute.cs View File

@@ -1,8 +1,8 @@
using System;
using System;


namespace Discord.Commands namespace Discord.Commands
{ {
[AttributeUsage(AttributeTargets.Method)]
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public class CommandAttribute : Attribute public class CommandAttribute : Attribute
{ {
public string Text { get; } public string Text { get; }


+ 2
- 2
src/Discord.Net.Commands/Attributes/DontAutoLoadAttribute.cs View File

@@ -1,8 +1,8 @@
using System;
using System;


namespace Discord.Commands namespace Discord.Commands
{ {
[AttributeUsage(AttributeTargets.Class)]
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
public class DontAutoLoadAttribute : Attribute public class DontAutoLoadAttribute : Attribute
{ {
} }


+ 1
- 1
src/Discord.Net.Commands/Attributes/DontInjectAttribute.cs View File

@@ -2,7 +2,7 @@ using System;


namespace Discord.Commands { namespace Discord.Commands {


[AttributeUsage(AttributeTargets.Property)]
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
public class DontInjectAttribute : Attribute { public class DontInjectAttribute : Attribute {
} }




+ 2
- 2
src/Discord.Net.Commands/Attributes/GroupAttribute.cs View File

@@ -1,8 +1,8 @@
using System;
using System;


namespace Discord.Commands namespace Discord.Commands
{ {
[AttributeUsage(AttributeTargets.Class)]
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
public class GroupAttribute : Attribute public class GroupAttribute : Attribute
{ {
public string Prefix { get; } public string Prefix { get; }


+ 1
- 1
src/Discord.Net.Commands/Attributes/NameAttribute.cs View File

@@ -3,7 +3,7 @@ using System;
namespace Discord.Commands namespace Discord.Commands
{ {
// Override public name of command/module // Override public name of command/module
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Parameter)]
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Parameter, AllowMultiple = false, Inherited = true)]
public class NameAttribute : Attribute public class NameAttribute : Attribute
{ {
public string Text { get; } public string Text { get; }


+ 2
- 2
src/Discord.Net.Commands/Attributes/OverrideTypeReaderAttribute.cs View File

@@ -4,7 +4,7 @@ using System.Reflection;


namespace Discord.Commands namespace Discord.Commands
{ {
[AttributeUsage(AttributeTargets.Parameter)]
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = true)]
public class OverrideTypeReaderAttribute : Attribute public class OverrideTypeReaderAttribute : Attribute
{ {
private static readonly TypeInfo _typeReaderTypeInfo = typeof(TypeReader).GetTypeInfo(); private static readonly TypeInfo _typeReaderTypeInfo = typeof(TypeReader).GetTypeInfo();
@@ -19,4 +19,4 @@ namespace Discord.Commands
TypeReader = overridenTypeReader; TypeReader = overridenTypeReader;
} }
} }
}
}

+ 1
- 2
src/Discord.Net.Commands/Attributes/ParameterPreconditionAttribute.cs View File

@@ -1,6 +1,5 @@
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;


namespace Discord.Commands namespace Discord.Commands
{ {
@@ -9,4 +8,4 @@ namespace Discord.Commands
{ {
public abstract Task<PreconditionResult> CheckPermissionsAsync(ICommandContext context, ParameterInfo parameter, object value, IServiceProvider services); public abstract Task<PreconditionResult> CheckPermissionsAsync(ICommandContext context, ParameterInfo parameter, object value, IServiceProvider services);
} }
}
}

+ 1
- 1
src/Discord.Net.Commands/Attributes/PriorityAttribute.cs View File

@@ -3,7 +3,7 @@ using System;
namespace Discord.Commands namespace Discord.Commands
{ {
/// <summary> Sets priority of commands </summary> /// <summary> Sets priority of commands </summary>
[AttributeUsage(AttributeTargets.Method)]
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public class PriorityAttribute : Attribute public class PriorityAttribute : Attribute
{ {
/// <summary> The priority which has been set for the command </summary> /// <summary> The priority which has been set for the command </summary>


+ 2
- 2
src/Discord.Net.Commands/Attributes/RemainderAttribute.cs View File

@@ -1,8 +1,8 @@
using System;
using System;


namespace Discord.Commands namespace Discord.Commands
{ {
[AttributeUsage(AttributeTargets.Parameter)]
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = true)]
public class RemainderAttribute : Attribute public class RemainderAttribute : Attribute
{ {
} }


+ 2
- 2
src/Discord.Net.Commands/Attributes/RemarksAttribute.cs View File

@@ -1,9 +1,9 @@
using System;
using System;


namespace Discord.Commands namespace Discord.Commands
{ {
// Extension of the Cosmetic Summary, for Groups, Commands, and Parameters // Extension of the Cosmetic Summary, for Groups, Commands, and Parameters
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)]
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
public class RemarksAttribute : Attribute public class RemarksAttribute : Attribute
{ {
public string Text { get; } public string Text { get; }


+ 2
- 2
src/Discord.Net.Commands/Attributes/SummaryAttribute.cs View File

@@ -1,9 +1,9 @@
using System;
using System;


namespace Discord.Commands namespace Discord.Commands
{ {
// Cosmetic Summary, for Groups and Commands // Cosmetic Summary, for Groups and Commands
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Parameter)]
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Parameter, AllowMultiple = false, Inherited = true)]
public class SummaryAttribute : Attribute public class SummaryAttribute : Attribute
{ {
public string Text { get; } public string Text { get; }


Loading…
Cancel
Save