Table of Contents

Class RequireBotPermissionsAttribute<TContext>

Namespace
NetCord.Services
Assembly
NetCord.Services.dll
public class RequireBotPermissionsAttribute<TContext> : PreconditionAttribute<TContext> where TContext : IGuildContext, IChannelContext, IGatewayClientContext

Type Parameters

TContext
Inheritance
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 Permissions
guildPermissions Permissions
channelPermissionsFormat string
guildPermissionsFormat string

RequireBotPermissionsAttribute(Permissions, string)

public RequireBotPermissionsAttribute(Permissions channelPermissions, string channelPermissionsFormat = "Required bot permissions: {0}.")

Parameters

channelPermissions Permissions
channelPermissionsFormat string

Properties

ChannelPermissions

public Permissions ChannelPermissions { get; }

Property Value

Permissions

ChannelPermissionsFormat

public string? ChannelPermissionsFormat { get; }

Property Value

string

GuildPermissions

public Permissions GuildPermissions { get; }

Property Value

Permissions

GuildPermissionsFormat

public string? GuildPermissionsFormat { get; }

Property Value

string

Methods

EnsureCanExecuteAsync(TContext, IServiceProvider?)

public override ValueTask<PreconditionResult> EnsureCanExecuteAsync(TContext context, IServiceProvider? serviceProvider)

Parameters

context TContext
serviceProvider IServiceProvider

Returns

ValueTask<PreconditionResult>