RequireBotPermissions
Requires the bot to hold every permission in scopescope. Refuses outside a guild first, then when a permission is missing. The Administrator bit passes any scope.
The default 'channel''channel' scope reads the bot's effective channel set (wire app_permissionsapp_permissions), what Discord enforces in the invoked channel. The 'guild''guild' scope reads the bot's base set from roles and requires a GuildPermissionsContextGuildPermissionsContext, so it fits a gateway handler only. app_permissionsapp_permissions is absent on gateway events, the channel scope refuses there as unresolved, use in: 'guild'in: 'guild' on an event handler.
See also:the @Gated decorator from seedcord
RequireBotPermissions(
scope: PermissionScope,
options: RequirePermissionsOptions & { in: "guild" }
): Gate<GuildPermissionsContext, "RequireBotPermissions">RequireBotPermissions(
scope: PermissionScope,
options: RequirePermissionsOptions & { in: "guild" }
): Gate<GuildPermissionsContext, "RequireBotPermissions">scope
scope: PermissionScopescope: PermissionScopeThe permission flag bits the bot must all hold.
options
options: RequirePermissionsOptions & { in: 'guild'; }options: RequirePermissionsOptions & { in: 'guild'; }Pick the scope with inin, and override each refusal with notInGuildnotInGuild or missingmissing.