Options
Modules
  • Command
  • Localization
  • Logger
All
  • Public
  • Public/Protected
  • All
Menu

Container class that holds middleware for controlling command execution or modifying command execution behavior. All middleware in this class can also be imported directly by name from @discord-samba/command/middleware

Hierarchy

  • Middleware

Index

Constructors

constructor

Properties

Static guildOnly

guildOnly: MiddlewareFunction = ...

Prevent command from being called if it is called in a DM

Static ownerOnly

ownerOnly: MiddlewareFunction = ...

Prevent command from being called if the caller is not registered as an owner. This middleware must be paired with the Rules.allowOwner rule to function

Methods

Static callerPermissions

  • Prevent command from being called if the caller does not have all of the given permissions for the channel in which the command was called.

    NOTE: This middleware should only be used when you can guarantee the command will be called in a guild context. You can accomplish this by using the guildOnly middleware first

    Parameters

    • Rest ...permissions: PermissionResolvable[]

    Returns MiddlewareFunction

Static clientPermissions

  • Prevent command from being called if the client does not have all of the given permissions for the channel in which the command was called

    NOTE: This middleware should only be used when you can guarantee the command will be called in a guild context. You can accomplish this by using the guildOnly middleware first

    Parameters

    • Rest ...permissions: PermissionResolvable[]

    Returns MiddlewareFunction

Generated using TypeDoc