Wolfringo Wolfringo
Wolfringo Wolfringo
Wolfringo (c) 2020 TehGM
DocFX, DiscordFX theme.
Search Results for

    Class PriorityAttribute

    Specifies command's priority.

    Inheritance
    System.Object
    System.Attribute
    PriorityAttribute
    Implements
    System.IEquatable<PriorityAttribute>
    System.IComparable<PriorityAttribute>
    Namespace: TehGM.Wolfringo.Commands
    Assembly: Wolfringo.Commands.dll
    Syntax
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
    public class PriorityAttribute : Attribute, IEquatable<PriorityAttribute>, IComparable<PriorityAttribute>
    Remarks

    Commands with higher priority value will run before commands with lower value.

    Depending on on the command service used, only one command can run per message. In such case, out of matching commands, only the one with highest priority value will run.
    This is the behaviour of command services included with Wolfringo library by default.

    Command priority will be taken from PriorityAttribute present on the method. If the method doesn't have the attribute, it'll be taken from PriorityAttribute present on the handler type. If the handler type also doesn't specify the priority, default value of 0 will be used.

    Constructors

    | Improve this Doc View Source

    PriorityAttribute(Int32)

    Creates a new priority attribute.

    Declaration
    public PriorityAttribute(int priority)
    Parameters
    Type Name Description
    System.Int32 priority

    Command's priority.

    Remarks

    See PriorityAttribute for more information about command priorities.

    Properties

    | Improve this Doc View Source

    Priority

    Command's priority.

    Declaration
    public int Priority { get; }
    Property Value
    Type Description
    System.Int32
    Remarks

    See PriorityAttribute for more information about command priorities.

    Methods

    | Improve this Doc View Source

    CompareTo(PriorityAttribute)

    Declaration
    public int CompareTo(PriorityAttribute other)
    Parameters
    Type Name Description
    PriorityAttribute other
    Returns
    Type Description
    System.Int32
    | Improve this Doc View Source

    Equals(Object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj
    Returns
    Type Description
    System.Boolean
    Overrides
    System.Attribute.Equals(System.Object)
    | Improve this Doc View Source

    Equals(PriorityAttribute)

    Declaration
    public bool Equals(PriorityAttribute other)
    Parameters
    Type Name Description
    PriorityAttribute other
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    Overrides
    System.Attribute.GetHashCode()

    Operators

    | Improve this Doc View Source

    Equality(PriorityAttribute, PriorityAttribute)

    Declaration
    public static bool operator ==(PriorityAttribute left, PriorityAttribute right)
    Parameters
    Type Name Description
    PriorityAttribute left
    PriorityAttribute right
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Inequality(PriorityAttribute, PriorityAttribute)

    Declaration
    public static bool operator !=(PriorityAttribute left, PriorityAttribute right)
    Parameters
    Type Name Description
    PriorityAttribute left
    PriorityAttribute right
    Returns
    Type Description
    System.Boolean

    Implements

    System.IEquatable<T>
    System.IComparable<T>