Client

Client

Interface between the Discord client and plugins

Constructor

new Client(options)

Source:
Version:
  • 3.0.0
See:
Properties:
Name Type Description
plugins Collection

A Collection of plugins

Creates a new Client instance

Parameters:
Name Type Description
options Object

An object containing sylphy's and/or Eris client options

Properties
Name Type Attributes Default Description
token String

Discord bot token

prefix String <optional>
'!'

Default prefix for commands

admins String <optional>
[]

Array of admin IDs

selfbot String <optional>
false

Option for selfbot mode

commands String <optional>

Relative path to commands folder

modules String <optional>

Relative path to modules folder

middleware String <optional>

Relative path to middleware folder

locales String <optional>

Relative path to locales folder

resolvers String <optional>

Relative path to resolvers folder

suppressWarnings Boolean <optional>
false

Option to suppress console warnings

noDefaults Boolean <optional>
false

Option to not use built-in plugins

Extends

  • Eris.Client

Methods

createPlugin(type, Plugin, optionsopt) → {Client}

Source:

Creates a plugin

Parameters:
Name Type Attributes Description
type String

The type of plugin

Plugin Plugin

Plugin class

options Object <optional>

Additional plugin options

Returns:
Type
Client

register(type, …args) → {Client}

Source:

Registers plugins

Parameters:
Name Type Attributes Description
type String

The type of plugin
Defaults: commands, modules, middleware, resolvers, ipc

args * <repeatable>

Arguments supplied to the plugin

Returns:
Type
Client

run() → {Promise}

Source:

Runs the bot

Returns:
Type
Promise

unload(filepath) → {Client}

Source:

Unloads files from the require cache

Parameters:
Name Type Description
filepath String

A relative or absolute directory path, file path or file name

Returns:
Type
Client

unregister(type, …args) → {Client}

Source:

Unregisters plugins

Parameters:
Name Type Attributes Description
type String

The type of plugin
Defaults: commands, modules, middleware, resolvers, ipc

args * <repeatable>

Arguments supplied to the plugin

Returns:
Type
Client

Events

bridge:registered

Source:
Properties:
Name Type Description
name String

Middleware name

index Number

Location of middleware in the tasks chain

count Number

Number of loaded middleware tasks

Fires when a middleware is registered

Type:
  • Object

commander:commandError

Source:

Fires when an error occurs in a command

Type:
  • Error

commander:ejected

Source:
Properties:
Name Type Description
group String

Command group

aliases Number

Number of trigger aliases

Fires when a command is ejected

Type:
  • Object

commander:ejectedGroup

Source:
Properties:
Name Type Description
group String

Command group

count Number

Number of ejected commands

Fires when a command group is ejected

Type:
  • Object

commander:error

Source:

Fires when an error occurs in Commander

Type:
  • Error

commander:registered

Source:
Properties:
Name Type Description
trigger String

Command trigger

group String

Command group

aliases Number

Number of trigger aliases

count Number

Number of loaded command triggers

Fires when a command is registered

Type:
  • Object

ipc:error

Source:

Fires when an error occurs in Transmitter

Type:
  • Error

router:error

Source:

Fires when an error occurs in Router

Type:
  • Error

router:registered

Source:
Properties:
Name Type Description
name String

Module name

events Number

Number of events in the module

count Number

Number of loaded modules

Fires when a module is registered

Type:
  • Object

router:runError

Source:

Fires when an error occurs in Router's event handling

Type:
  • Error