Home Manual Reference Source Repository
public class | source

Module

A module for commands

Static Method Summary

Static Public Methods
public static

isEnabled(settings: SettingStorage, guild: Guild, module: Module | string): boolean

Checks if a module is enabled on a guild

public static

setEnabled(settings: SettingStorage, guild: Guild | string, module: Module | string, enabled: boolean)

Enables or disables a module on a guild

Constructor Summary

Public Constructor
public

constructor(bot: Bot, id: string, name: string, hide: boolean, commands: Command[])

Member Summary

Public Members
public

bot: Bot

public
public
public
public

Method Summary

Public Methods
public

Checks if the module is enabled on a guild

public

setEnabled(guild: Guild | string, enabled: boolean)

Enables or disables the module on a guild

Static Public Methods

public static isEnabled(settings: SettingStorage, guild: Guild, module: Module | string): boolean source

Checks if a module is enabled on a guild

Params:

NameTypeAttributeDescription
settings SettingStorage

The setting storage to use

guild Guild

The guild

module Module | string

The module or module ID

Return:

boolean

Whether or not the module is enabled

See:

public static setEnabled(settings: SettingStorage, guild: Guild | string, module: Module | string, enabled: boolean) source

Enables or disables a module on a guild

Params:

NameTypeAttributeDescription
settings SettingStorage

The setting storage to use

guild Guild | string

The guild or guild ID

module Module | string

The module or module ID

enabled boolean

Whether the module should be enabled or disabled

See:

Public Constructors

public constructor(bot: Bot, id: string, name: string, hide: boolean, commands: Command[]) source

Params:

NameTypeAttributeDescription
bot Bot

The bot the module is for

id string

The ID for the module

name string
  • optional
  • default: id

The name of the module

hide boolean
  • optional
  • default: false

Whether or not to hide from the module list, and not allow disabling

commands Command[]
  • optional

The commands that the module contains

Public Members

public bot: Bot source

public commands: Command[] source

public hide: boolean source

public id: string source

public name: string source

Public Methods

public isEnabled(guild: Guild): boolean source

Checks if the module is enabled on a guild

Params:

NameTypeAttributeDescription
guild Guild

The guild

Return:

boolean

Whether or not the module is enabled

See:

public setEnabled(guild: Guild | string, enabled: boolean) source

Enables or disables the module on a guild

Params:

NameTypeAttributeDescription
guild Guild | string

The guild or guild ID

enabled boolean

Whether the module should be enabled or disabled

See: