Methods
hasRole(member, role) → {boolean}
Checks if a GuildMember has a certain Role
Parameters:
Name | Type | Description |
---|---|---|
member |
external:GuildMember | The GuildMember to check for a role. |
role |
external:Role | The Role to look for. |
Returns:
- Type
- boolean
openJSON(JSONFile) → {Promise.<Object>}
Opens a json file and returns the data
Parameters:
Name | Type | Description |
---|---|---|
JSONFile |
string | The file to retrive data from |
Returns:
- Type
- Promise.<Object>
openJSONSync(JSONFile) → {Object}
Opens a json file and returns the data
Parameters:
Name | Type | Description |
---|---|---|
JSONFile |
string | The file to retrive data from |
Returns:
- Type
- Object
timeToMs(time) → {number}
converts H:M:S to milliseconds
Parameters:
Name | Type | Description |
---|---|---|
time |
string | A time string in hours:minutes:seconds format |
Returns:
- Type
- number
writeJSON(JSONFile, JSONObject) → {Promise.<string>}
Writes a json object to a file
Parameters:
Name | Type | Description |
---|---|---|
JSONFile |
string | The file to write to |
JSONObject |
Object | The object to write to file |
Returns:
- Type
- Promise.<string>
writeJSONSync(JSONFile, JSONObject)
Writes a json object to a file
Parameters:
Name | Type | Description |
---|---|---|
JSONFile |
string | The file to write to |
JSONObject |
Object | The object to write to file |
Type Definitions
CommandOptions
Options to be passed to used in a command
Type:
- Object
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
id |
string | The command's id |
||
caseSensitive |
boolean |
<optional> |
true | Whether or not the command should be case sensitive |
dmOnly |
boolean |
<optional> |
false | Whether or not the command can only be ran in direct messages only |
guildOnly |
boolean |
<optional> |
false | Whether or not the command can only be ran in a guild text channel. Cannot be true if dmOnly is true |
description |
string |
<optional> |
Default Description | The description of the command |
usage |
string |
<optional> |
command ID | The usage for the command |
permissions |
Array.<string> |
<optional> |
'SEND_MESSAGES' | Array of required permissions |
role |
string |
<optional> |
@everyone | Required role name |
comparator |
string | regex | function | Array.<string> |
<optional> |
id | A string/regex to test the incoming message against, or function that returns a boolean, or and array of strings |
- Source:
ForgeClientOptions
Options to be passed to used in a command
Type:
- Object
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
prefix |
string |
<optional> |
'/' | The default prefix to use for a guild |
selfBot |
boolean |
<optional> |
false | Whether or not the client is a selfbot. |
guildConfigs |
boolean |
<optional> |
false | Whether or not the client should use per guild configs. |
defaultHelp |
boolean |
<optional> |
true | Whether or not the client should use the default help command. |
enabledPlugins |
Array.<string> |
<optional> |
[] | Array of the IDs of plugins that should be enabled by default |
getConfigOption |
function |
<optional> |
null | Optional custom function for retreiving guild config options must except the same parameters as the default one, must return a Promise |
setConfigOption |
function |
<optional> |
null | Optional custom function for setting guild config options must except the same parameters as the default one, must return a Promise |
- Source:
PluginDetails
An Object containing required Plugin
information
Type:
- Object
- Source: