Small fixes
parent
05a56e76bd
commit
58b858cbca
3 changed files with 9 additions and 547 deletions
15
Config.md
15
Config.md
|
@ -20,10 +20,11 @@ These are for the config.json file.
|
|||
## Settings
|
||||
|
||||
These are for default_settings.json and all of the settings.json files.
|
||||
Name | Recommended | Type | Description
|
||||
--- | --- | --- | ---
|
||||
prefix | . | str | Determines the prefix before all of the commands
|
||||
messageTimer | 5000 | int | How long will the commands and the responses be visible for?
|
||||
commandsChannel | commands | str/false | If false, bot can be used in all channels. If a string, it can be only used in a channel with that name.
|
||||
keepCommandsChannelClean | false | bool | If the bot should clear all messages from commands channel. This uses messageTimer, so make sure that that is also set.
|
||||
music.volume | 100 | int | The default volume for the bot.
|
||||
|
||||
| Name | Recommended | Type | Description |
|
||||
| ------------------------ | ----------- | --------- | ----------------------------------------------------------------------------------------------------------------------- |
|
||||
| prefix | . | str | Determines the prefix before all of the commands |
|
||||
| messageTimer | 5000 | int | How long will the commands and the responses be visible for? |
|
||||
| commandsChannel | commands | str/false | If false, bot can be used in all channels. If a string, it can be only used in a channel with that name. |
|
||||
| keepCommandsChannelClean | false | bool | If the bot should clear all messages from commands channel. This uses messageTimer, so make sure that that is also set. |
|
||||
| music.volume | 100 | int | The default volume for the bot. |
|
||||
|
|
539
JSDoc.md
539
JSDoc.md
|
@ -1,539 +0,0 @@
|
|||
<!-- markdownlint-disable -->
|
||||
# JSDocs
|
||||
|
||||
## Modules
|
||||
|
||||
<dl>
|
||||
<dt><a href="#module_common">common</a></dt>
|
||||
<dd><p>This module holds most of everything. It holds the discord client and discord.js framework utilities, configuration and guild configurations. Provides really useful utilities too.</p>
|
||||
</dd>
|
||||
<dt><a href="#module_dirFiles">dirFiles</a></dt>
|
||||
<dd><p>Handles listing all files in a folder. Ignores subfolders.</p>
|
||||
</dd>
|
||||
<dt><a href="#module_stopListener">stopListener</a></dt>
|
||||
<dd><p>This module is responsible for listening for a signal to stop the bot.</p>
|
||||
</dd>
|
||||
<dt><a href="#module_safeDelete">safeDelete</a></dt>
|
||||
<dd><p>Responsible for deleting messages while trying to avoid any errors.</p>
|
||||
</dd>
|
||||
<dt><a href="#module_guilds/commandHandler">guilds/commandHandler</a></dt>
|
||||
<dd><p>Handles all guild commands.</p>
|
||||
</dd>
|
||||
<dt><a href="#module_guilds/permissionHandler">guilds/permissionHandler</a></dt>
|
||||
<dd><p>Handles all guild permissions.</p>
|
||||
</dd>
|
||||
<dt><a href="#module_guilds/prefrenceHandler">guilds/prefrenceHandler</a></dt>
|
||||
<dd><p>Handles all of the prefrences for guilds.</p>
|
||||
</dd>
|
||||
<dt><a href="#module_guilds/music/cache">guilds/music/cache</a></dt>
|
||||
<dd><p>Responsible for caching songs</p>
|
||||
</dd>
|
||||
<dt><a href="#module_guilds/music">guilds/music</a></dt>
|
||||
<dd><p>Responsible for for playing music in guilds.</p>
|
||||
</dd>
|
||||
<dt><a href="#module_guilds/music/queue">guilds/music/queue</a></dt>
|
||||
<dd><p>Responsible for song queues.</p>
|
||||
</dd>
|
||||
<dt><a href="#module_guilds/music/youtube">guilds/music/youtube</a></dt>
|
||||
<dd><p>Responsible for interacting with youtube.</p>
|
||||
</dd>
|
||||
<dt><a href="#module_guilds/commands/Command">guilds/commands/Command</a></dt>
|
||||
<dd><p>The parent for all of the guild commands.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
## Functions
|
||||
|
||||
<dl>
|
||||
<dt><a href="#exp_module_getServer--getServer">getServer(msg)</a> ⇒ <code><a href="#Server">Server</a></code> ⏏</dt>
|
||||
<dd><p>Returns the server's prefrences</p>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
## Typedefs
|
||||
|
||||
<dl>
|
||||
<dt><a href="#Message">Message</a> : <code>Object</code></dt>
|
||||
<dd><p>An object representing a message object. <a href="https://discord.js.org/#/docs/main/master/class/Message">https://discord.js.org/#/docs/main/master/class/Message</a></p>
|
||||
</dd>
|
||||
<dt><a href="#Server">Server</a> : <code>Object</code></dt>
|
||||
<dd><p>An object representing a guild's prefrences, and other information for the server.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<a id="module_common"></a>
|
||||
## common
|
||||
This module holds most of everything. It holds the discord client and discord.js framework utilities, configuration and guild configurations. Provides really useful utilities too.
|
||||
|
||||
|
||||
* [common](#module_common)
|
||||
* _static_
|
||||
* [.ready](#module_common__ready)
|
||||
* [.appRoot](#module_common__appRoot)
|
||||
* [.Discord](#module_common__Discord)
|
||||
* [.client](#module_common__client)
|
||||
* [.config](#module_common__config)
|
||||
* _inner_
|
||||
* [~splitMsg(msg)](#module_common____splitMsg) ⇒ <code>Object</code>
|
||||
* [~debug(message)](#module_common____debug) ⇒ <code>void</code>
|
||||
* [~parseNum(numMsg)](#module_common____parseNum) ⇒ <code>Number</code> \| <code>null</code>
|
||||
|
||||
<a id="module_common__ready"></a>
|
||||
### common.ready
|
||||
**Kind**: static property of [<code>common</code>](#module_common)
|
||||
<a id="module_common__appRoot"></a>
|
||||
### common.appRoot
|
||||
**Kind**: static property of [<code>common</code>](#module_common)
|
||||
<a id="module_common__Discord"></a>
|
||||
### common.Discord
|
||||
**Kind**: static property of [<code>common</code>](#module_common)
|
||||
<a id="module_common__client"></a>
|
||||
### common.client
|
||||
**Kind**: static property of [<code>common</code>](#module_common)
|
||||
<a id="module_common__config"></a>
|
||||
### common.config
|
||||
All of the configurations for the bot.
|
||||
|
||||
**Kind**: static property of [<code>common</code>](#module_common)
|
||||
<a id="module_common____splitMsg"></a>
|
||||
### common~splitMsg(msg) ⇒ <code>Object</code>
|
||||
Removes the prefix from the message and returns an array of the message parts
|
||||
|
||||
**Kind**: inner method of [<code>common</code>](#module_common)
|
||||
**Returns**: <code>Object</code> - - The message split at space characters
|
||||
|
||||
| Param | Type |
|
||||
| --- | --- |
|
||||
| msg | [<code>Message</code>](#Message) |
|
||||
|
||||
<a id="module_common____debug"></a>
|
||||
### common~debug(message) ⇒ <code>void</code>
|
||||
Print a message to console if debugging is enabled.
|
||||
|
||||
**Kind**: inner method of [<code>common</code>](#module_common)
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| message | <code>\*</code> | Message to be printed if debugging is enabled. |
|
||||
|
||||
<a id="module_common____parseNum"></a>
|
||||
### common~parseNum(numMsg) ⇒ <code>Number</code> \| <code>null</code>
|
||||
Converts a string to a number.
|
||||
|
||||
**Kind**: inner method of [<code>common</code>](#module_common)
|
||||
**Returns**: <code>Number</code> \| <code>null</code> - Returns number, or null if parsing failed.
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| numMsg | <code>String</code> | The message that's being tested |
|
||||
|
||||
<a id="module_dirFiles"></a>
|
||||
## dirFiles
|
||||
Handles listing all files in a folder. Ignores subfolders.
|
||||
|
||||
<a id="exp_module_dirFiles--module__exports"></a>
|
||||
### module.exports(dirPath) ⇒ <code>Promise</code> ⏏
|
||||
Finds all files in a given folder, ignores subfolders.
|
||||
|
||||
**Kind**: Exported function
|
||||
**Returns**: <code>Promise</code> - Returns a promise, that when resolved returns an array of paths.
|
||||
**Fulfil**: <code>Array.<String></code> An array of strings
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| dirPath | <code>String</code> | Path to the folder. |
|
||||
|
||||
<a id="module_stopListener"></a>
|
||||
## stopListener
|
||||
This module is responsible for listening for a signal to stop the bot.
|
||||
|
||||
<a id="module_safeDelete"></a>
|
||||
## safeDelete
|
||||
Responsible for deleting messages while trying to avoid any errors.
|
||||
|
||||
<a id="exp_module_safeDelete--module__exports"></a>
|
||||
### module.exports(msg, timer, [reason]) ⇒ <code>void</code> ⏏
|
||||
**Kind**: Exported function
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| msg | [<code>Message</code>](#Message) | - |
|
||||
| timer | <code>Number</code> | Time in ms, after which to delete the message. |
|
||||
| [reason] | [<code>Message</code>](#Message) | Optional reason for deleting the message, shown in the audit log. |
|
||||
|
||||
<a id="module_guilds/commandHandler"></a>
|
||||
## guilds/commandHandler
|
||||
Handles all guild commands.
|
||||
|
||||
<a id="exp_module_guilds/commandHandler--module__exports"></a>
|
||||
### module.exports(msg) ⇒ <code>void</code> ⏏
|
||||
Makes a few check on the command, then checks for permissions with permissionHandler, then checks if the command exists from map that's generated from all of the arrays of {Command} objects, and if it does, launches it.
|
||||
|
||||
**Kind**: Exported function
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| msg | <code>Object</code> | Message object |
|
||||
|
||||
<a id="module_guilds/permissionHandler"></a>
|
||||
## guilds/permissionHandler
|
||||
Handles all guild permissions.
|
||||
|
||||
|
||||
* [guilds/permissionHandler](#module_guilds/permissionHandler)
|
||||
* _static_
|
||||
* [.ifUserCanUseCommand(msg)](#module_guilds/permissionHandler__ifUserCanUseCommand) ⇒ <code>Boolean</code>
|
||||
* [.init(guild)](#module_guilds/permissionHandler__init) ⇒ <code>void</code>
|
||||
* _inner_
|
||||
* [~userGroupInGuild(msg)](#module_guilds/permissionHandler____userGroupInGuild) ⇒ <code>Group</code>
|
||||
* [~Group](#module_guilds/permissionHandler____Group) : <code>Object</code>
|
||||
|
||||
<a id="module_guilds/permissionHandler__ifUserCanUseCommand"></a>
|
||||
### guilds/permissionHandler.ifUserCanUseCommand(msg) ⇒ <code>Boolean</code>
|
||||
Checks if the user is allowed to use the command.
|
||||
|
||||
**Kind**: static method of [<code>guilds/permissionHandler</code>](#module_guilds/permissionHandler)
|
||||
**Returns**: <code>Boolean</code> - If the user can use the command or not
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| msg | <code>Object</code> | Message object |
|
||||
|
||||
<a id="module_guilds/permissionHandler__init"></a>
|
||||
### guilds/permissionHandler.init(guild) ⇒ <code>void</code>
|
||||
Intializes a guild's permissions. Has to be run once for every guild in order for permissions for that guild to work.
|
||||
|
||||
**Kind**: static method of [<code>guilds/permissionHandler</code>](#module_guilds/permissionHandler)
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| guild | <code>Object</code> | Guild object |
|
||||
|
||||
<a id="module_guilds/permissionHandler____userGroupInGuild"></a>
|
||||
### guilds/permissionHandler~userGroupInGuild(msg) ⇒ <code>Group</code>
|
||||
Returns a group for user. If user doesn't match any groups, default group is returned.
|
||||
|
||||
**Kind**: inner method of [<code>guilds/permissionHandler</code>](#module_guilds/permissionHandler)
|
||||
**Returns**: <code>Group</code> - Returns the user's group.
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| msg | <code>Object</code> | Message object |
|
||||
|
||||
<a id="module_guilds/permissionHandler____Group"></a>
|
||||
### guilds/permissionHandler~Group : <code>Object</code>
|
||||
An object representing a permission group.
|
||||
|
||||
**Kind**: inner typedef of [<code>guilds/permissionHandler</code>](#module_guilds/permissionHandler)
|
||||
**Properties**
|
||||
|
||||
| Name | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| ids | <code>Array.<String></code> | An array of ids |
|
||||
| whitelist | <code>Array.<Strings></code> | Blacklisted commands for the group |
|
||||
| blacklist | <code>Array.<Strings></code> | Whitelisted commands for the group |
|
||||
|
||||
<a id="module_guilds/prefrenceHandler"></a>
|
||||
## guilds/prefrenceHandler
|
||||
Handles all of the prefrences for guilds.
|
||||
|
||||
|
||||
* [guilds/prefrenceHandler](#module_guilds/prefrenceHandler)
|
||||
* [~getPrefFolders()](#module_guilds/prefrenceHandler____getPrefFolders) ⇒ <code>Promise.<Array></code>
|
||||
* [~getPrefs(folderPath, filePrefix)](#module_guilds/prefrenceHandler____getPrefs) ⇒ [<code>Server</code>](#Server)
|
||||
* [~init(guild)](#module_guilds/prefrenceHandler____init) ⇒ <code>void</code>
|
||||
* [~deletePrefs(guildID)](#module_guilds/prefrenceHandler____deletePrefs) ⇒ <code>void</code>
|
||||
|
||||
<a id="module_guilds/prefrenceHandler____getPrefFolders"></a>
|
||||
### guilds/prefrenceHandler~getPrefFolders() ⇒ <code>Promise.<Array></code>
|
||||
Gets all of the guild prefrence folders.
|
||||
|
||||
**Kind**: inner method of [<code>guilds/prefrenceHandler</code>](#module_guilds/prefrenceHandler)
|
||||
**Returns**: <code>Promise.<Array></code> - When resolved becomes an array of guild prefrence folder paths.
|
||||
**Fulfil**: <code>Array.<{Server</code>>} An array of server objects.
|
||||
<a id="module_guilds/prefrenceHandler____getPrefs"></a>
|
||||
### guilds/prefrenceHandler~getPrefs(folderPath, filePrefix) ⇒ [<code>Server</code>](#Server)
|
||||
Gets a server object from a folder. If prefix is supplied, tries that for both files.
|
||||
|
||||
**Kind**: inner method of [<code>guilds/prefrenceHandler</code>](#module_guilds/prefrenceHandler)
|
||||
**Returns**: [<code>Server</code>](#Server) - Server object.
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| folderPath | <code>String</code> | A path to the guild's folder. |
|
||||
| filePrefix | <code>String</code> | If there is an unusual prefix for the prefrence files. |
|
||||
|
||||
<a id="module_guilds/prefrenceHandler____init"></a>
|
||||
### guilds/prefrenceHandler~init(guild) ⇒ <code>void</code>
|
||||
Intializes the guild's prefrences.
|
||||
|
||||
**Kind**: inner method of [<code>guilds/prefrenceHandler</code>](#module_guilds/prefrenceHandler)
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| guild | <code>Object</code> | Guild object. |
|
||||
|
||||
<a id="module_guilds/prefrenceHandler____deletePrefs"></a>
|
||||
### guilds/prefrenceHandler~deletePrefs(guildID) ⇒ <code>void</code>
|
||||
Delete's a guild's prefrences folder. Used when a guild kicks the bot or the guild is destroyed.
|
||||
|
||||
**Kind**: inner method of [<code>guilds/prefrenceHandler</code>](#module_guilds/prefrenceHandler)
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| guildID | <code>String</code> | A guild's ID |
|
||||
|
||||
<a id="module_guilds/music/cache"></a>
|
||||
## guilds/music/cache
|
||||
Responsible for caching songs
|
||||
|
||||
<a id="exp_module_guilds/music/cache--Cache"></a>
|
||||
### Cache ⏏
|
||||
Handles caching songs
|
||||
|
||||
**Kind**: Exported class
|
||||
<a id="module_guilds/music"></a>
|
||||
## guilds/music
|
||||
Responsible for for playing music in guilds.
|
||||
|
||||
|
||||
* [guilds/music](#module_guilds/music)
|
||||
* [Player](#exp_module_guilds/music--Player) ⏏
|
||||
* [new Player(serverID, musicSettings)](#new_module_guilds/music--Player_new)
|
||||
* _instance_
|
||||
* [.resolveInput(msg)](#module_guilds/music--Player+resolveInput) ⇒ <code>Promise.<(String\|Undefined)></code>
|
||||
* [.skipSongs(amount)](#module_guilds/music--Player+skipSongs) ⇒ <code>Boolean</code>
|
||||
* [.adjustVolume(percentage)](#module_guilds/music--Player+adjustVolume) ⇒ <code>void</code>
|
||||
* [.stop()](#module_guilds/music--Player+stop) ⇒ <code>void</code>
|
||||
* [.getPrintableQueue()](#module_guilds/music--Player+getPrintableQueue) ⇒ <code>String</code>
|
||||
* _static_
|
||||
* [.getPlayer(serverID)](#module_guilds/music--Player__getPlayer) ⇒ <code>Player</code>
|
||||
* [.checkCaching(song)](#module_guilds/music--Player__checkCaching) ⇒ <code>Promise</code>
|
||||
* _inner_
|
||||
* [~_ifConnected(guild)](#module_guilds/music--Player_____ifConnected) ⇒ <code>Boolean</code>
|
||||
* [~_playSong(song)](#module_guilds/music--Player_____playSong) ⇒ <code>void</code>
|
||||
* [~Song](#module_guilds/music--Player____Song) : <code>Object</code>
|
||||
|
||||
<a id="exp_module_guilds/music--Player"></a>
|
||||
### Player ⏏
|
||||
Represents a music player.
|
||||
|
||||
**Kind**: Exported class
|
||||
<a id="new_module_guilds/music--Player_new"></a>
|
||||
#### new Player(serverID, musicSettings)
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| serverID | <code>String</code> | The server's ID. |
|
||||
| musicSettings | <code>Object</code> | Guild's prefrence's music settings. |
|
||||
|
||||
<a id="module_guilds/music--Player+resolveInput"></a>
|
||||
#### player.resolveInput(msg) ⇒ <code>Promise.<(String\|Undefined)></code>
|
||||
Resolves user input, returns search results or undefined.
|
||||
|
||||
**Kind**: instance method of [<code>Player</code>](#exp_module_guilds/music--Player)
|
||||
**Returns**: <code>Promise.<(String\|Undefined)></code> - A promise, that'll become Search results to print or undefined.
|
||||
**Fulfil**: <code>(String\|undefined)</code> Search results to be printedor undefined.
|
||||
**Reject**: <code>String</code> Error to print
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| msg | [<code>Message</code>](#Message) | A split message |
|
||||
|
||||
<a id="module_guilds/music--Player+skipSongs"></a>
|
||||
#### player.skipSongs(amount) ⇒ <code>Boolean</code>
|
||||
Skips a certain amount of songs for the server of the message.
|
||||
|
||||
**Kind**: instance method of [<code>Player</code>](#exp_module_guilds/music--Player)
|
||||
**Returns**: <code>Boolean</code> - Returns if the skip was successful or not.
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| amount | <code>Number</code> | The number of songs to skip |
|
||||
|
||||
<a id="module_guilds/music--Player+adjustVolume"></a>
|
||||
#### player.adjustVolume(percentage) ⇒ <code>void</code>
|
||||
Adjust the volume for the server of the message.
|
||||
|
||||
**Kind**: instance method of [<code>Player</code>](#exp_module_guilds/music--Player)
|
||||
|
||||
| Param | Type |
|
||||
| --- | --- |
|
||||
| percentage | <code>Number</code> |
|
||||
|
||||
<a id="module_guilds/music--Player+stop"></a>
|
||||
#### player.stop() ⇒ <code>void</code>
|
||||
Skips all of the songs in queue and stops playing.
|
||||
|
||||
**Kind**: instance method of [<code>Player</code>](#exp_module_guilds/music--Player)
|
||||
<a id="module_guilds/music--Player+getPrintableQueue"></a>
|
||||
#### player.getPrintableQueue() ⇒ <code>String</code>
|
||||
Returns the printable queue.
|
||||
|
||||
**Kind**: instance method of [<code>Player</code>](#exp_module_guilds/music--Player)
|
||||
**Returns**: <code>String</code> - Printable queue
|
||||
<a id="module_guilds/music--Player__getPlayer"></a>
|
||||
#### Player.getPlayer(serverID) ⇒ <code>Player</code>
|
||||
Gets the player for the server. Creates it if it doesn't exist.
|
||||
|
||||
**Kind**: static method of [<code>Player</code>](#exp_module_guilds/music--Player)
|
||||
**Returns**: <code>Player</code> - Player Returns the player object for the server.
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| serverID | <code>Message.guild.id</code> | The server's ID. |
|
||||
|
||||
<a id="module_guilds/music--Player__checkCaching"></a>
|
||||
#### Player.checkCaching(song) ⇒ <code>Promise</code>
|
||||
Checks if a song is cached or not.
|
||||
|
||||
**Kind**: static method of [<code>Player</code>](#exp_module_guilds/music--Player)
|
||||
**Returns**: <code>Promise</code> - A promise that is resolved if/when the song has been cached.
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| song | <code>Song</code> | The song to check. |
|
||||
|
||||
<a id="module_guilds/music--Player_____ifConnected"></a>
|
||||
#### Player~\_ifConnected(guild) ⇒ <code>Boolean</code>
|
||||
Tests if a guild has the bot connected to a voice channel or not.
|
||||
|
||||
**Kind**: inner method of [<code>Player</code>](#exp_module_guilds/music--Player)
|
||||
**Returns**: <code>Boolean</code> - Returns if the bot is connected to a voice channel in the guild.
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| guild | <code>Message.guild</code> | The guild object. |
|
||||
|
||||
<a id="module_guilds/music--Player_____playSong"></a>
|
||||
#### Player~\_playSong(song) ⇒ <code>void</code>
|
||||
Plays a song.
|
||||
|
||||
**Kind**: inner method of [<code>Player</code>](#exp_module_guilds/music--Player)
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| song | <code>Song</code> | The song to play |
|
||||
|
||||
<a id="module_guilds/music--Player____Song"></a>
|
||||
#### Player~Song : <code>Object</code>
|
||||
An object representing a guild's prefrences, and other information for the server.
|
||||
|
||||
**Kind**: inner typedef of [<code>Player</code>](#exp_module_guilds/music--Player)
|
||||
**Properties**
|
||||
|
||||
| Name | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| videoID | <code>String</code> | The ID of the video. Needs to be unique for that song. |
|
||||
| container | <code>String</code> | The container for the song, used at the end of the filename. |
|
||||
| url | <code>String</code> | Url to download the song from. |
|
||||
| lenght | <code>Number</code> | The lenght of the song, in seconds. |
|
||||
| title | <code>String</code> | The name of the song |
|
||||
| [rawInfo] | <code>Object</code> | If applicable, contains the raw information of the song. Used with youtube songs. |
|
||||
|
||||
<a id="module_guilds/music/queue"></a>
|
||||
## guilds/music/queue
|
||||
Responsible for song queues.
|
||||
|
||||
<a id="exp_module_guilds/music/queue--Queue"></a>
|
||||
### Queue ⏏
|
||||
Represents a queue in a player.
|
||||
|
||||
**Kind**: Exported class
|
||||
<a id="module_guilds/music/youtube"></a>
|
||||
## guilds/music/youtube
|
||||
Responsible for interacting with youtube.
|
||||
|
||||
<a id="exp_module_guilds/music/youtube--Youtube"></a>
|
||||
### Youtube ⏏
|
||||
**Kind**: Exported class
|
||||
<a id="module_guilds/commands/Command"></a>
|
||||
## guilds/commands/Command
|
||||
The parent for all of the guild commands.
|
||||
|
||||
|
||||
* [guilds/commands/Command](#module_guilds/commands/Command)
|
||||
* [Command](#exp_module_guilds/commands/Command--Command) ⏏
|
||||
* [new Command(metaData, func)](#new_module_guilds/commands/Command--Command_new)
|
||||
* _instance_
|
||||
* [.call(msg)](#module_guilds/commands/Command--Command+call) ⇒ <code>void</code>
|
||||
* [.usage(guildID)](#module_guilds/commands/Command--Command+usage) ⇒ <code>String</code>
|
||||
* _static_
|
||||
* [.registerCommand(metaData, func)](#module_guilds/commands/Command--Command__registerCommand) ⇒ <code>void</code>
|
||||
|
||||
<a id="exp_module_guilds/commands/Command--Command"></a>
|
||||
### Command ⏏
|
||||
Base class for all command objects.
|
||||
|
||||
**Kind**: Exported class
|
||||
<a id="new_module_guilds/commands/Command--Command_new"></a>
|
||||
#### new Command(metaData, func)
|
||||
|
||||
| Param | Type |
|
||||
| --- | --- |
|
||||
| metaData | <code>Object</code> |
|
||||
| func | <code>function</code> |
|
||||
|
||||
<a id="module_guilds/commands/Command--Command+call"></a>
|
||||
#### command.call(msg) ⇒ <code>void</code>
|
||||
Calls the actual command that was passed to CommandClass
|
||||
|
||||
**Kind**: instance method of [<code>Command</code>](#exp_module_guilds/commands/Command--Command)
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| msg | [<code>Message</code>](#Message) | Message object |
|
||||
|
||||
<a id="module_guilds/commands/Command--Command+usage"></a>
|
||||
#### command.usage(guildID) ⇒ <code>String</code>
|
||||
Gets the usage of the command for the specific server where the message was sent.
|
||||
|
||||
**Kind**: instance method of [<code>Command</code>](#exp_module_guilds/commands/Command--Command)
|
||||
**Returns**: <code>String</code> - Returns rawUsage with the following prefix "Usage: <serverPrefix>commandname "
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| guildID | <code>String</code> | The guild's id. |
|
||||
|
||||
<a id="module_guilds/commands/Command--Command__registerCommand"></a>
|
||||
#### Command.registerCommand(metaData, func) ⇒ <code>void</code>
|
||||
**Kind**: static method of [<code>Command</code>](#exp_module_guilds/commands/Command--Command)
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| metaData | <code>Object</code> | Object containing metadata about the command |
|
||||
| metaData.name | <code>String</code> | The name of the command |
|
||||
| metaData.min | <code>number</code> | Minimium number of arguments |
|
||||
| metaData.max | <code>number</code> | Maximium number of arguments |
|
||||
| metaData.usage | <code>String</code> | A description of how the command should be used. Prefixed with "Usage: <command prefix>" |
|
||||
| func | <code>function</code> | The actual function that's called when an user executes a command. |
|
||||
|
||||
<a id="Message"></a>
|
||||
## Message : <code>Object</code>
|
||||
An object representing a message object. https://discord.js.org/#/docs/main/master/class/Message
|
||||
|
||||
**Kind**: global typedef
|
||||
**Properties**
|
||||
|
||||
| Name | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| author | <code>Object</code> | The author of the message |
|
||||
| id | <code>String</code> | The messages unique ID |
|
||||
| member | <code>Object</code> | The guild member representation of the author of the message. |
|
||||
| guild | <code>Object</code> | The guild the message was sent in. |
|
||||
| guild.id | <code>String</code> | The guild's unique ID |
|
||||
| channel | <code>Object</code> | A channel, may be text or voice. |
|
||||
|
||||
<a id="Server"></a>
|
||||
## Server : <code>Object</code>
|
||||
An object representing a guild's prefrences, and other information for the server.
|
||||
|
||||
**Kind**: global typedef
|
||||
**Properties**
|
||||
|
||||
| Name | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| settings | <code>Object</code> | The server's settings |
|
||||
| permissions | <code>Object</code> | Server's permissions groups |
|
||||
| music | <code>Object</code> | Servers music status |
|
||||
|
|
@ -24,4 +24,4 @@ It's good practice to specify the `ids` in the group as well. It can only be 1 g
|
|||
|
||||
## Limits
|
||||
|
||||
Please note that both groups and ids per group have default max limits set in config.json, to make sure that not too much ram is used. If you wish though, those can be freely changed.
|
||||
Please note that both groups and ids per group have default max limits set in config.json, to make sure that not too much ram is used. If you wish though, those can be freely changed.
|
||||
|
|
Reference in a new issue