Class

PermissionCommand

PermissionCommand(client, info, permissionInfo)

The PermissionCommand is a custom command that extends the discord js commando Command class. This Command subclass adds role and channel permission checks before the command is run. It also removes the message used to call the command.
Constructor

# new PermissionCommand(client, info, permissionInfo)

Constructor for our custom command, calls the parent constructor.
Parameters:
Name Type Description
client CommandoClientOptions the client the command is for
info CommandInfo the information for this commando command
permissionInfo CommandPermissionInfo the custom information for this command

View Source classes/permission-command.js, line 14

Extends

  • Command

Members

String

# static FLAGS

String permission flags used for command permissions. * ADMIN_ROLE : only admins can use this command * STAFF_ROLE : staff and admin can use this command * ADMIN_CONSOLE : can only be used in the admin console
Properties:
Name Type Description
ADMIN_ROLE String
STAFF_ROLE String
ADMIN_CONSOLE String

View Source classes/permission-command.js, line 140

CommandPermissionInfo

# private permissionInfo

The permission info

View Source classes/permission-command.js, line 40

Methods

# abstract protected runCommand(botGuild, message, args, fromPattern, result)

Required class by children, will throw error if not implemented!
Parameters:
Name Type Description
botGuild BotGuildModel
message CommandoMessage
args Object
fromPattern Boolean
result Promise.<*>

View Source classes/permission-command.js, line 128