banCommand()

API reference for banCommand() in @erlcjs/presets.

Ban commands for specific users.

Signature:

declare function banCommand(commands: string | string[], action: (log: CommandLog) => void, startsWith?: boolean, allowlist?: Allowlist): (log: CommandLog) => void;

#Parameters

Parameter

Type

Description

commands

string | string[]

The commands to ban.

action

(log: CommandLog) => void

The callback to run if a match if found.

startsWith

boolean

(Optional) Exact match or starts with match.

allowlist

Allowlist

(Optional) Users/Permissions that can run the command

Returns:

(log: CommandLog) => void

  • Callback function to pass into client event.

#Example 1

client.on(ERLCEvents.Command, banCommand([':bring all', ':load all'], CommandPunishments.removePermissions(), false, [ PlayerPermission.Owner ] ));

#Example 2

client.on(ERLCEvents.Command, banCommand([':admin', ':mod'], CommandPunishments.removePermissions(), true, [ PlayerPermission.Owner ] ));