new Orator(defaultPrefix, oratorOptions)
A class handling all message based communications.
Parameters:
Name | Type | Description |
---|---|---|
defaultPrefix |
string | The default command prefix. |
oratorOptions |
OratorOptions | The OratorOptions. |
- Source:
Members
defaultPrefix :string
Type:
- string
- Source:
permissions :Array.<Permission>
Type:
- Array.<Permission>
- Source:
Methods
createDirectMessage(me, msg, content, file) → {Promise.<(Message|undefined)>}
Try to send a message.
Parameters:
Name | Type | Description |
---|---|---|
me |
ExtendedUser | The bot user (link). |
msg |
Message | The message that prompted the DM (link). |
content |
string | any | The content of the message. |
file |
any | The file to send (if any). |
- Source:
Returns:
- Type
- Promise.<(Message|undefined)>
createMessage(me, channel, content, file) → {Promise.<(Message|void)>|void}
Try to send a message.
Parameters:
Name | Type | Description |
---|---|---|
me |
ExtendedUser | The bot user (link). |
channel |
TextChannel | The channel to send the message in (link). |
content |
string | any | The content of the message. |
file |
any | The file to send (if any). |
- Source:
Returns:
- Type
- Promise.<(Message|void)> | void
deleteMessage(me, msg) → {Promise.<void>|void}
Try to delete a message.
Parameters:
Name | Type | Description |
---|---|---|
me |
ExtendedUser | The bot user (link). |
msg |
Message | The message to delete (link). |
- Source:
Returns:
- Type
- Promise.<void> | void
(async) hasPermission(bot, context) → {Promise.<boolean>}
Check if a command can be executed in the given context.
Parameters:
Name | Type | Description |
---|---|---|
bot |
DataClient | The DataClient. |
context |
CommandContext | The CommandContext. |
- Source:
Returns:
- Type
- Promise.<boolean>
(async) processMessage(bot, msg)
Process a message read by the bot.
Parameters:
Name | Type | Description |
---|---|---|
bot |
DataClient | The bot object. |
msg |
Message | The message to process (link). |
- Source: