Constructor
new Bot(options, rLoggeropt, rChatHandleropt)
- See:
Properties:
Name | Type | Description |
---|---|---|
carbonBotsKey |
String |
The API key for carbon bot list |
discordBotsKey |
String |
The API key for bots.discord.pw |
discordBotsOrgKey |
String |
The API key for discordbots.org |
botsOnDiscordKey |
String |
The API key for bots.ondiscord.xyz |
logger |
function |
The logging wrapper |
chatHandler |
function |
The class handling chat messages |
blacklistedGuilds |
Array.<String> |
Guilds that are banned from using the bot |
blacklistedUsers |
Array.<String> |
Users that are banned from using the bot |
commandPlugins |
Object |
The loaded command plugins |
eventPlugins |
Object |
The loaded event plugins |
middleware |
Object |
The loaded middleware |
Creates a new instance of Mirai
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
An object defining the configuration for Mirai Properties
|
|||||||||||||||||||||||||||||||||||||||||||||||||
rLogger |
function | <optional> |
A replacement Logger. Must implement |
||||||||||||||||||||||||||||||||||||||||||||||||
rChatHandler |
function | <optional> |
A replacement ChatHandler. Must implement |
Extends
- Eris.Client
Methods
findMember(query, members) → (nullable) {Member}
- See:
Resolve a name or ID to a guild member
Parameters:
Name | Type | Description |
---|---|---|
query |
String |
The name or ID to match |
members |
Collection |
The Collection of guild members |
Returns:
The member the was found
- Type
- Member
findUser(query) → (nullable) {User}
- See:
Resolve a name or ID to a user
Parameters:
Name | Type | Description |
---|---|---|
query |
String |
The name or ID to match |
Returns:
The user the was found
- Type
- User
(async) loadCommandPlugin(plugin) → {Promise}
Example
var funCommands = new FunCommandsPlugin();
mirai.loadCommandPlugin(funCommands);
Parameters:
Name | Type | Description |
---|---|---|
plugin |
function |
The plugin to load. Must have a |
Returns:
The return value of plugin.load
- Type
- Promise
(async) loadEventPlugin(plugin) → {Promise}
Parameters:
Name | Type | Description |
---|---|---|
plugin |
function |
The plugin to load. Must have a |
Returns:
The return value of plugin.load
- Type
- Promise
(async) loadMiddleware(middleware) → {Promise}
Parameters:
Name | Type | Description |
---|---|---|
middleware |
function |
The middleware to load. Must have a |
Returns:
The return value of middleware.load
- Type
- Promise
(async) reloadCommandPlugin(plugin) → {Promise}
Reload a plugin by searching for a plugin with the same name and replacing it
Parameters:
Name | Type | Description |
---|---|---|
plugin |
function |
The plugin to load. Must have a |
Returns:
The return value of plugin.load
- Type
- Promise
(async) reloadEventPlugin(plugin) → {Promise}
Reload a plugin by searching for a plugin with the same name and replacing it
Parameters:
Name | Type | Description |
---|---|---|
plugin |
function |
The plugin to load. Must have a |
Returns:
The return value of plugin.load
- Type
- Promise
(async) reloadMiddleware(middleware) → {Promise}
Reload middleware by searching for middleware with the same name and replacing it
Parameters:
Name | Type | Description |
---|---|---|
middleware |
function |
The middleware to load. Must have a |
Returns:
The return value of middleware.load
- Type
- Promise
(async) setAvatar(url) → {Promise}
Sets the bot's avatar from a url
Parameters:
Name | Type | Description |
---|---|---|
url |
String |
A direct link to an image |
Returns:
Resolves on completion
- Type
- Promise
(async) updateBotsOnDiscord(keyopt) → {Promise}
- See:
Updates information on bots.ondiscord.xyz
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
key |
String | <optional> |
bots.ondiscord.xyz API key |
Returns:
The axios request result or error
- Type
- Promise
(async) updateCarbon(keyopt) → {Promise}
- See:
Updates information on carbonitex.net
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
key |
String | <optional> |
Carbon API key |
Returns:
The axios request result or error
- Type
- Promise
(async) updateDiscordBots(keyopt) → {Promise}
- See:
Updates information on bots.discord.pw
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
key |
String | <optional> |
bots.discord.pw API key |
Returns:
The axios request result or error
- Type
- Promise
(async) updateDiscordBotsOrg(keyopt) → {Promise}
- See:
Updates information on discordbots.org
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
key |
String | <optional> |
discordbots API key |
Returns:
The axios request result or error
- Type
- Promise