new StatusManager(bot, databaseManager, optionsopt)
A class representing a StatusManager.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
bot |
DataClient | The DataClient to manage. |
||
databaseManager |
DatabaseManager | The DatabaseManager used to fetch statuses. |
||
options |
StatusManagerOptions |
<optional> |
{} | StatusManagerOptions. |
- Source:
Members
current :Status
Type:
- Status
- Source:
defaultStatus :Status
Type:
- Status
- Source:
Methods
(async) addStatus(status) → {Promise.<void>}
Add a status record.
Parameters:
Name | Type | Description |
---|---|---|
status |
Status | The status to add. |
- Source:
Returns:
- Type
- Promise.<void>
(async) deleteStatus(dbStatus) → {Promise.<void>}
Delete a status record.
Parameters:
Name | Type | Description |
---|---|---|
dbStatus |
DatabaseObject | The status to delete (as a DatabaseObject). |
- Source:
Returns:
- Type
- Promise.<void>
findStatusByName(name) → {Promise.<Array.<DatabaseObject>>}
Search for statuses by name.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The name to search by. |
- Source:
Returns:
The search results.
- Type
- Promise.<Array.<DatabaseObject>>
getStatuses() → {Promise.<Array.<DatabaseObject>>}
Get the statuses for this bot.
- Source:
Returns:
The search results.
- Type
- Promise.<Array.<DatabaseObject>>
(async) initialize() → {Promise.<void>}
Initialize the statuses.
- Source:
Returns:
- Type
- Promise.<void>
(async) setStatus(statusopt) → {Promise.<void>}
Set the status of the bot.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
status |
Status |
<optional> |
Status to set to, if none is given and mode is random, it will randomly change. |
- Source:
Returns:
- Type
- Promise.<void>
timerEnd() → {void}
Stop changing status automatically.
- Source:
Returns:
- Type
- void
timerStart() → {void}
Start automatic status changing.
- Source:
Returns:
- Type
- void