Class ArgumentErrorAttribute
Base attribute for all argument error attributes.
Inheritance
ArgumentErrorAttribute
Assembly: Wolfringo.Commands.dll
Syntax
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = true)]
public abstract class ArgumentErrorAttribute : Attribute, IEquatable<ArgumentErrorAttribute>, IEquatable<string>
Remarks
Constructors
|
Improve this Doc
View Source
ArgumentErrorAttribute(String)
Attribute to specify message that will be sent as respone when argument error occurs.
Declaration
public ArgumentErrorAttribute(string messageTemplate)
Parameters
Type |
Name |
Description |
String |
messageTemplate |
Message that will be sent as response on error.
|
Fields
|
Improve this Doc
View Source
ArgPlaceholder
This placeholder will be replaced with argument value at runtime.
Declaration
public const string ArgPlaceholder = "{{Arg}}"
Field Value
|
Improve this Doc
View Source
BotIdPlaceholder
This placeholder will be replaced with ID of the bot at runtime.
Declaration
public const string BotIdPlaceholder = "{{BotID}}"
Field Value
|
Improve this Doc
View Source
BotNicknamePlaceholder
This placeholder will be replaced with nickname of the bot at runtime.
Declaration
public const string BotNicknamePlaceholder = "{{BotNickname}}"
Field Value
|
Improve this Doc
View Source
MessagePlaceholder
This placeholder will be replaced with received message contents at runtime.
Declaration
public const string MessagePlaceholder = "{{Message}}"
Field Value
|
Improve this Doc
View Source
NamePlaceholder
This placeholder will be replaced with parameter name at runtime.
Declaration
public const string NamePlaceholder = "{{Name}}"
Field Value
Remarks
|
Improve this Doc
View Source
RecipientIdPlaceholder
This placeholder will be replaced with ID of the message recipient (bot ID for PMs, group ID for group messages).
Declaration
public const string RecipientIdPlaceholder = "{{RecipientID}}"
Field Value
|
Improve this Doc
View Source
RecipientNamePlaceholder
This placeholder will be replaced with name of the message recipient (bot nickname for PMs, group name for group messages).
Declaration
public const string RecipientNamePlaceholder = "{{RecipientName}}"
Field Value
|
Improve this Doc
View Source
SenderIdPlaceholder
This placeholder will be replaced with ID of the user that sent the command at runtime.
Declaration
public const string SenderIdPlaceholder = "{{SenderID}}"
Field Value
|
Improve this Doc
View Source
SenderNicknamePlaceholder
This placeholder will be replaced with nickname of the user that sent the command at runtime.
Declaration
public const string SenderNicknamePlaceholder = "{{SenderNickname}}"
Field Value
|
Improve this Doc
View Source
TypePlaceholder
This placeholder will be replaced with parameter type at runtime.
Declaration
public const string TypePlaceholder = "{{Type}}"
Field Value
Remarks
Properties
|
Improve this Doc
View Source
TextTemplate
Error message that will be sent as response on error.
Declaration
public string TextTemplate { get; }
Property Value
Methods
|
Improve this Doc
View Source
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
Object |
obj |
|
Returns
Overrides
|
Improve this Doc
View Source
Equals(String)
Declaration
public bool Equals(string other)
Parameters
Type |
Name |
Description |
String |
other |
|
Returns
|
Improve this Doc
View Source
Equals(ArgumentErrorAttribute)
Declaration
public bool Equals(ArgumentErrorAttribute other)
Parameters
Returns
|
Improve this Doc
View Source
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Overrides
|
Improve this Doc
View Source
ToString()
Declaration
public override string ToString()
Returns
Overrides
|
Improve this Doc
View Source
ToStringAsync(ICommandContext, String, ParameterInfo, CancellationToken)
Builds error response for the sent message and arg.
Declaration
public virtual async Task<string> ToStringAsync(ICommandContext context, string arg, ParameterInfo parameter, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
ICommandContext |
context |
Message context that contains the argument.
|
String |
arg |
Value of argument that failed converting.
|
ParameterInfo |
parameter |
Parameter the error is for.
|
CancellationToken |
cancellationToken |
Token to cancel any required server requests with.
|
Returns
Operators
|
Improve this Doc
View Source
Equality(ArgumentErrorAttribute, ArgumentErrorAttribute)
Declaration
public static bool operator ==(ArgumentErrorAttribute left, ArgumentErrorAttribute right)
Parameters
Returns
|
Improve this Doc
View Source
Inequality(ArgumentErrorAttribute, ArgumentErrorAttribute)
Declaration
public static bool operator !=(ArgumentErrorAttribute left, ArgumentErrorAttribute right)
Parameters
Returns
Implements