DiscordController

DiscordController

Controller for discord.js

Constructor

new DiscordController()

Source:

Extends

  • Map

Methods

buildEmbed(embedConfig) → {external:MessageEmbed}

Source:
Parameters:
Name Type Description
embedConfig Object

configuration object

Properties
Name Type Attributes Default Description
title String

MessageEmbed title

description String

MessageEmbed description

hexColor String <optional>
'#2f9d8c'

hex color code for MessageEmbed accent

footerTextType String

type of Esdi component posting the MessageEmbed (e.g., Command, Hook, Event)

fields Array.<external:EmbedField> <optional>
[]

array of discord.js EmbedFields for MessageEmbed

thumbnail external:MessageEmbedThumbnail

MessageEmbedThumbnail object for MessageEmbed

timestamp Date

timestamp for for MessageEmbed

author external:MessageEmbedAuthor

MessageEmbedAuthor for MessageEmbed

Returns:

discord.js MessageEmbed

Type
external:MessageEmbed

buildEmbedFields(embedFieldName, embedFieldValues) → {Array.<external:EmbedField>}

Source:
Parameters:
Name Type Description
embedFieldName String

name of EmbedField

embedFieldValues Array.<String>

array of values for EmbedFields

Returns:

array of discord.js EmbedFields

Type
Array.<external:EmbedField>

buildEmbedFieldValues(embedFieldValues, content)

Source:

Returns an array of EmbedField values from a string for a discord.js MessageEmbed

Parameters:
Name Type Description
embedFieldValues Array.<String>

array of values for EmbedFields

content String

content for EmbedFields

buildStatusEmbed(statusEmbedConfig) → {external:MessageEmbed}

Source:

Returns a discord.js MessageEmbed that reports the memory and processor usage of the server's process along with its uptime and Discord stats

Parameters:
Name Type Description
statusEmbedConfig Object

configuration object

Properties
Name Type Description
title String

MessageEmbed title

footerTextType String

type of Esdi component calling this method (e.g., Command, Event)

Returns:

discord.js MessageEmbed

Type
external:MessageEmbed

init(config)

Source:

Initializes a new DiscordController

Parameters:
Name Type Description
config Object

configuration object

Properties
Name Type Attributes Default Description
server Esdi

Esdi server instance

discordToken String <optional>
process.env.DISCORD_TOKEN

token for Discord bot

botOwner String <optional>
'139293101767262208'

Discord ID of bot instance owner

login()

Source:

Logs in the Client with a token

start()

Source:

Starts the DiscordController

Listens to Events:

stop()

Source:

Stops the DiscordController

Listens to Events: