Class RequireBotPermissionsAttribute<TContext>
public class RequireBotPermissionsAttribute<TContext> : PreconditionAttribute<TContext> where TContext : IGuildContext, IChannelContext, IGatewayClientContext
Type Parameters
TContext
- Inheritance
-
PreconditionAttribute<TContext>RequireBotPermissionsAttribute<TContext>
- Inherited Members
Constructors
RequireBotPermissionsAttribute(Permissions, Permissions, string, string)
public RequireBotPermissionsAttribute(Permissions channelPermissions, Permissions guildPermissions, string channelPermissionsFormat = "Required bot permissions: {0}.", string guildPermissionsFormat = "Required bot guild permissions: {0}.")
Parameters
channelPermissions
PermissionsguildPermissions
PermissionschannelPermissionsFormat
stringguildPermissionsFormat
string
RequireBotPermissionsAttribute(Permissions, string)
public RequireBotPermissionsAttribute(Permissions channelPermissions, string channelPermissionsFormat = "Required bot permissions: {0}.")
Parameters
channelPermissions
PermissionschannelPermissionsFormat
string
Properties
ChannelPermissions
public Permissions ChannelPermissions { get; }
Property Value
ChannelPermissionsFormat
public string? ChannelPermissionsFormat { get; }
Property Value
GuildPermissions
public Permissions GuildPermissions { get; }
Property Value
GuildPermissionsFormat
public string? GuildPermissionsFormat { get; }
Property Value
Methods
EnsureCanExecuteAsync(TContext, IServiceProvider?)
public override ValueTask<PreconditionResult> EnsureCanExecuteAsync(TContext context, IServiceProvider? serviceProvider)
Parameters
context
TContextserviceProvider
IServiceProvider