Context

Context

new Context()

Source:

Context class

Members

author :Eris.User

Source:
See:

Message author

Type:
  • Eris.User

channel :Eris.GuildChannel|Eris.PrivateChannel|Eris.GroupChannel

Source:
See:

Channel the message was sent in

Type:
  • Eris.GuildChannel | Eris.PrivateChannel | Eris.GroupChannel

channelMentions :Array.<string>|undefined

Source:

Channel mentions in the message

Type:
  • Array.<string> | undefined

cleanContent :string|undefined

Source:

Clean message content (<@id> -> @username)

Type:
  • string | undefined

content :string|undefined

Source:

Content of the message

Type:
  • string | undefined

editedTimestamp :number|undefined

Source:

When the message was last edited

Type:
  • number | undefined

embeds :Array.<Eris.Embed>

Source:

Embeds on the message

Type:
  • Array.<Eris.Embed>

guild :Eris.Guild|undefined

Source:
See:

Guild the message was sent in

Type:
  • Eris.Guild | undefined

member :Eris.Member|undefined

Source:
See:

Member that sent the message

Type:
  • Eris.Member | undefined

mentions :Array.<Eris.User>

Source:

User mentions in the message

Type:
  • Array.<Eris.User>

roleMentions :Array.<string>

Source:

Role mentions in the message

Type:
  • Array.<string>

suffix :string

Source:

Message content without flags

Type:
  • string

timestamp :number

Source:

When the message was sent

Type:
  • number

Methods

createMessage(content, fileopt) → {Promise.<Eris.Message>}

Source:
See:

Send a message like you normally would in Eris

Parameters:
Name Type Attributes Description
content Eris.MessageContent

Content to send

file Eris.MessageFile <optional>

File to send

Returns:
Type
Promise.<Eris.Message>

eval(code, customProps) → {Promise.<any>}

Source:

Advanced (typescript) eval, linter included.

Example
const myEval = ctx.eval("interface IREEE { bool: boolean; }; const myREEE: IREEE = { bool: true }; myREEE;").eval // myEval = { bool: true }
Parameters:
Name Type Description
code string

Code to run

customProps map

Custom properties to include in the eval context

Returns:
Type
Promise.<any>

send(…args) → {Promise.<Eris.Message>}

Source:

Sends a message to the channel the message was sent in

Example
ctx.send("a", "b", "nya") // a b nya
Parameters:
Name Type Attributes Description
args Array.<any> <repeatable>

Content to send

Returns:
Type
Promise.<Eris.Message>

sendCode(type, …code) → {Promise.<Eris.Message>}

Source:

Sends a codeblock

Example
ctx.sendCode("ts", "const nya: Nya<awoo> = new Nya<awoo>()")
Parameters:
Name Type Attributes Description
type string

Code language

code Array.<any> <repeatable>

Code to send

Returns:
Type
Promise.<Eris.Message>