Class GroupOnlyAttribute
Command requirement that checks if message is a group message.
Implements
Inherited Members
Namespace: TehGM.Wolfringo.Commands
Assembly: Wolfringo.Commands.dll
Syntax
public class GroupOnlyAttribute : CommandRequirementAttribute, ICommandRequirement
Remarks
Default ErrorMessage for this requirement is "(n) This command can be used in groups only.".
Constructors
| Improve this Doc View SourceGroupOnlyAttribute()
Creates a new GroupOnly attribute instance.
Declaration
public GroupOnlyAttribute()
Methods
| Improve this Doc View SourceCheckAsync(ICommandContext, IServiceProvider, CancellationToken)
Checks requirement.
Declaration
public override Task<ICommandResult> CheckAsync(ICommandContext context, IServiceProvider services, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
ICommandContext | context | Command to check the requirement for. |
IServiceProvider | services | Services that can be used during requirement checks. |
CancellationToken | cancellationToken | Token for cancelling the task. |
Returns
Type | Description |
---|---|
Task<ICommandResult> | True if requirement was fullfilled; otherwise false. |