diff --git a/docs/docs.json b/docs/docs.json
index 28a6ac04a..86d9ef72c 100644
--- a/docs/docs.json
+++ b/docs/docs.json
@@ -1 +1 @@
-{"meta":{"version":12,"date":1471988090963},"classes":[{"id":"Client","name":"Client","description":"The starting point for making a Discord Bot.","meta":{"line":17,"file":"Client.js","path":"src/client"},"extends":["EventEmitter"],"classConstructor":{"id":"Client()","name":"Client","description":"Creates an instance of Client.","memberof":"Client","params":[{"name":"options","description":"options to pass to the client","optional":true,"type":{"types":[[["ClientOptions",""]]]}}]},"methods":[{"id":"Client#login","name":"login","description":"Logs the client in. If successful, resolves with the account's token. If you're making a bot, it's\nmuch better to use a bot account rather than a user account.\nBot accounts have higher rate limits and have access to some features user accounts don't have. User bots\nthat are making a lot of API requests can even be banned.","memberof":"Client","examples":["// log the client in using a token\nconst token = 'my token';\nclient.login(token);","// log the client in using email and password\nconst email = 'user@email.com';\nconst password = 'supersecret123';\nclient.login(email, password);"],"meta":{"line":124,"file":"Client.js","path":"src/client"},"returns":{"types":[[["Promise",".<"],["String",">"]]]},"params":[{"name":"emailOrToken","description":"The email or token used for the account. If it is an email, a password _must_ be\nprovided.","type":{"types":[[["String",""]]]}},{"name":"password","description":"The password for the account, only needed if an email was provided.","optional":true,"type":{"types":[[["String",""]]]}}]}],"properties":[{"id":"Client#users","name":"users","description":"A Collection of the Client's stored users","memberof":"Client","type":{"types":[[["Collection",".<"],["String",", "],["User",">"]]]},"meta":{"line":72,"file":"Client.js","path":"src/client"},"props":[]},{"id":"Client#guilds","name":"guilds","description":"A Collection of the Client's stored guilds","memberof":"Client","type":{"types":[[["Collection",".<"],["String",", "],["Guild",">"]]]},"meta":{"line":77,"file":"Client.js","path":"src/client"},"props":[]},{"id":"Client#channels","name":"channels","description":"A Collection of the Client's stored channels","memberof":"Client","type":{"types":[[["Collection",".<"],["String",", "],["Channel",">"]]]},"meta":{"line":82,"file":"Client.js","path":"src/client"},"props":[]},{"id":"Client#token","name":"token","description":"The authorization token for the logged in user/bot.","memberof":"Client","type":{"types":[[["String",""]]]},"meta":{"line":87,"file":"Client.js","path":"src/client"},"props":[]},{"id":"Client#user","name":"user","description":"The ClientUser representing the logged in Client","memberof":"Client","type":{"types":[[["ClientUser",""]]]},"meta":{"line":92,"file":"Client.js","path":"src/client"},"props":[]},{"id":"Client#email","name":"email","description":"The email, if there is one, for the logged in Client","memberof":"Client","type":{"types":[[["String",""]]]},"meta":{"line":97,"file":"Client.js","path":"src/client"},"props":[]},{"id":"Client#password","name":"password","description":"The password, if there is one, for the logged in Client","memberof":"Client","type":{"types":[[["String",""]]]},"meta":{"line":102,"file":"Client.js","path":"src/client"},"props":[]},{"id":"Client#voiceConnections","name":"voiceConnections","description":"Returns a Collection, mapping Guild ID to Voice Connections.","memberof":"Client","type":{"types":[[["Collection",".<"],["String",", "],["VoiceConnection",">"]]]},"meta":{"line":138,"file":"Client.js","path":"src/client"},"props":[]}],"events":[{"id":"Client#event:channelUpdate","name":"channelUpdate","description":"Emitted whenever a channel is updated - e.g. name change, topic change.","memberof":"Client","meta":{"line":31,"file":"ChannelUpdate.js","path":"src/client/actions"},"params":[{"name":"oldChannel","description":"the channel before the update","type":{"types":[[["Channel",""]]]}},{"name":"newChannel","description":"the channel after the update","type":{"types":[[["Channel",""]]]}}]},{"id":"Client#event:guildUnavailable","name":"guildUnavailable","description":"Emitted whenever a guild becomes unavailable, likely due to a server outage.","memberof":"Client","meta":{"line":49,"file":"GuildDelete.js","path":"src/client/actions"},"params":[{"name":"guild","description":"the guild that has become unavailable.","type":{"types":[[["Guild",""]]]}}]},{"id":"Client#event:guildMemberRemove","name":"guildMemberRemove","description":"Emitted whenever a member leaves a guild, or is kicked.","memberof":"Client","meta":{"line":49,"file":"GuildMemberRemove.js","path":"src/client/actions"},"params":[{"name":"guild","description":"the guild that the member has left.","type":{"types":[[["Guild",""]]]}},{"name":"member","description":"the member that has left the guild.","type":{"types":[[["GuildMember",""]]]}}]},{"id":"Client#event:guildRoleCreate","name":"guildRoleCreate","description":"Emitted whenever a guild role is created.","memberof":"Client","meta":{"line":32,"file":"GuildRoleCreate.js","path":"src/client/actions"},"params":[{"name":"guild","description":"the guild that the role was created in.","type":{"types":[[["Guild",""]]]}},{"name":"role","description":"the role that was created.","type":{"types":[[["Role",""]]]}}]},{"id":"Client#event:guildRoleDelete","name":"guildRoleDelete","description":"Emitted whenever a guild role is deleted.","memberof":"Client","meta":{"line":47,"file":"GuildRoleDelete.js","path":"src/client/actions"},"params":[{"name":"guild","description":"the guild that the role was deleted in.","type":{"types":[[["Guild",""]]]}},{"name":"role","description":"the role that was deleted.","type":{"types":[[["Role",""]]]}}]},{"id":"Client#event:guildRoleUpdated","name":"guildRoleUpdated","description":"Emitted whenever a guild role is updated.","memberof":"Client","meta":{"line":36,"file":"GuildRoleUpdate.js","path":"src/client/actions"},"params":[{"name":"guild","description":"the guild that the role was updated in.","type":{"types":[[["Guild",""]]]}},{"name":"oldRole","description":"the role before the update.","type":{"types":[[["Role",""]]]}},{"name":"newRole","description":"the role after the update.","type":{"types":[[["Role",""]]]}}]},{"id":"Client#event:guildUpdate","name":"guildUpdate","description":"Emitted whenever a guild is updated - e.g. name change.","memberof":"Client","meta":{"line":38,"file":"GuildUpdate.js","path":"src/client/actions"},"params":[{"name":"oldGuild","description":"the guild before the update.","type":{"types":[[["Guild",""]]]}},{"name":"newGuild","description":"the guild after the update.","type":{"types":[[["Guild",""]]]}}]},{"id":"Client#event:messageUpdate","name":"messageUpdate","description":"Emitted whenever a message is updated - e.g. embed or content change.","memberof":"Client","meta":{"line":36,"file":"MessageUpdate.js","path":"src/client/actions"},"params":[{"name":"oldMessage","description":"the message before the update.","type":{"types":[[["Message",""]]]}},{"name":"newMessage","description":"the message after the update.","type":{"types":[[["Message",""]]]}}]},{"id":"Client#event:userUpdate","name":"userUpdate","description":"Emitted whenever a detail of the logged in User changes - e.g. username.","memberof":"Client","meta":{"line":36,"file":"UserUpdate.js","path":"src/client/actions"},"params":[{"name":"oldClientUser","description":"the client user before the update.","type":{"types":[[["ClientUser",""]]]}},{"name":"newClientUser","description":"the client user after the update.","type":{"types":[[["ClientUser",""]]]}}]},{"id":"Client#event:guildCreate","name":"guildCreate","description":"Emitted whenever the client joins a Guild.","memberof":"Client","meta":{"line":25,"file":"ClientDataManager.js","path":"src/client"},"params":[{"name":"guild","description":"the created guild.","type":{"types":[[["Guild",""]]]}}]},{"id":"Client#event:channelCreate","name":"channelCreate","description":"Emitted whenever a Channel is created.","memberof":"Client","meta":{"line":20,"file":"ChannelCreate.js","path":"src/client/websocket/packets/handlers"},"params":[{"name":"channel","description":"The channel that was created","type":{"types":[[["Channel",""]]]}}]},{"id":"Client#event:channelDelete","name":"channelDelete","description":"Emitted whenever a Channel is deleted.","memberof":"Client","meta":{"line":20,"file":"ChannelDelete.js","path":"src/client/websocket/packets/handlers"},"params":[{"name":"channel","description":"The channel that was deleted","type":{"types":[[["Channel",""]]]}}]},{"id":"Client#event:guildBanAdd","name":"guildBanAdd","description":"Emitted whenever a member is banned from a guild.","memberof":"Client","meta":{"line":22,"file":"GuildBanAdd.js","path":"src/client/websocket/packets/handlers"},"params":[{"name":"guild","description":"The guild that the ban occurred in","type":{"types":[[["Guild",""]]]}},{"name":"user","description":"The user that was banned","type":{"types":[[["User",""]]]}}]},{"id":"Client#event:guildBanRemove","name":"guildBanRemove","description":"Emitted whenever a member is unbanned from a guild.","memberof":"Client","meta":{"line":23,"file":"GuildBanRemove.js","path":"src/client/websocket/packets/handlers"},"params":[{"name":"guild","description":"The guild that the unban occurred in","type":{"types":[[["Guild",""]]]}},{"name":"user","description":"The user that was unbanned","type":{"types":[[["User",""]]]}}]},{"id":"Client#event:guildDelete","name":"guildDelete","description":"Emitted whenever a Guild is deleted/left.","memberof":"Client","meta":{"line":19,"file":"GuildDelete.js","path":"src/client/websocket/packets/handlers"},"params":[{"name":"guild","description":"The guild that was deleted","type":{"types":[[["Guild",""]]]}}]},{"id":"Client#event:guildMembersChunk","name":"guildMembersChunk","description":"Emitted whenever a chunk of Guild members is received","memberof":"Client","meta":{"line":25,"file":"GuildMembersChunk.js","path":"src/client/websocket/packets/handlers"},"params":[{"name":"guild","description":"The guild that the chunks relate to","type":{"types":[[["Guild",""]]]}},{"name":"members","description":"The members in the chunk","type":{"types":[[["Array",".<"],["GuildMember",">"]]]}}]},{"id":"Client#event:message","name":"message","description":"Emitted whenever a message is created","memberof":"Client","meta":{"line":19,"file":"MessageCreate.js","path":"src/client/websocket/packets/handlers"},"params":[{"name":"message","description":"The created message","type":{"types":[[["Message",""]]]}}]},{"id":"Client#event:messageDelete","name":"messageDelete","description":"Emitted whenever a message is deleted","memberof":"Client","meta":{"line":19,"file":"MessageDelete.js","path":"src/client/websocket/packets/handlers"},"params":[{"name":"message","description":"The deleted message","type":{"types":[[["Message",""]]]}}]},{"id":"Client#event:presenceUpdate","name":"presenceUpdate","description":"Emitted whenever a user changes one of their details or starts/stop playing a game","memberof":"Client","meta":{"line":66,"file":"PresenceUpdate.js","path":"src/client/websocket/packets/handlers"},"params":[{"name":"oldUser","description":"the user before the presence update","type":{"types":[[["User",""]]]}},{"name":"newUser","description":"the user after the presence update","type":{"types":[[["User",""]]]}}]},{"id":"Client#event:guildMemberAvailable","name":"guildMemberAvailable","description":"Emitted whenever a member becomes available in a large Guild","memberof":"Client","meta":{"line":74,"file":"PresenceUpdate.js","path":"src/client/websocket/packets/handlers"},"params":[{"name":"guild","description":"The guild that the member became available in","type":{"types":[[["Guild",""]]]}},{"name":"member","description":"the member that became available","type":{"types":[[["GuildMember",""]]]}}]},{"id":"Client#event:typingStart","name":"typingStart","description":"Emitted whenever a user starts typing in a channel","memberof":"Client","meta":{"line":52,"file":"TypingStart.js","path":"src/client/websocket/packets/handlers"},"params":[{"name":"channel","description":"the channel the user started typing in","type":{"types":[[["Channel",""]]]}},{"name":"user","description":"the user that started typing","type":{"types":[[["User",""]]]}}]},{"id":"Client#event:typingStop","name":"typingStop","description":"Emitted whenever a user stops typing in a channel","memberof":"Client","meta":{"line":60,"file":"TypingStart.js","path":"src/client/websocket/packets/handlers"},"params":[{"name":"channel","description":"the channel the user stopped typing in","type":{"types":[[["Channel",""]]]}},{"name":"user","description":"the user that stopped typing","type":{"types":[[["User",""]]]}}]},{"id":"Client#event:voiceStateUpdate","name":"voiceStateUpdate","description":"Emitted whenever a user changes voice state - e.g. joins/leaves a channel, mutes/unmutes.","memberof":"Client","meta":{"line":43,"file":"VoiceStateUpdate.js","path":"src/client/websocket/packets/handlers"},"params":[{"name":"oldMember","description":"the member before the voice state update","type":{"types":[[["GuildMember",""]]]}},{"name":"newMember","description":"the member before the voice state update","type":{"types":[[["GuildMember",""]]]}}]},{"id":"Client#event:ready","name":"ready","description":"Emitted when the Client becomes ready to start working","memberof":"Client","meta":{"line":189,"file":"WebSocketManager.js","path":"src/client/websocket"},"params":[]},{"id":"Client#event:reconnecting","name":"reconnecting","description":"Emitted when the Client tries to reconnect after being disconnected","memberof":"Client","meta":{"line":208,"file":"WebSocketManager.js","path":"src/client/websocket"},"params":[]},{"id":"Client#event:guildMemberRolesUpdate","name":"guildMemberRolesUpdate","description":"Emitted whenever a Guild Member's Roles change - i.e. new role or removed role","memberof":"Client","meta":{"line":104,"file":"Guild.js","path":"src/structures"},"params":[{"name":"guild","description":"the guild that the update affects","type":{"types":[[["Guild",""]]]}},{"name":"oldRoles","description":"the roles before the update","type":{"types":[[["Array",".<"],["Role",">"]]]}},{"name":"newRoles","description":"the roles after the update","type":{"types":[[["Guild",""]]]}}]}]},{"id":"VoiceConnection","name":"VoiceConnection","description":"Represents a connection to a Voice Channel in Discord","meta":{"line":10,"file":"VoiceConnection.js","path":"src/client/voice"},"extends":["EventEmitter"],"methods":[{"id":"VoiceConnection#disconnect","name":"disconnect","description":"Disconnects the Client from the Voice Channel","memberof":"VoiceConnection","meta":{"line":72,"file":"VoiceConnection.js","path":"src/client/voice"},"returns":{"types":[[["null",""]]]},"params":[{"name":"reason","description":"the reason of the disconnection","optional":true,"type":{"types":[[["string",""]]]}}]}],"properties":[{"id":"VoiceConnection#endpoint","name":"endpoint","description":"The endpoint of the connection","memberof":"VoiceConnection","type":{"types":[[["String",""]]]},"meta":{"line":23,"file":"VoiceConnection.js","path":"src/client/voice"},"props":[]},{"id":"VoiceConnection#channel","name":"channel","description":"The VoiceChannel for this connection","memberof":"VoiceConnection","type":{"types":[[["VoiceChannel",""]]]},"meta":{"line":28,"file":"VoiceConnection.js","path":"src/client/voice"},"props":[]},{"id":"VoiceConnection#ready","name":"ready","description":"Whether or not the connection is ready","memberof":"VoiceConnection","type":{"types":[[["Boolean",""]]]},"meta":{"line":39,"file":"VoiceConnection.js","path":"src/client/voice"},"props":[]}],"events":[]},{"id":"Channel","name":"Channel","description":"Represents any Channel on Discord","meta":{"line":4,"file":"Channel.js","path":"src/structures"},"methods":[{"id":"Channel#delete","name":"delete","description":"Deletes the channel","memberof":"Channel","examples":["// delete the channel\nchannel.delete()\n .then() // success\n .catch(console.log); // log error"],"meta":{"line":39,"file":"Channel.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Channel",">"]]]},"params":[]}],"properties":[{"id":"Channel#client","name":"client","description":"The client that instantiated the Channel","memberof":"Channel","type":{"types":[[["Client",""]]]},"meta":{"line":10,"file":"Channel.js","path":"src/structures"},"props":[]},{"id":"Channel#id","name":"id","description":"The unique ID of the channel","memberof":"Channel","type":{"types":[[["String",""]]]},"meta":{"line":27,"file":"Channel.js","path":"src/structures"},"props":[]}],"events":[]},{"id":"ClientUser","name":"ClientUser","description":"Represents the logged in client's Discord User","meta":{"line":7,"file":"ClientUser.js","path":"src/structures"},"extends":["User"],"methods":[{"id":"ClientUser#setUsername","name":"setUsername","description":"Set the username of the logged in Client.\nChanging usernames in Discord is heavily rate limited, with only 2 requests\nevery hour. Use this sparingly!","memberof":"ClientUser","examples":["// set username\nclient.user.setUsername('discordjs')\n .then(user => console.log(`My new username is ${user.username}`))\n .catch(console.log);"],"meta":{"line":34,"file":"ClientUser.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["ClientUser",">"]]]},"params":[{"name":"username","description":"the new username","type":{"types":[[["String",""]]]}}]},{"id":"ClientUser#setEmail","name":"setEmail","description":"If this user is a \"self bot\" or logged in using a normal user's details (which should be avoided), you can set the\nemail here.","memberof":"ClientUser","examples":["// set email\nclient.user.setEmail('bob@gmail.com')\n .then(user => console.log(`My new email is ${user.email}`))\n .catch(console.log);"],"meta":{"line":49,"file":"ClientUser.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["ClientUser",">"]]]},"params":[{"name":"email","description":"the new email","type":{"types":[[["String",""]]]}}]},{"id":"ClientUser#setPassword","name":"setPassword","description":"If this user is a \"self bot\" or logged in using a normal user's details (which should be avoided), you can set the\npassword here.","memberof":"ClientUser","examples":["// set password\nclient.user.setPassword('password')\n .then(user => console.log('New password set!'))\n .catch(console.log);"],"meta":{"line":64,"file":"ClientUser.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["ClientUser",">"]]]},"params":[{"name":"password","description":"the new password","type":{"types":[[["String",""]]]}}]},{"id":"ClientUser#setAvatar","name":"setAvatar","description":"Set the avatar of the logged in Client.","memberof":"ClientUser","examples":["// set avatar\nclient.user.setAvatar(fs.readFileSync('./avatar.png'))\n .then(user => console.log(`New avatar set!`))\n .catch(console.log);"],"meta":{"line":78,"file":"ClientUser.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["ClientUser",">"]]]},"params":[{"name":"avatar","description":"the new avatar","type":{"types":[[["Base64Resolvable",""]]]}}]},{"id":"ClientUser#setStatus","name":"setStatus","description":"Set the status and playing game of the logged in client.","memberof":"ClientUser","examples":["// set status\nclient.user.setStatus('status', 'game')\n .then(user => console.log('Changed status!'))\n .catch(console.log);"],"meta":{"line":93,"file":"ClientUser.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["ClientUser",", "],["Error",">"]]]},"params":[{"name":"status","description":"the status, can be `online` or `idle`.","optional":true,"type":{"types":[[["String",""]]]}},{"name":"game","description":"the game that is being played","optional":true,"type":{"types":[[["String",""]],[["Object",""]]]}}]},{"id":"ClientUser#toString","name":"toString","description":"When concatenated with a String, this automatically concatenates the User's mention instead of the User object.","memberof":"ClientUser","examples":["// logs: Hello from <@123456789>!\nconsole.log(`Hello from ${user}!`);"],"inherits":"User#toString","inherited":true,"meta":{"line":64,"file":"User.js","path":"src/structures"},"returns":{"types":[[["String",""]]]},"params":[]},{"id":"ClientUser#deleteDM","name":"deleteDM","description":"Deletes a DM Channel (if one exists) between the Client and the User. Resolves with the Channel if successful.","memberof":"ClientUser","inherits":"User#deleteDM","inherited":true,"meta":{"line":72,"file":"User.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["DMChannel",">"]]]},"params":[]},{"id":"ClientUser#equals","name":"equals","description":"Checks if the user is equal to another. It compares username, ID, discriminator, status and the game being played.\nIt is recommended to compare equality by using `user.id === user2.id` unless you want to compare all properties.","memberof":"ClientUser","inherits":"User#equals","inherited":true,"meta":{"line":82,"file":"User.js","path":"src/structures"},"returns":{"types":[[["Boolean",""]]]},"params":[{"name":"user","description":"the user to compare","type":{"types":[[["User",""]]]}}]},{"id":"ClientUser#sendMessage","name":"sendMessage","description":"Send a message to this channel","memberof":"ClientUser","examples":["// send a message\nchannel.sendMessage('hello!')\n .then(message => console.log(`Sent message: ${message.content}`))\n .catch(console.log);"],"inherits":"User#sendMessage","inherited":true,"meta":{"line":28,"file":"TextBasedChannel.js","path":"src/structures/interface"},"returns":{"types":[[["Promise",".<"],["Message",">"]]]},"params":[{"name":"content","description":"the content to send","type":{"types":[[["String",""]]]}},{"name":"options","description":"the options to provide","optional":true,"type":{"types":[[["MessageOptions",""]]]}}],"implements":["TextBasedChannel#sendMessage"]},{"id":"ClientUser#sendTTSMessage","name":"sendTTSMessage","description":"Send a text-to-speech message to this channel","memberof":"ClientUser","examples":["// send a TTS message\nchannel.sendTTSMessage('hello!')\n .then(message => console.log(`Sent tts message: ${message.content}`))\n .catch(console.log);"],"inherits":"User#sendTTSMessage","inherited":true,"meta":{"line":41,"file":"TextBasedChannel.js","path":"src/structures/interface"},"returns":{"types":[[["Promise",".<"],["Message",">"]]]},"params":[{"name":"content","description":"the content to send","type":{"types":[[["String",""]]]}}],"implements":["TextBasedChannel#sendTTSMessage"]}],"properties":[{"id":"ClientUser#verified","name":"verified","description":"Whether or not this account has been verified","memberof":"ClientUser","type":{"types":[[["Boolean",""]]]},"meta":{"line":14,"file":"ClientUser.js","path":"src/structures"},"props":[]},{"id":"ClientUser#email","name":"email","description":"The email of this account","memberof":"ClientUser","type":{"types":[[["String",""]]]},"meta":{"line":19,"file":"ClientUser.js","path":"src/structures"},"props":[]},{"id":"ClientUser#username","name":"username","description":"The username of the User","memberof":"ClientUser","type":{"types":[[["String",""]]]},"meta":{"line":20,"file":"User.js","path":"src/structures"},"props":[]},{"id":"ClientUser#id","name":"id","description":"The ID of the User","memberof":"ClientUser","type":{"types":[[["String",""]]]},"meta":{"line":25,"file":"User.js","path":"src/structures"},"props":[]},{"id":"ClientUser#discriminator","name":"discriminator","description":"A discriminator based on username for the User","memberof":"ClientUser","type":{"types":[[["String",""]]]},"meta":{"line":30,"file":"User.js","path":"src/structures"},"props":[]},{"id":"ClientUser#avatar","name":"avatar","description":"The ID of the user's avatar","memberof":"ClientUser","type":{"types":[[["String",""]]]},"meta":{"line":35,"file":"User.js","path":"src/structures"},"props":[]},{"id":"ClientUser#bot","name":"bot","description":"Whether or not the User is a Bot.","memberof":"ClientUser","type":{"types":[[["Boolean",""]]]},"meta":{"line":40,"file":"User.js","path":"src/structures"},"props":[]},{"id":"ClientUser#status","name":"status","description":"The status of the user:\n\n* **`online`** - user is online\n* **`offline`** - user is offline\n* **`idle`** - user is AFK","memberof":"ClientUser","type":{"types":[[["String",""]]]},"meta":{"line":49,"file":"User.js","path":"src/structures"},"props":[]},{"id":"ClientUser#game","name":"game","description":"The game that the user is playing, `null` if they aren't playing a game.","memberof":"ClientUser","type":{"types":[[["String",""]]]},"meta":{"line":54,"file":"User.js","path":"src/structures"},"props":[]}],"events":[]},{"id":"DMChannel","name":"DMChannel","description":"Represents a Direct Message Channel between two users.","meta":{"line":11,"file":"DMChannel.js","path":"src/structures"},"extends":["Channel"],"methods":[{"id":"DMChannel#toString","name":"toString","description":"When concatenated with a String, this automatically concatenates the recipient's mention instead of the\nDM channel object.","memberof":"DMChannel","meta":{"line":37,"file":"DMChannel.js","path":"src/structures"},"returns":{"types":[[["String",""]]]},"params":[]},{"id":"DMChannel#sendMessage","name":"sendMessage","description":"Send a message to this channel","memberof":"DMChannel","examples":["// send a message\nchannel.sendMessage('hello!')\n .then(message => console.log(`Sent message: ${message.content}`))\n .catch(console.log);"],"meta":{"line":28,"file":"TextBasedChannel.js","path":"src/structures/interface"},"returns":{"types":[[["Promise",".<"],["Message",">"]]]},"params":[{"name":"content","description":"the content to send","type":{"types":[[["String",""]]]}},{"name":"options","description":"the options to provide","optional":true,"type":{"types":[[["MessageOptions",""]]]}}],"implements":["TextBasedChannel#sendMessage"]},{"id":"DMChannel#sendTTSMessage","name":"sendTTSMessage","description":"Send a text-to-speech message to this channel","memberof":"DMChannel","examples":["// send a TTS message\nchannel.sendTTSMessage('hello!')\n .then(message => console.log(`Sent tts message: ${message.content}`))\n .catch(console.log);"],"meta":{"line":41,"file":"TextBasedChannel.js","path":"src/structures/interface"},"returns":{"types":[[["Promise",".<"],["Message",">"]]]},"params":[{"name":"content","description":"the content to send","type":{"types":[[["String",""]]]}}],"implements":["TextBasedChannel#sendTTSMessage"]},{"id":"DMChannel#getMessages","name":"getMessages","description":"Gets the past messages sent in this channel. Resolves with a Collection mapping message ID's to Message objects.","memberof":"DMChannel","examples":["// get messages\nchannel.getMessages({limit: 10})\n .then(messages => console.log(`Received ${messages.size} messages`))\n .catch(console.log);"],"meta":{"line":69,"file":"TextBasedChannel.js","path":"src/structures/interface"},"returns":{"types":[[["Promise",".<"],["Collection",".<"],["String",", "],["Message",">, "],["Error",">"]]]},"params":[{"name":"options","description":"the query parameters to pass in","optional":true,"type":{"types":[[["ChannelLogsQueryOptions",""]]]}}],"implements":["TextBasedChannel#getMessages"]},{"id":"DMChannel#delete","name":"delete","description":"Deletes the channel","memberof":"DMChannel","examples":["// delete the channel\nchannel.delete()\n .then() // success\n .catch(console.log); // log error"],"inherits":"Channel#delete","inherited":true,"meta":{"line":39,"file":"Channel.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Channel",">"]]]},"params":[]}],"properties":[{"id":"DMChannel#recipient","name":"recipient","description":"The recipient on the other end of the DM","memberof":"DMChannel","type":{"types":[[["User",""]]]},"meta":{"line":24,"file":"DMChannel.js","path":"src/structures"},"props":[]},{"id":"DMChannel#lastMessageID","name":"lastMessageID","description":"The ID of the last sent message, if available","memberof":"DMChannel","type":{"types":[[["String",""]]]},"meta":{"line":29,"file":"DMChannel.js","path":"src/structures"},"props":[]},{"id":"DMChannel#messages","name":"messages","description":"A Collection containing the messages sent to this channel.","memberof":"DMChannel","type":{"types":[[["Collection",".<"],["String",", "],["Message",">"]]]},"meta":{"line":15,"file":"TextBasedChannel.js","path":"src/structures/interface"},"props":[]},{"id":"DMChannel#client","name":"client","description":"The client that instantiated the Channel","memberof":"DMChannel","type":{"types":[[["Client",""]]]},"meta":{"line":10,"file":"Channel.js","path":"src/structures"},"props":[]},{"id":"DMChannel#id","name":"id","description":"The unique ID of the channel","memberof":"DMChannel","type":{"types":[[["String",""]]]},"meta":{"line":27,"file":"Channel.js","path":"src/structures"},"props":[]}],"events":[]},{"id":"GroupDMChannel","name":"GroupDMChannel","description":"Represents a Group DM on Discord","meta":{"line":48,"file":"GroupDMChannel.js","path":"src/structures"},"extends":["Channel"],"methods":[{"id":"GroupDMChannel#sendMessage","name":"sendMessage","description":"Send a message to this channel","memberof":"GroupDMChannel","examples":["// send a message\nchannel.sendMessage('hello!')\n .then(message => console.log(`Sent message: ${message.content}`))\n .catch(console.log);"],"meta":{"line":28,"file":"TextBasedChannel.js","path":"src/structures/interface"},"returns":{"types":[[["Promise",".<"],["Message",">"]]]},"params":[{"name":"content","description":"the content to send","type":{"types":[[["String",""]]]}},{"name":"options","description":"the options to provide","optional":true,"type":{"types":[[["MessageOptions",""]]]}}],"implements":["TextBasedChannel#sendMessage"]},{"id":"GroupDMChannel#sendTTSMessage","name":"sendTTSMessage","description":"Send a text-to-speech message to this channel","memberof":"GroupDMChannel","examples":["// send a TTS message\nchannel.sendTTSMessage('hello!')\n .then(message => console.log(`Sent tts message: ${message.content}`))\n .catch(console.log);"],"meta":{"line":41,"file":"TextBasedChannel.js","path":"src/structures/interface"},"returns":{"types":[[["Promise",".<"],["Message",">"]]]},"params":[{"name":"content","description":"the content to send","type":{"types":[[["String",""]]]}}],"implements":["TextBasedChannel#sendTTSMessage"]},{"id":"GroupDMChannel#getMessages","name":"getMessages","description":"Gets the past messages sent in this channel. Resolves with a Collection mapping message ID's to Message objects.","memberof":"GroupDMChannel","examples":["// get messages\nchannel.getMessages({limit: 10})\n .then(messages => console.log(`Received ${messages.size} messages`))\n .catch(console.log);"],"meta":{"line":69,"file":"TextBasedChannel.js","path":"src/structures/interface"},"returns":{"types":[[["Promise",".<"],["Collection",".<"],["String",", "],["Message",">, "],["Error",">"]]]},"params":[{"name":"options","description":"the query parameters to pass in","optional":true,"type":{"types":[[["ChannelLogsQueryOptions",""]]]}}],"implements":["TextBasedChannel#getMessages"]},{"id":"GroupDMChannel#delete","name":"delete","description":"Deletes the channel","memberof":"GroupDMChannel","examples":["// delete the channel\nchannel.delete()\n .then() // success\n .catch(console.log); // log error"],"inherits":"Channel#delete","inherited":true,"meta":{"line":39,"file":"Channel.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Channel",">"]]]},"params":[]}],"properties":[{"id":"GroupDMChannel#recipients","name":"recipients","description":"A collection of the recipients of this DM, mapped by their ID.","memberof":"GroupDMChannel","type":{"types":[[["Collection",".<"],["String",", "],["User",">"]]]},"meta":{"line":81,"file":"GroupDMChannel.js","path":"src/structures"},"props":[]},{"id":"GroupDMChannel#name","name":"name","description":"The name of this Group DM, can be null if one isn't set.","memberof":"GroupDMChannel","type":{"types":[[["String",""]]]},"meta":{"line":94,"file":"GroupDMChannel.js","path":"src/structures"},"props":[]},{"id":"GroupDMChannel#id","name":"id","description":"The ID of this Group DM Channel.","memberof":"GroupDMChannel","type":{"types":[[["String",""]]]},"meta":{"line":99,"file":"GroupDMChannel.js","path":"src/structures"},"props":[]},{"id":"GroupDMChannel#icon","name":"icon","description":"A hash of the Group DM icon.","memberof":"GroupDMChannel","type":{"types":[[["String",""]]]},"meta":{"line":104,"file":"GroupDMChannel.js","path":"src/structures"},"props":[]},{"id":"GroupDMChannel#lastMessageID","name":"lastMessageID","description":"The ID of the last message in the channel, if one was sent.","memberof":"GroupDMChannel","type":{"types":[[["String",""]]]},"meta":{"line":109,"file":"GroupDMChannel.js","path":"src/structures"},"props":[]},{"id":"GroupDMChannel#owner","name":"owner","description":"The owner of this Group DM.","memberof":"GroupDMChannel","type":{"types":[[["User",""]]]},"meta":{"line":114,"file":"GroupDMChannel.js","path":"src/structures"},"props":[]},{"id":"GroupDMChannel#messages","name":"messages","description":"A Collection containing the messages sent to this channel.","memberof":"GroupDMChannel","type":{"types":[[["Collection",".<"],["String",", "],["Message",">"]]]},"meta":{"line":15,"file":"TextBasedChannel.js","path":"src/structures/interface"},"props":[]},{"id":"GroupDMChannel#client","name":"client","description":"The client that instantiated the Channel","memberof":"GroupDMChannel","type":{"types":[[["Client",""]]]},"meta":{"line":10,"file":"Channel.js","path":"src/structures"},"props":[]}],"events":[]},{"id":"Guild","name":"Guild","description":"Represents a Guild (or a Server) on Discord.","meta":{"line":25,"file":"Guild.js","path":"src/structures"},"methods":[{"id":"Guild#toString","name":"toString","description":"When concatenated with a String, this automatically concatenates the Guild's name instead of the Guild object.","memberof":"Guild","examples":["// logs: Hello from My Guild!\nconsole.log(`Hello from ${guild}!`);","// logs: Hello from My Guild!\nconsole.log(`Hello from ' + guild + '!');"],"meta":{"line":130,"file":"Guild.js","path":"src/structures"},"returns":{"types":[[["String",""]]]},"params":[]},{"id":"Guild#kick","name":"kick","description":"Tries to kick a member from the guild.","memberof":"Guild","examples":["// kicks a member from a guild:\nguild.kick(message.author)\n .then(member => console.log(`Kicked ${member}`))\n .catch(error => console.log(error));"],"meta":{"line":144,"file":"Guild.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["GuildMember",", "],["Error",">"]]]},"params":[{"name":"member","description":"the member to kick","type":{"types":[[["GuildMemberResolvable",""]]]}}]},{"id":"Guild#member","name":"member","description":"Returns the GuildMember form of a User object, if the User is present in the guild.","memberof":"Guild","examples":["// get the guild member of a user\nconst member = guild.member(message.author);"],"meta":{"line":156,"file":"Guild.js","path":"src/structures"},"returns":{"types":[[["GuildMember",""]],[["null",""]]]},"params":[{"name":"user","description":"the user that you want to obtain the GuildMember of.","type":{"types":[[["UserResolvable",""]]]}}]},{"id":"Guild#equals","name":"equals","description":"Whether this Guild equals another Guild. It compares all properties, so for most operations\nit is advisable to just compare `guild.id === guild2.id` as it is much faster and is often\nwhat most users need.","memberof":"Guild","meta":{"line":167,"file":"Guild.js","path":"src/structures"},"returns":{"types":[[["Boolean",""]]]},"params":[{"name":"guild","description":"the guild to compare","type":{"types":[[["Guild",""]]]}}]},{"id":"Guild#createChannel","name":"createChannel","description":"Creates a new Channel in the Guild.","memberof":"Guild","examples":["// create a new text channel\nguild.createChannel('new general', 'text')\n .then(channel => console.log(`Created new channel ${channel}`))\n .catch(console.log);"],"meta":{"line":345,"file":"Guild.js","path":"src/structures"},"returns":{"types":[[["Promise",".<("],["TextChannel","|"],["VoiceChannel","), "],["Error",">"]]]},"params":[{"name":"name","description":"the name of the new channel.","type":{"types":[[["String",""]]]}},{"name":"type","description":"the type of the new channel, either `text` or `voice`.","type":{"types":[[["String",""]]]}}]},{"id":"Guild#createRole","name":"createRole","description":"Creates a new role in the guild, as of now this is just a blank role.","memberof":"Guild","examples":["// create a new role\nguild.createRole()\n .then(role => console.log(`Created role ${role}`))\n .catch(console.log);"],"meta":{"line":358,"file":"Guild.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Role",", "],["Error",">"]]]},"params":[]},{"id":"Guild#leave","name":"leave","description":"Causes the Client to leave the guild.","memberof":"Guild","examples":["// leave a guild\nguild.leave()\n .then(g => console.log(`Left the guild ${g}`))\n .catch(console.log);"],"meta":{"line":371,"file":"Guild.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Guild",", "],["Error",">"]]]},"params":[]},{"id":"Guild#delete","name":"delete","description":"Causes the Client to delete the guild.","memberof":"Guild","examples":["// delete a guild\nguild.delete()\n .then(g => console.log(`Deleted the guild ${g}`))\n .catch(console.log);"],"meta":{"line":384,"file":"Guild.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Guild",", "],["Error",">"]]]},"params":[]},{"id":"Guild#edit","name":"edit","description":"Updates the Guild with new information - e.g. a new name.","memberof":"Guild","examples":["// set the guild name and region\nguild.edit({\n name: 'Discord Guild',\n region: 'london',\n})\n.then(updated => console.log(`New guild name ${updated.name} in region ${updated.region}`))\n.catch(console.log);"],"meta":{"line":401,"file":"Guild.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Guild",", "],["Error",">"]]]},"params":[{"name":"data","description":"the data to update the guild with.","type":{"types":[[["GuildEditData",""]]]}}]},{"id":"Guild#setName","name":"setName","description":"Edit the name of the Guild.","memberof":"Guild","examples":["// edit the guild name\nguild.setName('Discord Guild')\n .then(updated => console.log(`Updated guild name to ${guild.name}`))\n .catch(console.log);"],"meta":{"line":415,"file":"Guild.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Guild",", "],["Error",">"]]]},"params":[{"name":"name","description":"the new name of the Guild.","type":{"types":[[["String",""]]]}}]},{"id":"Guild#setRegion","name":"setRegion","description":"Edit the region of the Guild.","memberof":"Guild","examples":["// edit the guild region\nguild.setRegion('london')\n .then(updated => console.log(`Updated guild region to ${guild.region}`))\n .catch(console.log);"],"meta":{"line":429,"file":"Guild.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Guild",", "],["Error",">"]]]},"params":[{"name":"region","description":"the new region of the guild.","type":{"types":[[["Region",""]]]}}]},{"id":"Guild#setVerificationLevel","name":"setVerificationLevel","description":"Edit the verification level of the Guild.","memberof":"Guild","examples":["// edit the guild verification level\nguild.setVerificationLevel(1)\n .then(updated => console.log(`Updated guild verification level to ${guild.verificationLevel}`))\n .catch(console.log);"],"meta":{"line":443,"file":"Guild.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Guild",", "],["Error",">"]]]},"params":[{"name":"verificationLevel","description":"the new verification level of the guild.","type":{"types":[[["VerificationLevel",""]]]}}]},{"id":"Guild#setAFKChannel","name":"setAFKChannel","description":"Edit the AFK channel of the Guild.","memberof":"Guild","examples":["// edit the guild AFK channel\nguild.setAFKChannel(channel)\n .then(updated => console.log(`Updated guild AFK channel to ${guild.afkChannel}`))\n .catch(console.log);"],"meta":{"line":457,"file":"Guild.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Guild",", "],["Error",">"]]]},"params":[{"name":"afkChannel","description":"the new AFK channel.","type":{"types":[[["GuildChannelResolvable",""]]]}}]},{"id":"Guild#setAFKTimeout","name":"setAFKTimeout","description":"Edit the AFK timeout of the Guild.","memberof":"Guild","examples":["// edit the guild AFK channel\nguild.setAFKTimeout(60)\n .then(updated => console.log(`Updated guild AFK timeout to ${guild.afkTimeout}`))\n .catch(console.log);"],"meta":{"line":471,"file":"Guild.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Guild",", "],["Error",">"]]]},"params":[{"name":"afkTimeout","description":"the time in seconds that a user must be idle to be considered AFK.","type":{"types":[[["Number",""]]]}}]},{"id":"Guild#setIcon","name":"setIcon","description":"Set a new Guild Icon.","memberof":"Guild","examples":["// edit the guild icon\nguild.setIcon(fs.readFileSync('./icon.png'))\n .then(updated => console.log('Updated the guild icon'))\n .catch(console.log);"],"meta":{"line":485,"file":"Guild.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Guild",", "],["Error",">"]]]},"params":[{"name":"icon","description":"the new icon of the guild.","type":{"types":[[["Base64Resolvable",""]]]}}]},{"id":"Guild#setOwner","name":"setOwner","description":"Sets a new owner of the Guild.","memberof":"Guild","examples":["// edit the guild owner\nguild.setOwner(guilds.members[0])\n .then(updated => console.log(`Updated the guild owner to ${updated.owner.username}`))\n .catch(console.log);"],"meta":{"line":499,"file":"Guild.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Guild",", "],["Error",">"]]]},"params":[{"name":"owner","description":"the new owner of the Guild.","type":{"types":[[["GuildMemberResolvable",""]]]}}]},{"id":"Guild#setSplash","name":"setSplash","description":"Set a new Guild Splash Logo.","memberof":"Guild","examples":["// edit the guild splash\nguild.setIcon(fs.readFileSync('./splash.png'))\n .then(updated => console.log('Updated the guild splash'))\n .catch(console.log);"],"meta":{"line":513,"file":"Guild.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Guild",", "],["Error",">"]]]},"params":[{"name":"splash","description":"the new splash screen of the guild.","type":{"types":[[["Base64Resolvable",""]]]}}]}],"properties":[{"id":"Guild#client","name":"client","description":"The Client that created the instance of the the Guild.","memberof":"Guild","type":{"types":[[["Client",""]]]},"meta":{"line":31,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#members","name":"members","description":"A Collection of members that are in this Guild. The key is the member's ID, the value is the member.","memberof":"Guild","type":{"types":[[["Collection",".<"],["String",", "],["GuildMember",">"]]]},"meta":{"line":37,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#channels","name":"channels","description":"A Collection of channels that are in this Guild. The key is the channel's ID, the value is the channel.","memberof":"Guild","type":{"types":[[["Collection",".<"],["String",", "],["GuildChannel",">"]]]},"meta":{"line":43,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#roles","name":"roles","description":"A Collection of roles that are in this Guild. The key is the role's ID, the value is the role.","memberof":"Guild","type":{"types":[[["Collection",".<"],["String",", "],["Role",">"]]]},"meta":{"line":49,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#available","name":"available","description":"Whether the Guild is available to access. If it is not available, it indicates a server outage.","memberof":"Guild","type":{"types":[[["Boolean",""]]]},"meta":{"line":60,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#id","name":"id","description":"The Unique ID of the Guild, useful for comparisons.","memberof":"Guild","type":{"types":[[["String",""]]]},"meta":{"line":65,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#splash","name":"splash","description":"The hash of the guild splash image, or null if no splash (VIP only)","memberof":"Guild","type":{"types":[[["String",""]]]},"meta":{"line":208,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#region","name":"region","description":"The region the guild is located in","memberof":"Guild","type":{"types":[[["String",""]]]},"meta":{"line":213,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#name","name":"name","description":"The name of the guild","memberof":"Guild","type":{"types":[[["String",""]]]},"meta":{"line":218,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#memberCount","name":"memberCount","description":"The amount of initial members in the guild.","memberof":"Guild","type":{"types":[[["Number",""]]]},"meta":{"line":223,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#large","name":"large","description":"Whether the guild is \"large\" (has more than 250 members)","memberof":"Guild","type":{"types":[[["Boolean",""]]]},"meta":{"line":228,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#joinDate","name":"joinDate","description":"The date at which the logged-in client joined the guild.","memberof":"Guild","type":{"types":[[["Date",""]]]},"meta":{"line":233,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#icon","name":"icon","description":"The hash of the guild icon, or null if there is no icon.","memberof":"Guild","type":{"types":[[["String",""]]]},"meta":{"line":238,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#features","name":"features","description":"An array of guild features.","memberof":"Guild","type":{"types":[[["Array",".<"],["Object",">"]]]},"meta":{"line":243,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#emojis","name":"emojis","description":"An array of guild emojis.","memberof":"Guild","type":{"types":[[["Array",".<"],["Object",">"]]]},"meta":{"line":248,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#afkTimeout","name":"afkTimeout","description":"The time in seconds before a user is counted as \"away from keyboard\".","memberof":"Guild","type":{"types":[[["Number",""]]]},"meta":{"line":253,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#afkChannelID","name":"afkChannelID","description":"The ID of the voice channel where AFK members are moved.","memberof":"Guild","type":{"types":[[["String",""]]]},"meta":{"line":258,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#embedEnabled","name":"embedEnabled","description":"Whether embedded images are enabled on this guild.","memberof":"Guild","type":{"types":[[["Boolean",""]]]},"meta":{"line":263,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#verificationLevel","name":"verificationLevel","description":"The verification level of the guild.","memberof":"Guild","type":{"types":[[["Number",""]]]},"meta":{"line":268,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#owner","name":"owner","description":"The owner of the guild","memberof":"Guild","type":{"types":[[["User",""]]]},"meta":{"line":282,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#embedChannel","name":"embedChannel","description":"The embed channel of the Guild.","memberof":"Guild","type":{"types":[[["GuildChannel",""]]]},"meta":{"line":295,"file":"Guild.js","path":"src/structures"},"props":[]}],"events":[]},{"id":"GuildChannel","name":"GuildChannel","description":"Represents a Guild Channel (i.e. Text Channels and Voice Channels)","meta":{"line":27,"file":"GuildChannel.js","path":"src/structures"},"extends":["Channel"],"methods":[{"id":"GuildChannel#equals","name":"equals","description":"Checks if this channel has the same type, topic, position, name, overwrites and ID as another channel.\nIn most cases, a simple `channel.id === channel2.id` will do, and is much faster too.","memberof":"GuildChannel","meta":{"line":73,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["Boolean",""]]]},"params":[{"name":"channel","description":"the channel to compare this channel to","type":{"types":[[["GuildChannel",""]]]}}]},{"id":"GuildChannel#permissionsFor","name":"permissionsFor","description":"Gets the overall set of permissions for a user in this channel, taking into account roles and permission\noverwrites.","memberof":"GuildChannel","meta":{"line":105,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["EvaluatedPermissions",""]]]},"params":[{"name":"member","description":"the user that you want to obtain the overall permissions for","type":{"types":[[["GuildMemberResolvable",""]]]}}]},{"id":"GuildChannel#overwritePermissions","name":"overwritePermissions","description":"Overwrites the permissions for a user or role in this channel.","memberof":"GuildChannel","examples":["// overwrite permissions for a message author\nmessage.channel.overwritePermissions(message.author, {\n SEND_MESSAGES: false\n})\n.then(() => console.log('Done!'))\n.catch(console.log);"],"meta":{"line":185,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["null",", "],["Error",">"]]]},"params":[{"name":"userOrRole","description":"the user or role to update","type":{"types":[[["Role",""]],[["UserResolvable",""]]]}},{"name":"config","description":"the configuration for the update","type":{"types":[[["PermissionOverwriteOptions",""]]]}}]},{"id":"GuildChannel#setName","name":"setName","description":"Set a new name for the Guild Channel","memberof":"GuildChannel","examples":["// set a new channel name\nchannel.setName('not general')\n .then(newChannel => console.log(`Channel's new name is ${newChannel.name}`))\n .catch(console.log);"],"meta":{"line":237,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["GuildChannel",">"]]]},"params":[{"name":"name","description":"the new name for the guild channel","type":{"types":[[["String",""]]]}}]},{"id":"GuildChannel#setPosition","name":"setPosition","description":"Set a new position for the Guild Channel","memberof":"GuildChannel","examples":["// set a new channel position\nchannel.setPosition(2)\n .then(newChannel => console.log(`Channel's new position is ${newChannel.position}`))\n .catch(console.log);"],"meta":{"line":251,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["GuildChannel",">"]]]},"params":[{"name":"position","description":"the new position for the guild channel","type":{"types":[[["Number",""]]]}}]},{"id":"GuildChannel#setTopic","name":"setTopic","description":"Set a new topic for the Guild Channel","memberof":"GuildChannel","examples":["// set a new channel topic\nchannel.setTopic('needs more rate limiting')\n .then(newChannel => console.log(`Channel's new topic is ${newChannel.topic}`))\n .catch(console.log);"],"meta":{"line":265,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["GuildChannel",">"]]]},"params":[{"name":"topic","description":"the new topic for the guild channel","type":{"types":[[["String",""]]]}}]},{"id":"GuildChannel#toString","name":"toString","description":"When concatenated with a String, this automatically concatenates the Channel's name instead of the Channel object.","memberof":"GuildChannel","examples":["// Outputs: Hello from general\nconsole.log(`Hello from ${channel}`);","// Outputs: Hello from general\nconsole.log('Hello from ' + ${channel});"],"meta":{"line":279,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["String",""]]]},"params":[]},{"id":"GuildChannel#delete","name":"delete","description":"Deletes the channel","memberof":"GuildChannel","examples":["// delete the channel\nchannel.delete()\n .then() // success\n .catch(console.log); // log error"],"inherits":"Channel#delete","inherited":true,"meta":{"line":39,"file":"Channel.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Channel",">"]]]},"params":[]}],"properties":[{"id":"GuildChannel#type","name":"type","description":"The type of the Guild Channel","memberof":"GuildChannel","type":{"types":[[["Number",""]]]},"meta":{"line":38,"file":"GuildChannel.js","path":"src/structures"},"props":[]},{"id":"GuildChannel#topic","name":"topic","description":"The topic of the Guild Channel, if there is one.","memberof":"GuildChannel","type":{"types":[[["String",""]]]},"meta":{"line":43,"file":"GuildChannel.js","path":"src/structures"},"props":[]},{"id":"GuildChannel#position","name":"position","description":"The position of the channel in the list.","memberof":"GuildChannel","type":{"types":[[["Number",""]]]},"meta":{"line":48,"file":"GuildChannel.js","path":"src/structures"},"props":[]},{"id":"GuildChannel#name","name":"name","description":"The name of the Guild Channel","memberof":"GuildChannel","type":{"types":[[["String",""]]]},"meta":{"line":53,"file":"GuildChannel.js","path":"src/structures"},"props":[]},{"id":"GuildChannel#permissionOverwrites","name":"permissionOverwrites","description":"A map of permission overwrites in this channel for roles and users.","memberof":"GuildChannel","type":{"types":[[["Collection",".<"],["String",", "],["PermissionOverwrites",">"]]]},"meta":{"line":59,"file":"GuildChannel.js","path":"src/structures"},"props":[]},{"id":"GuildChannel#client","name":"client","description":"The client that instantiated the Channel","memberof":"GuildChannel","type":{"types":[[["Client",""]]]},"meta":{"line":10,"file":"Channel.js","path":"src/structures"},"props":[]},{"id":"GuildChannel#id","name":"id","description":"The unique ID of the channel","memberof":"GuildChannel","type":{"types":[[["String",""]]]},"meta":{"line":27,"file":"Channel.js","path":"src/structures"},"props":[]}],"events":[]},{"id":"GuildMember","name":"GuildMember","description":"Represents a Member of a Guild on Discord","meta":{"line":7,"file":"GuildMember.js","path":"src/structures"},"methods":[{"id":"GuildMember#deleteDM","name":"deleteDM","description":"Deletes any DM's with this Guild Member","memberof":"GuildMember","meta":{"line":133,"file":"GuildMember.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["DMChannel",">"]]]},"params":[]},{"id":"GuildMember#kick","name":"kick","description":"Kick this member from the Guild","memberof":"GuildMember","meta":{"line":141,"file":"GuildMember.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["GuildMember",">"]]]},"params":[]},{"id":"GuildMember#sendMessage","name":"sendMessage","description":"Send a message to this channel","memberof":"GuildMember","examples":["// send a message\nchannel.sendMessage('hello!')\n .then(message => console.log(`Sent message: ${message.content}`))\n .catch(console.log);"],"meta":{"line":28,"file":"TextBasedChannel.js","path":"src/structures/interface"},"returns":{"types":[[["Promise",".<"],["Message",">"]]]},"params":[{"name":"content","description":"the content to send","type":{"types":[[["String",""]]]}},{"name":"options","description":"the options to provide","optional":true,"type":{"types":[[["MessageOptions",""]]]}}],"implements":["TextBasedChannel#sendMessage"]},{"id":"GuildMember#sendTTSMessage","name":"sendTTSMessage","description":"Send a text-to-speech message to this channel","memberof":"GuildMember","examples":["// send a TTS message\nchannel.sendTTSMessage('hello!')\n .then(message => console.log(`Sent tts message: ${message.content}`))\n .catch(console.log);"],"meta":{"line":41,"file":"TextBasedChannel.js","path":"src/structures/interface"},"returns":{"types":[[["Promise",".<"],["Message",">"]]]},"params":[{"name":"content","description":"the content to send","type":{"types":[[["String",""]]]}}],"implements":["TextBasedChannel#sendTTSMessage"]}],"properties":[{"id":"GuildMember#client","name":"client","description":"The client that instantiated this GuildMember","memberof":"GuildMember","type":{"types":[[["Client",""]]]},"meta":{"line":13,"file":"GuildMember.js","path":"src/structures"},"props":[]},{"id":"GuildMember#guild","name":"guild","description":"The guild that this member is part of","memberof":"GuildMember","type":{"types":[[["Guild",""]]]},"meta":{"line":18,"file":"GuildMember.js","path":"src/structures"},"props":[]},{"id":"GuildMember#user","name":"user","description":"The user that this guild member instance Represents","memberof":"GuildMember","type":{"types":[[["User",""]]]},"meta":{"line":23,"file":"GuildMember.js","path":"src/structures"},"props":[]},{"id":"GuildMember#serverDeaf","name":"serverDeaf","description":"Whether this member is deafened server-wide","memberof":"GuildMember","type":{"types":[[["Boolean",""]]]},"meta":{"line":36,"file":"GuildMember.js","path":"src/structures"},"props":[]},{"id":"GuildMember#serverMute","name":"serverMute","description":"Whether this member is muted server-wide","memberof":"GuildMember","type":{"types":[[["Boolean",""]]]},"meta":{"line":41,"file":"GuildMember.js","path":"src/structures"},"props":[]},{"id":"GuildMember#selfMute","name":"selfMute","description":"Whether this member is self-muted","memberof":"GuildMember","type":{"types":[[["Boolean",""]]]},"meta":{"line":46,"file":"GuildMember.js","path":"src/structures"},"props":[]},{"id":"GuildMember#selfDeaf","name":"selfDeaf","description":"Whether this member is self-deafened","memberof":"GuildMember","type":{"types":[[["Boolean",""]]]},"meta":{"line":51,"file":"GuildMember.js","path":"src/structures"},"props":[]},{"id":"GuildMember#voiceSessionID","name":"voiceSessionID","description":"The voice session ID of this member, if any","memberof":"GuildMember","type":{"types":[[["String",""]]]},"meta":{"line":56,"file":"GuildMember.js","path":"src/structures"},"props":[]},{"id":"GuildMember#voiceChannelID","name":"voiceChannelID","description":"The voice channel ID of this member, if any","memberof":"GuildMember","type":{"types":[[["String",""]]]},"meta":{"line":61,"file":"GuildMember.js","path":"src/structures"},"props":[]},{"id":"GuildMember#joinDate","name":"joinDate","description":"The date this member joined the guild","memberof":"GuildMember","type":{"types":[[["Date",""]]]},"meta":{"line":66,"file":"GuildMember.js","path":"src/structures"},"props":[]},{"id":"GuildMember#roles","name":"roles","description":"A list of roles that are applied to this GuildMember","memberof":"GuildMember","type":{"types":[[["Array",".<"],["Role",">"]]]},"meta":{"line":75,"file":"GuildMember.js","path":"src/structures"},"props":[]},{"id":"GuildMember#mute","name":"mute","description":"Whether this member is muted in any way","memberof":"GuildMember","type":{"types":[[["Boolean",""]]]},"meta":{"line":98,"file":"GuildMember.js","path":"src/structures"},"props":[]},{"id":"GuildMember#deaf","name":"deaf","description":"Whether this member is deafened in any way","memberof":"GuildMember","type":{"types":[[["Boolean",""]]]},"meta":{"line":107,"file":"GuildMember.js","path":"src/structures"},"props":[]},{"id":"GuildMember#voiceChannel","name":"voiceChannel","description":"The voice channel this member is in, if any","memberof":"GuildMember","type":{"types":[[["VoiceChannel",""]]]},"meta":{"line":116,"file":"GuildMember.js","path":"src/structures"},"props":[]},{"id":"GuildMember#id","name":"id","description":"The ID of this User","memberof":"GuildMember","type":{"types":[[["String",""]]]},"meta":{"line":125,"file":"GuildMember.js","path":"src/structures"},"props":[]}],"events":[]},{"id":"Message","name":"Message","description":"Represents a Message on Discord","meta":{"line":5,"file":"Message.js","path":"src/structures"},"methods":[{"id":"Message#equals","name":"equals","description":"Used mainly internally. Whether two messages are identical in properties. If you want to compare messages\nwithout checking all the properties, use `message.id === message2.id`, which is much more efficient. This\nmethod allows you to see if there are differences in content, embeds, attachments, nonce and tts properties.","memberof":"Message","meta":{"line":196,"file":"Message.js","path":"src/structures"},"returns":{"types":[[["Boolean",""]]]},"params":[{"name":"message","description":"The message to compare it to","type":{"types":[[["Message",""]]]}},{"name":"rawData","description":"Raw data passed through the WebSocket about this message","type":{"types":[[["Object",""]]]}}]},{"id":"Message#delete","name":"delete","description":"Deletes the message","memberof":"Message","examples":["// delete a message\nmessage.delete()\n .then(msg => console.log(`Deleted message from ${msg.author}`))\n .catch(console.log);"],"meta":{"line":230,"file":"Message.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Message",", "],["Error",">"]]]},"params":[]},{"id":"Message#edit","name":"edit","description":"Edit the content of a message","memberof":"Message","examples":["// update the content of a message\nmessage.edit('This is my new content!')\n .then(msg => console.log(`Updated the content of a message from ${msg.author}`))\n .catch(console.log);"],"meta":{"line":244,"file":"Message.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Message",", "],["Error",">"]]]},"params":[{"name":"content","description":"the new content of a message","type":{"types":[[["String",""]]]}}]},{"id":"Message#reply","name":"reply","description":"Reply to a message","memberof":"Message","examples":["// reply to a message\nmessage.reply('Hey, I'm a reply!')\n .then(msg => console.log(`Sent a reply to ${msg.author}`))\n .catch(console.log);"],"meta":{"line":259,"file":"Message.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Message",", "],["Error",">"]]]},"params":[{"name":"content","description":"the content of the message","type":{"types":[[["String",""]]]}},{"name":"options","description":"the options to provide","optional":true,"type":{"types":[[["MessageOptions",""]]]}}]}],"properties":[{"id":"Message#channel","name":"channel","description":"The channel that the message was sent in","memberof":"Message","type":{"types":[[["Channel",""]]]},"meta":{"line":11,"file":"Message.js","path":"src/structures"},"props":[]},{"id":"Message#guild","name":"guild","description":"If the message was sent in a guild, this will be the guild the message was sent in","memberof":"Message","type":{"types":[[["Guild",""]]]},"meta":{"line":18,"file":"Message.js","path":"src/structures"},"props":[]},{"id":"Message#client","name":"client","description":"The client that instantiated the Message","memberof":"Message","type":{"types":[[["Client",""]]]},"meta":{"line":25,"file":"Message.js","path":"src/structures"},"props":[]},{"id":"Message#pinned","name":"pinned","description":"Whether or not this message is pinned","memberof":"Message","type":{"types":[[["Boolean",""]]]},"meta":{"line":36,"file":"Message.js","path":"src/structures"},"props":[]},{"id":"Message#author","name":"author","description":"The author of the message","memberof":"Message","type":{"types":[[["User",""]]]},"meta":{"line":41,"file":"Message.js","path":"src/structures"},"props":[]},{"id":"Message#content","name":"content","description":"The content of the message","memberof":"Message","type":{"types":[[["String",""]]]},"meta":{"line":46,"file":"Message.js","path":"src/structures"},"props":[]},{"id":"Message#timestamp","name":"timestamp","description":"When the message was sent","memberof":"Message","type":{"types":[[["Date",""]]]},"meta":{"line":51,"file":"Message.js","path":"src/structures"},"props":[]},{"id":"Message#editedTimestamp","name":"editedTimestamp","description":"If the message was edited, the timestamp at which it was last edited","memberof":"Message","type":{"types":[[["Date",""]]]},"meta":{"line":56,"file":"Message.js","path":"src/structures"},"props":[]},{"id":"Message#tts","name":"tts","description":"Whether or not the message was Text-To-Speech","memberof":"Message","type":{"types":[[["Boolean",""]]]},"meta":{"line":61,"file":"Message.js","path":"src/structures"},"props":[]},{"id":"Message#mentionEveryone","name":"mentionEveryone","description":"Whether the message mentioned @everyone or not","memberof":"Message","type":{"types":[[["Boolean",""]]]},"meta":{"line":66,"file":"Message.js","path":"src/structures"},"props":[]},{"id":"Message#nonce","name":"nonce","description":"A random number used for checking message delivery","memberof":"Message","type":{"types":[[["String",""]]]},"meta":{"line":71,"file":"Message.js","path":"src/structures"},"props":[]},{"id":"Message#embeds","name":"embeds","description":"A list of embeds in the message - e.g. YouTube Player","memberof":"Message","type":{"types":[[["Array",".<"],["Object",">"]]]},"meta":{"line":76,"file":"Message.js","path":"src/structures"},"props":[]},{"id":"Message#attachments","name":"attachments","description":"A list of attachments in the message - e.g. Pictures","memberof":"Message","type":{"types":[[["Array",".<"],["Object",">"]]]},"meta":{"line":81,"file":"Message.js","path":"src/structures"},"props":[]},{"id":"Message#mentions","name":"mentions","description":"An object containing a further users, roles or channels collections","memberof":"Message","type":{"types":[[["Object",""]]]},"meta":{"line":90,"file":"Message.js","path":"src/structures"},"props":[{"name":"mentions.users","description":"Mentioned users, maps their ID to the user object.","type":{"types":[[["Collection",".<"],["String",", "],["User",">"]]]}},{"name":"mentions.roles","description":"Mentioned roles, maps their ID to the role object.","type":{"types":[[["Collection",".<"],["String",", "],["Role",">"]]]}},{"name":"mentions.channels","description":"Mentioned channels, maps their ID to the channel object.","type":{"types":[[["Collection",".<"],["String",", "],["GuildChannel",">"]]]}}]},{"id":"Message#id","name":"id","description":"The ID of the message (unique in the channel it was sent)","memberof":"Message","type":{"types":[[["String",""]]]},"meta":{"line":99,"file":"Message.js","path":"src/structures"},"props":[]}],"events":[]},{"id":"PermissionOverwrites","name":"PermissionOverwrites","description":"Represents a permission overwrite for a Role or Member in a Guild Channel.","meta":{"line":4,"file":"PermissionOverwrites.js","path":"src/structures"},"methods":[],"properties":[{"id":"PermissionOverwrites#channel","name":"channel","description":"The GuildChannel this overwrite is for","memberof":"PermissionOverwrites","type":{"types":[[["GuildChannel",""]]]},"meta":{"line":10,"file":"PermissionOverwrites.js","path":"src/structures"},"props":[]},{"id":"PermissionOverwrites#type","name":"type","description":"The type of this overwrite","memberof":"PermissionOverwrites","type":{"types":[[["String",""]]]},"meta":{"line":21,"file":"PermissionOverwrites.js","path":"src/structures"},"props":[]},{"id":"PermissionOverwrites#id","name":"id","description":"The ID of this overwrite, either a User ID or a Role ID","memberof":"PermissionOverwrites","type":{"types":[[["String",""]]]},"meta":{"line":26,"file":"PermissionOverwrites.js","path":"src/structures"},"props":[]}],"events":[]},{"id":"Role","name":"Role","description":"Represents a Role on Discord","meta":{"line":6,"file":"Role.js","path":"src/structures"},"methods":[{"id":"Role#delete","name":"delete","description":"Deletes the role","memberof":"Role","examples":["// delete a role\nrole.delete()\n .then(r => console.log(`Deleted role ${r}`))\n .catch(console.log);"],"meta":{"line":82,"file":"Role.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Role",", "],["Error",">"]]]},"params":[]},{"id":"Role#edit","name":"edit","description":"Edits the role","memberof":"Role","examples":["// edit a role\nrole.edit({name: 'new role'})\n .then(r => console.log(`Edited role ${r}`))\n .catch(console.log);"],"meta":{"line":96,"file":"Role.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Role",", "],["Error",">"]]]},"params":[{"name":"data","description":"the new data for the role","type":{"types":[[["RoleData",""]]]}}]},{"id":"Role#setName","name":"setName","description":"Set a new name for the role","memberof":"Role","examples":["// set the name of the role\nrole.setName('new role')\n .then(r => console.log(`Edited name of role ${r}`))\n .catch(console.log);"],"meta":{"line":110,"file":"Role.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Role",", "],["Error",">"]]]},"params":[{"name":"name","description":"the new name of the role","type":{"types":[[["String",""]]]}}]},{"id":"Role#setColor","name":"setColor","description":"Set a new color for the role","memberof":"Role","examples":["// set the color of a role\nrole.setColor(parseInt('FF0000', 16))\n .then(r => console.log(`Set color of role ${r}`))\n .catch(console.log);"],"meta":{"line":124,"file":"Role.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Role",", "],["Error",">"]]]},"params":[{"name":"color","description":"the new color for the role","type":{"types":[[["Number",""]]]}}]},{"id":"Role#setHoist","name":"setHoist","description":"Set whether or not the role should be hoisted","memberof":"Role","examples":["// set the hoist of the role\nrole.setHoist(true)\n .then(r => console.log(`Role hoisted: ${r.hoist}`))\n .catch(console.log);"],"meta":{"line":138,"file":"Role.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Role",", "],["Error",">"]]]},"params":[{"name":"hoist","description":"whether or not to hoist the role","type":{"types":[[["Boolean",""]]]}}]},{"id":"Role#setPosition","name":"setPosition","description":"Set the position of the role","memberof":"Role","examples":["// set the position of the role\nrole.setPosition(1)\n .then(r => console.log(`Role position: ${r.position}`))\n .catch(console.log);"],"meta":{"line":152,"file":"Role.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Role",", "],["Error",">"]]]},"params":[{"name":"position","description":"the position of the role","type":{"types":[[["Number",""]]]}}]},{"id":"Role#setPermissions","name":"setPermissions","description":"Set the permissions of the role","memberof":"Role","examples":["// set the permissions of the role\nrole.setPermissions(['KICK_MEMBERS', 'BAN_MEMBERS'])\n .then(r => console.log(`Role updated ${r}`))\n .catch(console.log);"],"meta":{"line":166,"file":"Role.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Role",", "],["Error",">"]]]},"params":[{"name":"permissions","description":"the permissions of the role","type":{"types":[[["Array",".<"],["String",">"]]]}}]},{"id":"Role#serialize","name":"serialize","description":"Get an object mapping permission names to whether or not the role enables that permission","memberof":"Role","examples":["// print the serialized role\nconsole.log(role.serialize());"],"meta":{"line":177,"file":"Role.js","path":"src/structures"},"returns":{"types":[[["Object",".<"],["String",", "],["Boolean",">"]]]},"params":[]},{"id":"Role#hasPermission","name":"hasPermission","description":"Whether or not the role includes the given permission","memberof":"Role","examples":["// see if a role can ban a member\nif (role.hasPermission('BAN_MEMBERS')) {\n console.log('This role can ban members');\n} else {\n console.log('This role can\\'t ban members');\n}"],"meta":{"line":199,"file":"Role.js","path":"src/structures"},"returns":{"types":[[["Boolean",""]]]},"params":[{"name":"permission","description":"the name of the permission to test","type":{"types":[[["String",""]]]}},{"name":"explicit","description":"whether or not the inclusion of the permission is explicit","optional":true,"type":{"types":[[["Boolean",""]]]}}]},{"id":"Role#toString","name":"toString","description":"When concatenated with a String, this automatically concatenates the Role mention rather than the Role object.","memberof":"Role","meta":{"line":221,"file":"Role.js","path":"src/structures"},"returns":{"types":[[["String",""]]]},"params":[]}],"properties":[{"id":"Role#guild","name":"guild","description":"The guild that the role belongs to","memberof":"Role","type":{"types":[[["Guild",""]]]},"meta":{"line":12,"file":"Role.js","path":"src/structures"},"props":[]},{"id":"Role#client","name":"client","description":"The client that instantiated the role","memberof":"Role","type":{"types":[[["Client",""]]]},"meta":{"line":17,"file":"Role.js","path":"src/structures"},"props":[]},{"id":"Role#id","name":"id","description":"The ID of the role (unique to the guild it is part of)","memberof":"Role","type":{"types":[[["String",""]]]},"meta":{"line":40,"file":"Role.js","path":"src/structures"},"props":[]},{"id":"Role#name","name":"name","description":"The name of the role","memberof":"Role","type":{"types":[[["String",""]]]},"meta":{"line":45,"file":"Role.js","path":"src/structures"},"props":[]},{"id":"Role#color","name":"color","description":"The base 10 color of the role","memberof":"Role","type":{"types":[[["Number",""]]]},"meta":{"line":50,"file":"Role.js","path":"src/structures"},"props":[]},{"id":"Role#hoist","name":"hoist","description":"If true, users that are part of this role will appear in a separate category in the users list","memberof":"Role","type":{"types":[[["Boolean",""]]]},"meta":{"line":55,"file":"Role.js","path":"src/structures"},"props":[]},{"id":"Role#position","name":"position","description":"The position of the role in the role manager","memberof":"Role","type":{"types":[[["Number",""]]]},"meta":{"line":60,"file":"Role.js","path":"src/structures"},"props":[]},{"id":"Role#permissions","name":"permissions","description":"The evaluated permissions number","memberof":"Role","type":{"types":[[["Number",""]]]},"meta":{"line":65,"file":"Role.js","path":"src/structures"},"props":[]},{"id":"Role#managed","name":"managed","description":"Whether or not the role is managed by an external service","memberof":"Role","type":{"types":[[["Boolean",""]]]},"meta":{"line":70,"file":"Role.js","path":"src/structures"},"props":[]}],"events":[]},{"id":"TextChannel","name":"TextChannel","description":"Represents a Server Text Channel on Discord.","meta":{"line":10,"file":"TextChannel.js","path":"src/structures"},"extends":["GuildChannel"],"methods":[{"id":"TextChannel#sendMessage","name":"sendMessage","description":"Send a message to this channel","memberof":"TextChannel","examples":["// send a message\nchannel.sendMessage('hello!')\n .then(message => console.log(`Sent message: ${message.content}`))\n .catch(console.log);"],"meta":{"line":28,"file":"TextBasedChannel.js","path":"src/structures/interface"},"returns":{"types":[[["Promise",".<"],["Message",">"]]]},"params":[{"name":"content","description":"the content to send","type":{"types":[[["String",""]]]}},{"name":"options","description":"the options to provide","optional":true,"type":{"types":[[["MessageOptions",""]]]}}],"implements":["TextBasedChannel#sendMessage"]},{"id":"TextChannel#sendTTSMessage","name":"sendTTSMessage","description":"Send a text-to-speech message to this channel","memberof":"TextChannel","examples":["// send a TTS message\nchannel.sendTTSMessage('hello!')\n .then(message => console.log(`Sent tts message: ${message.content}`))\n .catch(console.log);"],"meta":{"line":41,"file":"TextBasedChannel.js","path":"src/structures/interface"},"returns":{"types":[[["Promise",".<"],["Message",">"]]]},"params":[{"name":"content","description":"the content to send","type":{"types":[[["String",""]]]}}],"implements":["TextBasedChannel#sendTTSMessage"]},{"id":"TextChannel#getMessages","name":"getMessages","description":"Gets the past messages sent in this channel. Resolves with a Collection mapping message ID's to Message objects.","memberof":"TextChannel","examples":["// get messages\nchannel.getMessages({limit: 10})\n .then(messages => console.log(`Received ${messages.size} messages`))\n .catch(console.log);"],"meta":{"line":69,"file":"TextBasedChannel.js","path":"src/structures/interface"},"returns":{"types":[[["Promise",".<"],["Collection",".<"],["String",", "],["Message",">, "],["Error",">"]]]},"params":[{"name":"options","description":"the query parameters to pass in","optional":true,"type":{"types":[[["ChannelLogsQueryOptions",""]]]}}],"implements":["TextBasedChannel#getMessages"]},{"id":"TextChannel#equals","name":"equals","description":"Checks if this channel has the same type, topic, position, name, overwrites and ID as another channel.\nIn most cases, a simple `channel.id === channel2.id` will do, and is much faster too.","memberof":"TextChannel","inherits":"GuildChannel#equals","inherited":true,"meta":{"line":73,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["Boolean",""]]]},"params":[{"name":"channel","description":"the channel to compare this channel to","type":{"types":[[["GuildChannel",""]]]}}]},{"id":"TextChannel#permissionsFor","name":"permissionsFor","description":"Gets the overall set of permissions for a user in this channel, taking into account roles and permission\noverwrites.","memberof":"TextChannel","inherits":"GuildChannel#permissionsFor","inherited":true,"meta":{"line":105,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["EvaluatedPermissions",""]]]},"params":[{"name":"member","description":"the user that you want to obtain the overall permissions for","type":{"types":[[["GuildMemberResolvable",""]]]}}]},{"id":"TextChannel#overwritePermissions","name":"overwritePermissions","description":"Overwrites the permissions for a user or role in this channel.","memberof":"TextChannel","examples":["// overwrite permissions for a message author\nmessage.channel.overwritePermissions(message.author, {\n SEND_MESSAGES: false\n})\n.then(() => console.log('Done!'))\n.catch(console.log);"],"inherits":"GuildChannel#overwritePermissions","inherited":true,"meta":{"line":185,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["null",", "],["Error",">"]]]},"params":[{"name":"userOrRole","description":"the user or role to update","type":{"types":[[["Role",""]],[["UserResolvable",""]]]}},{"name":"config","description":"the configuration for the update","type":{"types":[[["PermissionOverwriteOptions",""]]]}}]},{"id":"TextChannel#setName","name":"setName","description":"Set a new name for the Guild Channel","memberof":"TextChannel","examples":["// set a new channel name\nchannel.setName('not general')\n .then(newChannel => console.log(`Channel's new name is ${newChannel.name}`))\n .catch(console.log);"],"inherits":"GuildChannel#setName","inherited":true,"meta":{"line":237,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["GuildChannel",">"]]]},"params":[{"name":"name","description":"the new name for the guild channel","type":{"types":[[["String",""]]]}}]},{"id":"TextChannel#setPosition","name":"setPosition","description":"Set a new position for the Guild Channel","memberof":"TextChannel","examples":["// set a new channel position\nchannel.setPosition(2)\n .then(newChannel => console.log(`Channel's new position is ${newChannel.position}`))\n .catch(console.log);"],"inherits":"GuildChannel#setPosition","inherited":true,"meta":{"line":251,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["GuildChannel",">"]]]},"params":[{"name":"position","description":"the new position for the guild channel","type":{"types":[[["Number",""]]]}}]},{"id":"TextChannel#setTopic","name":"setTopic","description":"Set a new topic for the Guild Channel","memberof":"TextChannel","examples":["// set a new channel topic\nchannel.setTopic('needs more rate limiting')\n .then(newChannel => console.log(`Channel's new topic is ${newChannel.topic}`))\n .catch(console.log);"],"inherits":"GuildChannel#setTopic","inherited":true,"meta":{"line":265,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["GuildChannel",">"]]]},"params":[{"name":"topic","description":"the new topic for the guild channel","type":{"types":[[["String",""]]]}}]},{"id":"TextChannel#toString","name":"toString","description":"When concatenated with a String, this automatically concatenates the Channel's name instead of the Channel object.","memberof":"TextChannel","examples":["// Outputs: Hello from general\nconsole.log(`Hello from ${channel}`);","// Outputs: Hello from general\nconsole.log('Hello from ' + ${channel});"],"inherits":"GuildChannel#toString","inherited":true,"meta":{"line":279,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["String",""]]]},"params":[]}],"properties":[{"id":"TextChannel#lastMessageID","name":"lastMessageID","description":"The ID of the last message in the channel, if one was sent.","memberof":"TextChannel","type":{"types":[[["String",""]]]},"meta":{"line":23,"file":"TextChannel.js","path":"src/structures"},"props":[]},{"id":"TextChannel#messages","name":"messages","description":"A Collection containing the messages sent to this channel.","memberof":"TextChannel","type":{"types":[[["Collection",".<"],["String",", "],["Message",">"]]]},"meta":{"line":15,"file":"TextBasedChannel.js","path":"src/structures/interface"},"props":[]},{"id":"TextChannel#type","name":"type","description":"The type of the Guild Channel","memberof":"TextChannel","type":{"types":[[["Number",""]]]},"meta":{"line":38,"file":"GuildChannel.js","path":"src/structures"},"props":[]},{"id":"TextChannel#topic","name":"topic","description":"The topic of the Guild Channel, if there is one.","memberof":"TextChannel","type":{"types":[[["String",""]]]},"meta":{"line":43,"file":"GuildChannel.js","path":"src/structures"},"props":[]},{"id":"TextChannel#position","name":"position","description":"The position of the channel in the list.","memberof":"TextChannel","type":{"types":[[["Number",""]]]},"meta":{"line":48,"file":"GuildChannel.js","path":"src/structures"},"props":[]},{"id":"TextChannel#name","name":"name","description":"The name of the Guild Channel","memberof":"TextChannel","type":{"types":[[["String",""]]]},"meta":{"line":53,"file":"GuildChannel.js","path":"src/structures"},"props":[]},{"id":"TextChannel#permissionOverwrites","name":"permissionOverwrites","description":"A map of permission overwrites in this channel for roles and users.","memberof":"TextChannel","type":{"types":[[["Collection",".<"],["String",", "],["PermissionOverwrites",">"]]]},"meta":{"line":59,"file":"GuildChannel.js","path":"src/structures"},"props":[]}],"events":[]},{"id":"User","name":"User","description":"Represents a User on Discord.","meta":{"line":7,"file":"User.js","path":"src/structures"},"methods":[{"id":"User#toString","name":"toString","description":"When concatenated with a String, this automatically concatenates the User's mention instead of the User object.","memberof":"User","examples":["// logs: Hello from <@123456789>!\nconsole.log(`Hello from ${user}!`);"],"meta":{"line":64,"file":"User.js","path":"src/structures"},"returns":{"types":[[["String",""]]]},"params":[]},{"id":"User#deleteDM","name":"deleteDM","description":"Deletes a DM Channel (if one exists) between the Client and the User. Resolves with the Channel if successful.","memberof":"User","meta":{"line":72,"file":"User.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["DMChannel",">"]]]},"params":[]},{"id":"User#equals","name":"equals","description":"Checks if the user is equal to another. It compares username, ID, discriminator, status and the game being played.\nIt is recommended to compare equality by using `user.id === user2.id` unless you want to compare all properties.","memberof":"User","meta":{"line":82,"file":"User.js","path":"src/structures"},"returns":{"types":[[["Boolean",""]]]},"params":[{"name":"user","description":"the user to compare","type":{"types":[[["User",""]]]}}]},{"id":"User#sendMessage","name":"sendMessage","description":"Send a message to this channel","memberof":"User","examples":["// send a message\nchannel.sendMessage('hello!')\n .then(message => console.log(`Sent message: ${message.content}`))\n .catch(console.log);"],"meta":{"line":28,"file":"TextBasedChannel.js","path":"src/structures/interface"},"returns":{"types":[[["Promise",".<"],["Message",">"]]]},"params":[{"name":"content","description":"the content to send","type":{"types":[[["String",""]]]}},{"name":"options","description":"the options to provide","optional":true,"type":{"types":[[["MessageOptions",""]]]}}],"implements":["TextBasedChannel#sendMessage"]},{"id":"User#sendTTSMessage","name":"sendTTSMessage","description":"Send a text-to-speech message to this channel","memberof":"User","examples":["// send a TTS message\nchannel.sendTTSMessage('hello!')\n .then(message => console.log(`Sent tts message: ${message.content}`))\n .catch(console.log);"],"meta":{"line":41,"file":"TextBasedChannel.js","path":"src/structures/interface"},"returns":{"types":[[["Promise",".<"],["Message",">"]]]},"params":[{"name":"content","description":"the content to send","type":{"types":[[["String",""]]]}}],"implements":["TextBasedChannel#sendTTSMessage"]}],"properties":[{"id":"User#username","name":"username","description":"The username of the User","memberof":"User","type":{"types":[[["String",""]]]},"meta":{"line":20,"file":"User.js","path":"src/structures"},"props":[]},{"id":"User#id","name":"id","description":"The ID of the User","memberof":"User","type":{"types":[[["String",""]]]},"meta":{"line":25,"file":"User.js","path":"src/structures"},"props":[]},{"id":"User#discriminator","name":"discriminator","description":"A discriminator based on username for the User","memberof":"User","type":{"types":[[["String",""]]]},"meta":{"line":30,"file":"User.js","path":"src/structures"},"props":[]},{"id":"User#avatar","name":"avatar","description":"The ID of the user's avatar","memberof":"User","type":{"types":[[["String",""]]]},"meta":{"line":35,"file":"User.js","path":"src/structures"},"props":[]},{"id":"User#bot","name":"bot","description":"Whether or not the User is a Bot.","memberof":"User","type":{"types":[[["Boolean",""]]]},"meta":{"line":40,"file":"User.js","path":"src/structures"},"props":[]},{"id":"User#status","name":"status","description":"The status of the user:\n\n* **`online`** - user is online\n* **`offline`** - user is offline\n* **`idle`** - user is AFK","memberof":"User","type":{"types":[[["String",""]]]},"meta":{"line":49,"file":"User.js","path":"src/structures"},"props":[]},{"id":"User#game","name":"game","description":"The game that the user is playing, `null` if they aren't playing a game.","memberof":"User","type":{"types":[[["String",""]]]},"meta":{"line":54,"file":"User.js","path":"src/structures"},"props":[]}],"events":[]},{"id":"VoiceChannel","name":"VoiceChannel","description":"Represents a Server Voice Channel on Discord.","meta":{"line":8,"file":"VoiceChannel.js","path":"src/structures"},"extends":["GuildChannel"],"methods":[{"id":"VoiceChannel#setBitrate","name":"setBitrate","description":"Sets the bitrate of the channel","memberof":"VoiceChannel","examples":["// set the bitrate of a voice channel\nvoiceChannel.setBitrate(48000)\n .then(vc => console.log(`Set bitrate to ${vc.bitrate} for ${vc.name}`))\n .catch(console.log);"],"meta":{"line":42,"file":"VoiceChannel.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["VoiceChannel",">"]]]},"params":[{"name":"bitrate","description":"the new bitrate","type":{"types":[[["Number",""]]]}}]},{"id":"VoiceChannel#join","name":"join","description":"Attempts to join this Voice Channel","memberof":"VoiceChannel","examples":["// join a voice channel\nvoiceChannel.join()\n .then(connection => console.log('Connected!'))\n .catch(console.log);"],"meta":{"line":55,"file":"VoiceChannel.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["VoiceConnection",", "],["Error",">"]]]},"params":[]},{"id":"VoiceChannel#equals","name":"equals","description":"Checks if this channel has the same type, topic, position, name, overwrites and ID as another channel.\nIn most cases, a simple `channel.id === channel2.id` will do, and is much faster too.","memberof":"VoiceChannel","inherits":"GuildChannel#equals","inherited":true,"meta":{"line":73,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["Boolean",""]]]},"params":[{"name":"channel","description":"the channel to compare this channel to","type":{"types":[[["GuildChannel",""]]]}}]},{"id":"VoiceChannel#permissionsFor","name":"permissionsFor","description":"Gets the overall set of permissions for a user in this channel, taking into account roles and permission\noverwrites.","memberof":"VoiceChannel","inherits":"GuildChannel#permissionsFor","inherited":true,"meta":{"line":105,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["EvaluatedPermissions",""]]]},"params":[{"name":"member","description":"the user that you want to obtain the overall permissions for","type":{"types":[[["GuildMemberResolvable",""]]]}}]},{"id":"VoiceChannel#overwritePermissions","name":"overwritePermissions","description":"Overwrites the permissions for a user or role in this channel.","memberof":"VoiceChannel","examples":["// overwrite permissions for a message author\nmessage.channel.overwritePermissions(message.author, {\n SEND_MESSAGES: false\n})\n.then(() => console.log('Done!'))\n.catch(console.log);"],"inherits":"GuildChannel#overwritePermissions","inherited":true,"meta":{"line":185,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["null",", "],["Error",">"]]]},"params":[{"name":"userOrRole","description":"the user or role to update","type":{"types":[[["Role",""]],[["UserResolvable",""]]]}},{"name":"config","description":"the configuration for the update","type":{"types":[[["PermissionOverwriteOptions",""]]]}}]},{"id":"VoiceChannel#setName","name":"setName","description":"Set a new name for the Guild Channel","memberof":"VoiceChannel","examples":["// set a new channel name\nchannel.setName('not general')\n .then(newChannel => console.log(`Channel's new name is ${newChannel.name}`))\n .catch(console.log);"],"inherits":"GuildChannel#setName","inherited":true,"meta":{"line":237,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["GuildChannel",">"]]]},"params":[{"name":"name","description":"the new name for the guild channel","type":{"types":[[["String",""]]]}}]},{"id":"VoiceChannel#setPosition","name":"setPosition","description":"Set a new position for the Guild Channel","memberof":"VoiceChannel","examples":["// set a new channel position\nchannel.setPosition(2)\n .then(newChannel => console.log(`Channel's new position is ${newChannel.position}`))\n .catch(console.log);"],"inherits":"GuildChannel#setPosition","inherited":true,"meta":{"line":251,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["GuildChannel",">"]]]},"params":[{"name":"position","description":"the new position for the guild channel","type":{"types":[[["Number",""]]]}}]},{"id":"VoiceChannel#setTopic","name":"setTopic","description":"Set a new topic for the Guild Channel","memberof":"VoiceChannel","examples":["// set a new channel topic\nchannel.setTopic('needs more rate limiting')\n .then(newChannel => console.log(`Channel's new topic is ${newChannel.topic}`))\n .catch(console.log);"],"inherits":"GuildChannel#setTopic","inherited":true,"meta":{"line":265,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["GuildChannel",">"]]]},"params":[{"name":"topic","description":"the new topic for the guild channel","type":{"types":[[["String",""]]]}}]},{"id":"VoiceChannel#toString","name":"toString","description":"When concatenated with a String, this automatically concatenates the Channel's name instead of the Channel object.","memberof":"VoiceChannel","examples":["// Outputs: Hello from general\nconsole.log(`Hello from ${channel}`);","// Outputs: Hello from general\nconsole.log('Hello from ' + ${channel});"],"inherits":"GuildChannel#toString","inherited":true,"meta":{"line":279,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["String",""]]]},"params":[]}],"properties":[{"id":"VoiceChannel#members","name":"members","description":"The members in this Voice Channel.","memberof":"VoiceChannel","type":{"types":[[["Collection",".<"],["String",", "],["GuildMember",">"]]]},"meta":{"line":15,"file":"VoiceChannel.js","path":"src/structures"},"props":[]},{"id":"VoiceChannel#bitrate","name":"bitrate","description":"The bitrate of this voice channel","memberof":"VoiceChannel","type":{"types":[[["Number",""]]]},"meta":{"line":24,"file":"VoiceChannel.js","path":"src/structures"},"props":[]},{"id":"VoiceChannel#userLimit","name":"userLimit","description":"The maximum amount of users allowed in this channel - 0 means unlimited.","memberof":"VoiceChannel","type":{"types":[[["Number",""]]]},"meta":{"line":29,"file":"VoiceChannel.js","path":"src/structures"},"props":[]},{"id":"VoiceChannel#type","name":"type","description":"The type of the Guild Channel","memberof":"VoiceChannel","type":{"types":[[["Number",""]]]},"meta":{"line":38,"file":"GuildChannel.js","path":"src/structures"},"props":[]},{"id":"VoiceChannel#topic","name":"topic","description":"The topic of the Guild Channel, if there is one.","memberof":"VoiceChannel","type":{"types":[[["String",""]]]},"meta":{"line":43,"file":"GuildChannel.js","path":"src/structures"},"props":[]},{"id":"VoiceChannel#position","name":"position","description":"The position of the channel in the list.","memberof":"VoiceChannel","type":{"types":[[["Number",""]]]},"meta":{"line":48,"file":"GuildChannel.js","path":"src/structures"},"props":[]},{"id":"VoiceChannel#name","name":"name","description":"The name of the Guild Channel","memberof":"VoiceChannel","type":{"types":[[["String",""]]]},"meta":{"line":53,"file":"GuildChannel.js","path":"src/structures"},"props":[]},{"id":"VoiceChannel#permissionOverwrites","name":"permissionOverwrites","description":"A map of permission overwrites in this channel for roles and users.","memberof":"VoiceChannel","type":{"types":[[["Collection",".<"],["String",", "],["PermissionOverwrites",">"]]]},"meta":{"line":59,"file":"GuildChannel.js","path":"src/structures"},"props":[]}],"events":[]},{"id":"Collection","name":"Collection","description":"A utility class to help make it easier to access the data stores","meta":{"line":5,"file":"Collection.js","path":"src/util"},"extends":["Map"],"methods":[{"id":"Collection#array","name":"array","description":"Returns an ordered array of the values of this collection.","memberof":"Collection","examples":["// identical to:\nArray.from(collection.values());"],"meta":{"line":14,"file":"Collection.js","path":"src/util"},"returns":{"types":[[["Array",""]]]},"params":[]},{"id":"Collection#first","name":"first","description":"Returns the first item in this collection.","memberof":"Collection","examples":["// identical to:\nArray.from(collection.values())[0];"],"meta":{"line":25,"file":"Collection.js","path":"src/util"},"returns":{"types":[[["Object",""]]]},"params":[]},{"id":"Collection#last","name":"last","description":"Returns the last item in this collection.","memberof":"Collection","meta":{"line":33,"file":"Collection.js","path":"src/util"},"returns":{"types":[[["Object",""]]]},"params":[]},{"id":"Collection#random","name":"random","description":"Returns a random item from this collection.","memberof":"Collection","meta":{"line":42,"file":"Collection.js","path":"src/util"},"returns":{"types":[[["Object",""]]]},"params":[]},{"id":"Collection#findAll","name":"findAll","description":"Returns an array of items where `item[key] === value` of the collection","memberof":"Collection","examples":["collection.getAll('username', 'Bob');"],"meta":{"line":64,"file":"Collection.js","path":"src/util"},"returns":{"types":[[["Array",".<"],["Object",">"]]]},"params":[{"name":"key","description":"the key to filter by","type":{"types":[[["String",""]]]}},{"name":"value","description":"the expected value","type":{"types":[[["any",""]]]}}]},{"id":"Collection#find","name":"find","description":"Returns a single item where `item[key] === value`","memberof":"Collection","examples":["collection.get('id', '123123...');"],"meta":{"line":82,"file":"Collection.js","path":"src/util"},"returns":{"types":[[["Object",""]]]},"params":[{"name":"key","description":"the key to filter by","type":{"types":[[["String",""]]]}},{"name":"value","description":"the expected value","type":{"types":[[["any",""]]]}}]},{"id":"Collection#exists","name":"exists","description":"Returns true if the collection has an item where `item[key] === value`","memberof":"Collection","examples":["if (collection.exists('id', '123123...')) {\n console.log('user here!');\n}"],"meta":{"line":101,"file":"Collection.js","path":"src/util"},"returns":{"types":[[["Object",""]]]},"params":[{"name":"key","description":"the key to filter by","type":{"types":[[["String",""]]]}},{"name":"value","description":"the expected value","type":{"types":[[["any",""]]]}}]}],"properties":[{"id":"Collection#length","name":"length","description":"The length (size) of this collection.","memberof":"Collection","type":{"types":[[["Number",""]]]},"meta":{"line":52,"file":"Collection.js","path":"src/util"},"props":[]}],"events":[]}],"interfaces":[{"id":"TextBasedChannel","name":"TextBasedChannel","description":"Interface for classes that have text-channel-like features","meta":{"line":8,"file":"TextBasedChannel.js","path":"src/structures/interface"},"methods":[{"id":"TextBasedChannel#sendMessage","name":"sendMessage","description":"Send a message to this channel","memberof":"TextBasedChannel","examples":["// send a message\nchannel.sendMessage('hello!')\n .then(message => console.log(`Sent message: ${message.content}`))\n .catch(console.log);"],"meta":{"line":28,"file":"TextBasedChannel.js","path":"src/structures/interface"},"returns":{"types":[[["Promise",".<"],["Message",">"]]]},"params":[{"name":"content","description":"the content to send","type":{"types":[[["String",""]]]}},{"name":"options","description":"the options to provide","optional":true,"type":{"types":[[["MessageOptions",""]]]}}]},{"id":"TextBasedChannel#sendTTSMessage","name":"sendTTSMessage","description":"Send a text-to-speech message to this channel","memberof":"TextBasedChannel","examples":["// send a TTS message\nchannel.sendTTSMessage('hello!')\n .then(message => console.log(`Sent tts message: ${message.content}`))\n .catch(console.log);"],"meta":{"line":41,"file":"TextBasedChannel.js","path":"src/structures/interface"},"returns":{"types":[[["Promise",".<"],["Message",">"]]]},"params":[{"name":"content","description":"the content to send","type":{"types":[[["String",""]]]}}]},{"id":"TextBasedChannel#getMessages","name":"getMessages","description":"Gets the past messages sent in this channel. Resolves with a Collection mapping message ID's to Message objects.","memberof":"TextBasedChannel","examples":["// get messages\nchannel.getMessages({limit: 10})\n .then(messages => console.log(`Received ${messages.size} messages`))\n .catch(console.log);"],"meta":{"line":69,"file":"TextBasedChannel.js","path":"src/structures/interface"},"returns":{"types":[[["Promise",".<"],["Collection",".<"],["String",", "],["Message",">, "],["Error",">"]]]},"params":[{"name":"options","description":"the query parameters to pass in","optional":true,"type":{"types":[[["ChannelLogsQueryOptions",""]]]}}]}],"properties":[{"id":"TextBasedChannel#messages","name":"messages","description":"A Collection containing the messages sent to this channel.","memberof":"TextBasedChannel","type":{"types":[[["Collection",".<"],["String",", "],["Message",">"]]]},"meta":{"line":15,"file":"TextBasedChannel.js","path":"src/structures/interface"},"props":[]}],"events":[]}],"typedefs":[{"id":"UserResolvable","name":"UserResolvable","description":"Data that resolves to give a User object. This can be:\n* A User object\n* A User ID\n* A Message (resolves to the message author)\n* A Guild (owner of the guild)","type":{"types":[[["User",""]],[["String",""]],[["Message",""]],[["Guild",""]]]},"meta":{"line":23,"file":"ClientDataResolver.js","path":"src/client"}},{"id":"GuildResolvable","name":"GuildResolvable","description":"Data that resolves to give a Guild object. This can be:\n* A Guild object","type":{"types":[[["Guild",""]]]},"meta":{"line":51,"file":"ClientDataResolver.js","path":"src/client"}},{"id":"GuildMemberResolvable","name":"GuildMemberResolvable","description":"Data that resolves to give a GuildMember object. This can be:\n* A GuildMember object\n* A User object","type":{"types":[[["Guild",""]]]},"meta":{"line":69,"file":"ClientDataResolver.js","path":"src/client"}},{"id":"Base64Resolvable","name":"Base64Resolvable","description":"Data that resolves to give a Base64 string, typically for image uploading. This can be:\n* A Buffer\n* A Base64 String","type":{"types":[[["Buffer",""]],[["String",""]]]},"meta":{"line":98,"file":"ClientDataResolver.js","path":"src/client"}},{"id":"ChannelResolvable","name":"ChannelResolvable","description":"Data that can be resolved to give a Channel. This can be:\n* An instance of a Channel\n* An ID of a Channel","type":{"types":[[["Channel",""]],[["String",""]]]},"meta":{"line":118,"file":"ClientDataResolver.js","path":"src/client"}},{"id":"StringResolvable","name":"StringResolvable","description":"Data that can be resolved to give a String. This can be:\n* A String\n* An Array (joined with a new line delimiter to give a string)\n* Any object","type":{"types":[[["String",""]],[["Array",""]],[["Object",""]]]},"meta":{"line":142,"file":"ClientDataResolver.js","path":"src/client"}},{"id":"PermissionOverwriteOptions","name":"PermissionOverwriteOptions","description":"An object mapping permission flags to `true` (enabled) or `false` (disabled)\n```js\n{\n 'SEND_MESSAGES': true,\n 'ATTACH_FILES': false,\n}\n```","type":{"types":[[["Object",""]]]},"meta":{"line":161,"file":"GuildChannel.js","path":"src/structures"}},{"id":"ChannelLogsQueryOptions","name":"ChannelLogsQueryOptions","description":"The parameters to pass in when requesting previous messages from a channel. `around`, `before` and\n`after` are mutually exclusive. All the parameters are optional.\n```js\n{\n limit: 30, // the message limit, defaults to 50\n before: '123', // gets messages before the given message ID\n after: '123', // gets messages after the given message ID\n around: '123', // gets messages around the given message ID\n}\n```","type":{"types":[[["Object",""]]]},"meta":{"line":45,"file":"TextBasedChannel.js","path":"src/structures/interface"}},{"id":"ClientOptions","name":"ClientOptions","description":"Options that can be passed to a client:\n```js\n{\n ws: {\n large_threshold: 250,\n compress: true,\n properties: {\n $os: process ? process.platform : 'discord.js',\n $browser: 'discord.js',\n $device: 'discord.js',\n $referrer: '',\n $referring_domain: '',\n },\n },\n protocol_version: 6,\n max_message_cache: 200,\n rest_ws_bridge_timeout: 5000,\n api_request_method: 'sequential',\n shard_id: 0,\n shard_count: 0,\n};\n```","type":{"types":[[["Object",""]]]},"meta":{"line":1,"file":"Constants.js","path":"src/util"}}],"custom":{"general":[{"category":"general","name":"Getting Started","data":"# Welcome!\ndiscord.js is an easy-to-use and intuitive JavaScript library that wraps around the Discord API.\n\n## Installation\nTo install discord.js from npm:\n```bash\nnpm i --save discord.js\n```\n\nTo install discord.js from the master branch:\n```bash\nnpm i --save hydrabolt/discord.js\n```\n\nTo install discord.js from the development branch:\n```bash\nnpm i --save hydrabolt/discord.js#indev\n```\n\nTo install discord.js from the rewrite branch:\n```bash\nnpm i --save hydrabolt/discord.js#indev-rewrite\n```\n\n## Tutorials\nLuckyEvie, a helper in the discord.js channel, has put together a great tutorial on getting to grips with discord.js.\nIt's worth a read and you can find it [here.](https://eslachance.gitbooks.io/discord-js-bot-guide/content/samples/selfbots,_the_awesomest_thing_in_the_universe.html)\n"}],"examples":[{"category":"examples","name":"Ping Pong","data":"```js\n/*\n A ping pong bot, whenever you send \"ping\", it replies \"pong\".\n*/\n\n// import the discord.js module\nconst Discord = require('discord.js');\n\n// create an instance of a Discord Client, and call it bot\nconst bot = new Discord.Client();\n\n// the token of your bot - https://discordapp.com/developers/applications/me\nconst token = 'your bot token here';\n\n// the ready event is vital, it means that your bot will only start reacting to information\n// from Discord _after_ ready is emitted.\nbot.on('ready', () => {\n console.log('I am ready!');\n});\n\n// create an event listener for messages\nbot.on('message', message => {\n // if the message is \"ping\",\n if (message.content === 'ping') {\n // send \"pong\" to the same channel.\n message.channel.sendMessage('pong');\n }\n});\n\n// log our bot in\nbot.login(token);\n\n```"}]}}
\ No newline at end of file
+{"meta":{"version":12,"date":1472071132749},"classes":[{"id":"Client","name":"Client","description":"The starting point for making a Discord Bot.","meta":{"line":17,"file":"Client.js","path":"src/client"},"extends":["EventEmitter"],"classConstructor":{"id":"Client()","name":"Client","description":"Creates an instance of Client.","memberof":"Client","params":[{"name":"options","description":"options to pass to the client","optional":true,"type":{"types":[[["ClientOptions",""]]]}}]},"methods":[{"id":"Client#login","name":"login","description":"Logs the client in. If successful, resolves with the account's token. If you're making a bot, it's\nmuch better to use a bot account rather than a user account.\nBot accounts have higher rate limits and have access to some features user accounts don't have. User bots\nthat are making a lot of API requests can even be banned.","memberof":"Client","examples":["// log the client in using a token\nconst token = 'my token';\nclient.login(token);","// log the client in using email and password\nconst email = 'user@email.com';\nconst password = 'supersecret123';\nclient.login(email, password);"],"meta":{"line":124,"file":"Client.js","path":"src/client"},"returns":{"types":[[["Promise",".<"],["String",">"]]]},"params":[{"name":"emailOrToken","description":"The email or token used for the account. If it is an email, a password _must_ be\nprovided.","type":{"types":[[["String",""]]]}},{"name":"password","description":"The password for the account, only needed if an email was provided.","optional":true,"type":{"types":[[["String",""]]]}}]}],"properties":[{"id":"Client#users","name":"users","description":"A Collection of the Client's stored users","memberof":"Client","type":{"types":[[["Collection",".<"],["String",", "],["User",">"]]]},"meta":{"line":72,"file":"Client.js","path":"src/client"},"props":[]},{"id":"Client#guilds","name":"guilds","description":"A Collection of the Client's stored guilds","memberof":"Client","type":{"types":[[["Collection",".<"],["String",", "],["Guild",">"]]]},"meta":{"line":77,"file":"Client.js","path":"src/client"},"props":[]},{"id":"Client#channels","name":"channels","description":"A Collection of the Client's stored channels","memberof":"Client","type":{"types":[[["Collection",".<"],["String",", "],["Channel",">"]]]},"meta":{"line":82,"file":"Client.js","path":"src/client"},"props":[]},{"id":"Client#token","name":"token","description":"The authorization token for the logged in user/bot.","memberof":"Client","type":{"types":[[["String",""]]]},"meta":{"line":87,"file":"Client.js","path":"src/client"},"props":[]},{"id":"Client#user","name":"user","description":"The ClientUser representing the logged in Client","memberof":"Client","type":{"types":[[["ClientUser",""]]]},"meta":{"line":92,"file":"Client.js","path":"src/client"},"props":[]},{"id":"Client#email","name":"email","description":"The email, if there is one, for the logged in Client","memberof":"Client","type":{"types":[[["String",""]]]},"meta":{"line":97,"file":"Client.js","path":"src/client"},"props":[]},{"id":"Client#password","name":"password","description":"The password, if there is one, for the logged in Client","memberof":"Client","type":{"types":[[["String",""]]]},"meta":{"line":102,"file":"Client.js","path":"src/client"},"props":[]},{"id":"Client#voiceConnections","name":"voiceConnections","description":"Returns a Collection, mapping Guild ID to Voice Connections.","memberof":"Client","type":{"types":[[["Collection",".<"],["String",", "],["VoiceConnection",">"]]]},"meta":{"line":138,"file":"Client.js","path":"src/client"},"props":[]}],"events":[{"id":"Client#event:channelUpdate","name":"channelUpdate","description":"Emitted whenever a channel is updated - e.g. name change, topic change.","memberof":"Client","meta":{"line":31,"file":"ChannelUpdate.js","path":"src/client/actions"},"params":[{"name":"oldChannel","description":"the channel before the update","type":{"types":[[["Channel",""]]]}},{"name":"newChannel","description":"the channel after the update","type":{"types":[[["Channel",""]]]}}]},{"id":"Client#event:guildUnavailable","name":"guildUnavailable","description":"Emitted whenever a guild becomes unavailable, likely due to a server outage.","memberof":"Client","meta":{"line":49,"file":"GuildDelete.js","path":"src/client/actions"},"params":[{"name":"guild","description":"the guild that has become unavailable.","type":{"types":[[["Guild",""]]]}}]},{"id":"Client#event:guildMemberRemove","name":"guildMemberRemove","description":"Emitted whenever a member leaves a guild, or is kicked.","memberof":"Client","meta":{"line":49,"file":"GuildMemberRemove.js","path":"src/client/actions"},"params":[{"name":"guild","description":"the guild that the member has left.","type":{"types":[[["Guild",""]]]}},{"name":"member","description":"the member that has left the guild.","type":{"types":[[["GuildMember",""]]]}}]},{"id":"Client#event:guildRoleCreate","name":"guildRoleCreate","description":"Emitted whenever a guild role is created.","memberof":"Client","meta":{"line":32,"file":"GuildRoleCreate.js","path":"src/client/actions"},"params":[{"name":"guild","description":"the guild that the role was created in.","type":{"types":[[["Guild",""]]]}},{"name":"role","description":"the role that was created.","type":{"types":[[["Role",""]]]}}]},{"id":"Client#event:guildRoleDelete","name":"guildRoleDelete","description":"Emitted whenever a guild role is deleted.","memberof":"Client","meta":{"line":47,"file":"GuildRoleDelete.js","path":"src/client/actions"},"params":[{"name":"guild","description":"the guild that the role was deleted in.","type":{"types":[[["Guild",""]]]}},{"name":"role","description":"the role that was deleted.","type":{"types":[[["Role",""]]]}}]},{"id":"Client#event:guildRoleUpdated","name":"guildRoleUpdated","description":"Emitted whenever a guild role is updated.","memberof":"Client","meta":{"line":36,"file":"GuildRoleUpdate.js","path":"src/client/actions"},"params":[{"name":"guild","description":"the guild that the role was updated in.","type":{"types":[[["Guild",""]]]}},{"name":"oldRole","description":"the role before the update.","type":{"types":[[["Role",""]]]}},{"name":"newRole","description":"the role after the update.","type":{"types":[[["Role",""]]]}}]},{"id":"Client#event:guildUpdate","name":"guildUpdate","description":"Emitted whenever a guild is updated - e.g. name change.","memberof":"Client","meta":{"line":38,"file":"GuildUpdate.js","path":"src/client/actions"},"params":[{"name":"oldGuild","description":"the guild before the update.","type":{"types":[[["Guild",""]]]}},{"name":"newGuild","description":"the guild after the update.","type":{"types":[[["Guild",""]]]}}]},{"id":"Client#event:messageUpdate","name":"messageUpdate","description":"Emitted whenever a message is updated - e.g. embed or content change.","memberof":"Client","meta":{"line":36,"file":"MessageUpdate.js","path":"src/client/actions"},"params":[{"name":"oldMessage","description":"the message before the update.","type":{"types":[[["Message",""]]]}},{"name":"newMessage","description":"the message after the update.","type":{"types":[[["Message",""]]]}}]},{"id":"Client#event:userUpdate","name":"userUpdate","description":"Emitted whenever a detail of the logged in User changes - e.g. username.","memberof":"Client","meta":{"line":36,"file":"UserUpdate.js","path":"src/client/actions"},"params":[{"name":"oldClientUser","description":"the client user before the update.","type":{"types":[[["ClientUser",""]]]}},{"name":"newClientUser","description":"the client user after the update.","type":{"types":[[["ClientUser",""]]]}}]},{"id":"Client#event:guildCreate","name":"guildCreate","description":"Emitted whenever the client joins a Guild.","memberof":"Client","meta":{"line":25,"file":"ClientDataManager.js","path":"src/client"},"params":[{"name":"guild","description":"the created guild.","type":{"types":[[["Guild",""]]]}}]},{"id":"Client#event:channelCreate","name":"channelCreate","description":"Emitted whenever a Channel is created.","memberof":"Client","meta":{"line":20,"file":"ChannelCreate.js","path":"src/client/websocket/packets/handlers"},"params":[{"name":"channel","description":"The channel that was created","type":{"types":[[["Channel",""]]]}}]},{"id":"Client#event:channelDelete","name":"channelDelete","description":"Emitted whenever a Channel is deleted.","memberof":"Client","meta":{"line":20,"file":"ChannelDelete.js","path":"src/client/websocket/packets/handlers"},"params":[{"name":"channel","description":"The channel that was deleted","type":{"types":[[["Channel",""]]]}}]},{"id":"Client#event:guildBanAdd","name":"guildBanAdd","description":"Emitted whenever a member is banned from a guild.","memberof":"Client","meta":{"line":22,"file":"GuildBanAdd.js","path":"src/client/websocket/packets/handlers"},"params":[{"name":"guild","description":"The guild that the ban occurred in","type":{"types":[[["Guild",""]]]}},{"name":"user","description":"The user that was banned","type":{"types":[[["User",""]]]}}]},{"id":"Client#event:guildBanRemove","name":"guildBanRemove","description":"Emitted whenever a member is unbanned from a guild.","memberof":"Client","meta":{"line":23,"file":"GuildBanRemove.js","path":"src/client/websocket/packets/handlers"},"params":[{"name":"guild","description":"The guild that the unban occurred in","type":{"types":[[["Guild",""]]]}},{"name":"user","description":"The user that was unbanned","type":{"types":[[["User",""]]]}}]},{"id":"Client#event:guildDelete","name":"guildDelete","description":"Emitted whenever a Guild is deleted/left.","memberof":"Client","meta":{"line":19,"file":"GuildDelete.js","path":"src/client/websocket/packets/handlers"},"params":[{"name":"guild","description":"The guild that was deleted","type":{"types":[[["Guild",""]]]}}]},{"id":"Client#event:guildMembersChunk","name":"guildMembersChunk","description":"Emitted whenever a chunk of Guild members is received","memberof":"Client","meta":{"line":25,"file":"GuildMembersChunk.js","path":"src/client/websocket/packets/handlers"},"params":[{"name":"guild","description":"The guild that the chunks relate to","type":{"types":[[["Guild",""]]]}},{"name":"members","description":"The members in the chunk","type":{"types":[[["Array",".<"],["GuildMember",">"]]]}}]},{"id":"Client#event:message","name":"message","description":"Emitted whenever a message is created","memberof":"Client","meta":{"line":19,"file":"MessageCreate.js","path":"src/client/websocket/packets/handlers"},"params":[{"name":"message","description":"The created message","type":{"types":[[["Message",""]]]}}]},{"id":"Client#event:messageDelete","name":"messageDelete","description":"Emitted whenever a message is deleted","memberof":"Client","meta":{"line":19,"file":"MessageDelete.js","path":"src/client/websocket/packets/handlers"},"params":[{"name":"message","description":"The deleted message","type":{"types":[[["Message",""]]]}}]},{"id":"Client#event:presenceUpdate","name":"presenceUpdate","description":"Emitted whenever a user changes one of their details or starts/stop playing a game","memberof":"Client","meta":{"line":66,"file":"PresenceUpdate.js","path":"src/client/websocket/packets/handlers"},"params":[{"name":"oldUser","description":"the user before the presence update","type":{"types":[[["User",""]]]}},{"name":"newUser","description":"the user after the presence update","type":{"types":[[["User",""]]]}}]},{"id":"Client#event:guildMemberAvailable","name":"guildMemberAvailable","description":"Emitted whenever a member becomes available in a large Guild","memberof":"Client","meta":{"line":74,"file":"PresenceUpdate.js","path":"src/client/websocket/packets/handlers"},"params":[{"name":"guild","description":"The guild that the member became available in","type":{"types":[[["Guild",""]]]}},{"name":"member","description":"the member that became available","type":{"types":[[["GuildMember",""]]]}}]},{"id":"Client#event:typingStart","name":"typingStart","description":"Emitted whenever a user starts typing in a channel","memberof":"Client","meta":{"line":52,"file":"TypingStart.js","path":"src/client/websocket/packets/handlers"},"params":[{"name":"channel","description":"the channel the user started typing in","type":{"types":[[["Channel",""]]]}},{"name":"user","description":"the user that started typing","type":{"types":[[["User",""]]]}}]},{"id":"Client#event:typingStop","name":"typingStop","description":"Emitted whenever a user stops typing in a channel","memberof":"Client","meta":{"line":60,"file":"TypingStart.js","path":"src/client/websocket/packets/handlers"},"params":[{"name":"channel","description":"the channel the user stopped typing in","type":{"types":[[["Channel",""]]]}},{"name":"user","description":"the user that stopped typing","type":{"types":[[["User",""]]]}}]},{"id":"Client#event:voiceStateUpdate","name":"voiceStateUpdate","description":"Emitted whenever a user changes voice state - e.g. joins/leaves a channel, mutes/unmutes.","memberof":"Client","meta":{"line":48,"file":"VoiceStateUpdate.js","path":"src/client/websocket/packets/handlers"},"params":[{"name":"oldMember","description":"the member before the voice state update","type":{"types":[[["GuildMember",""]]]}},{"name":"newMember","description":"the member before the voice state update","type":{"types":[[["GuildMember",""]]]}}]},{"id":"Client#event:ready","name":"ready","description":"Emitted when the Client becomes ready to start working","memberof":"Client","meta":{"line":189,"file":"WebSocketManager.js","path":"src/client/websocket"},"params":[]},{"id":"Client#event:reconnecting","name":"reconnecting","description":"Emitted when the Client tries to reconnect after being disconnected","memberof":"Client","meta":{"line":208,"file":"WebSocketManager.js","path":"src/client/websocket"},"params":[]},{"id":"Client#event:guildMemberRolesUpdate","name":"guildMemberRolesUpdate","description":"Emitted whenever a Guild Member's Roles change - i.e. new role or removed role","memberof":"Client","meta":{"line":104,"file":"Guild.js","path":"src/structures"},"params":[{"name":"guild","description":"the guild that the update affects","type":{"types":[[["Guild",""]]]}},{"name":"oldRoles","description":"the roles before the update","type":{"types":[[["Array",".<"],["Role",">"]]]}},{"name":"newRoles","description":"the roles after the update","type":{"types":[[["Guild",""]]]}}]}]},{"id":"VoiceConnection","name":"VoiceConnection","description":"Represents a connection to a Voice Channel in Discord","meta":{"line":11,"file":"VoiceConnection.js","path":"src/client/voice"},"extends":["EventEmitter"],"methods":[{"id":"VoiceConnection#disconnect","name":"disconnect","description":"Disconnects the Client from the Voice Channel","memberof":"VoiceConnection","meta":{"line":78,"file":"VoiceConnection.js","path":"src/client/voice"},"returns":{"types":[[["null",""]]]},"params":[{"name":"reason","description":"the reason of the disconnection","optional":true,"type":{"types":[[["string",""]]]}}]}],"properties":[{"id":"VoiceConnection#player","name":"player","description":"The player","memberof":"VoiceConnection","type":{"types":[[["BasePlayer",""]]]},"meta":{"line":24,"file":"VoiceConnection.js","path":"src/client/voice"},"props":[]},{"id":"VoiceConnection#endpoint","name":"endpoint","description":"The endpoint of the connection","memberof":"VoiceConnection","type":{"types":[[["String",""]]]},"meta":{"line":29,"file":"VoiceConnection.js","path":"src/client/voice"},"props":[]},{"id":"VoiceConnection#channel","name":"channel","description":"The VoiceChannel for this connection","memberof":"VoiceConnection","type":{"types":[[["VoiceChannel",""]]]},"meta":{"line":34,"file":"VoiceConnection.js","path":"src/client/voice"},"props":[]},{"id":"VoiceConnection#ready","name":"ready","description":"Whether or not the connection is ready","memberof":"VoiceConnection","type":{"types":[[["Boolean",""]]]},"meta":{"line":45,"file":"VoiceConnection.js","path":"src/client/voice"},"props":[]}],"events":[]},{"id":"Channel","name":"Channel","description":"Represents any Channel on Discord","meta":{"line":4,"file":"Channel.js","path":"src/structures"},"methods":[{"id":"Channel#delete","name":"delete","description":"Deletes the channel","memberof":"Channel","examples":["// delete the channel\nchannel.delete()\n .then() // success\n .catch(console.log); // log error"],"meta":{"line":39,"file":"Channel.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Channel",">"]]]},"params":[]}],"properties":[{"id":"Channel#client","name":"client","description":"The client that instantiated the Channel","memberof":"Channel","type":{"types":[[["Client",""]]]},"meta":{"line":10,"file":"Channel.js","path":"src/structures"},"props":[]},{"id":"Channel#id","name":"id","description":"The unique ID of the channel","memberof":"Channel","type":{"types":[[["String",""]]]},"meta":{"line":27,"file":"Channel.js","path":"src/structures"},"props":[]}],"events":[]},{"id":"ClientUser","name":"ClientUser","description":"Represents the logged in client's Discord User","meta":{"line":7,"file":"ClientUser.js","path":"src/structures"},"extends":["User"],"methods":[{"id":"ClientUser#setUsername","name":"setUsername","description":"Set the username of the logged in Client.\nChanging usernames in Discord is heavily rate limited, with only 2 requests\nevery hour. Use this sparingly!","memberof":"ClientUser","examples":["// set username\nclient.user.setUsername('discordjs')\n .then(user => console.log(`My new username is ${user.username}`))\n .catch(console.log);"],"meta":{"line":34,"file":"ClientUser.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["ClientUser",">"]]]},"params":[{"name":"username","description":"the new username","type":{"types":[[["String",""]]]}}]},{"id":"ClientUser#setEmail","name":"setEmail","description":"If this user is a \"self bot\" or logged in using a normal user's details (which should be avoided), you can set the\nemail here.","memberof":"ClientUser","examples":["// set email\nclient.user.setEmail('bob@gmail.com')\n .then(user => console.log(`My new email is ${user.email}`))\n .catch(console.log);"],"meta":{"line":49,"file":"ClientUser.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["ClientUser",">"]]]},"params":[{"name":"email","description":"the new email","type":{"types":[[["String",""]]]}}]},{"id":"ClientUser#setPassword","name":"setPassword","description":"If this user is a \"self bot\" or logged in using a normal user's details (which should be avoided), you can set the\npassword here.","memberof":"ClientUser","examples":["// set password\nclient.user.setPassword('password')\n .then(user => console.log('New password set!'))\n .catch(console.log);"],"meta":{"line":64,"file":"ClientUser.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["ClientUser",">"]]]},"params":[{"name":"password","description":"the new password","type":{"types":[[["String",""]]]}}]},{"id":"ClientUser#setAvatar","name":"setAvatar","description":"Set the avatar of the logged in Client.","memberof":"ClientUser","examples":["// set avatar\nclient.user.setAvatar(fs.readFileSync('./avatar.png'))\n .then(user => console.log(`New avatar set!`))\n .catch(console.log);"],"meta":{"line":78,"file":"ClientUser.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["ClientUser",">"]]]},"params":[{"name":"avatar","description":"the new avatar","type":{"types":[[["Base64Resolvable",""]]]}}]},{"id":"ClientUser#setStatus","name":"setStatus","description":"Set the status and playing game of the logged in client.","memberof":"ClientUser","examples":["// set status\nclient.user.setStatus('status', 'game')\n .then(user => console.log('Changed status!'))\n .catch(console.log);"],"meta":{"line":93,"file":"ClientUser.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["ClientUser",", "],["Error",">"]]]},"params":[{"name":"status","description":"the status, can be `online` or `idle`.","optional":true,"type":{"types":[[["String",""]]]}},{"name":"game","description":"the game that is being played","optional":true,"type":{"types":[[["String",""]],[["Object",""]]]}}]},{"id":"ClientUser#toString","name":"toString","description":"When concatenated with a String, this automatically concatenates the User's mention instead of the User object.","memberof":"ClientUser","examples":["// logs: Hello from <@123456789>!\nconsole.log(`Hello from ${user}!`);"],"inherits":"User#toString","inherited":true,"meta":{"line":64,"file":"User.js","path":"src/structures"},"returns":{"types":[[["String",""]]]},"params":[]},{"id":"ClientUser#deleteDM","name":"deleteDM","description":"Deletes a DM Channel (if one exists) between the Client and the User. Resolves with the Channel if successful.","memberof":"ClientUser","inherits":"User#deleteDM","inherited":true,"meta":{"line":72,"file":"User.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["DMChannel",">"]]]},"params":[]},{"id":"ClientUser#equals","name":"equals","description":"Checks if the user is equal to another. It compares username, ID, discriminator, status and the game being played.\nIt is recommended to compare equality by using `user.id === user2.id` unless you want to compare all properties.","memberof":"ClientUser","inherits":"User#equals","inherited":true,"meta":{"line":82,"file":"User.js","path":"src/structures"},"returns":{"types":[[["Boolean",""]]]},"params":[{"name":"user","description":"the user to compare","type":{"types":[[["User",""]]]}}]},{"id":"ClientUser#sendMessage","name":"sendMessage","description":"Send a message to this channel","memberof":"ClientUser","examples":["// send a message\nchannel.sendMessage('hello!')\n .then(message => console.log(`Sent message: ${message.content}`))\n .catch(console.log);"],"inherits":"User#sendMessage","inherited":true,"meta":{"line":28,"file":"TextBasedChannel.js","path":"src/structures/interface"},"returns":{"types":[[["Promise",".<"],["Message",">"]]]},"params":[{"name":"content","description":"the content to send","type":{"types":[[["String",""]]]}},{"name":"options","description":"the options to provide","optional":true,"type":{"types":[[["MessageOptions",""]]]}}],"implements":["TextBasedChannel#sendMessage"]},{"id":"ClientUser#sendTTSMessage","name":"sendTTSMessage","description":"Send a text-to-speech message to this channel","memberof":"ClientUser","examples":["// send a TTS message\nchannel.sendTTSMessage('hello!')\n .then(message => console.log(`Sent tts message: ${message.content}`))\n .catch(console.log);"],"inherits":"User#sendTTSMessage","inherited":true,"meta":{"line":41,"file":"TextBasedChannel.js","path":"src/structures/interface"},"returns":{"types":[[["Promise",".<"],["Message",">"]]]},"params":[{"name":"content","description":"the content to send","type":{"types":[[["String",""]]]}}],"implements":["TextBasedChannel#sendTTSMessage"]}],"properties":[{"id":"ClientUser#verified","name":"verified","description":"Whether or not this account has been verified","memberof":"ClientUser","type":{"types":[[["Boolean",""]]]},"meta":{"line":14,"file":"ClientUser.js","path":"src/structures"},"props":[]},{"id":"ClientUser#email","name":"email","description":"The email of this account","memberof":"ClientUser","type":{"types":[[["String",""]]]},"meta":{"line":19,"file":"ClientUser.js","path":"src/structures"},"props":[]},{"id":"ClientUser#username","name":"username","description":"The username of the User","memberof":"ClientUser","type":{"types":[[["String",""]]]},"meta":{"line":20,"file":"User.js","path":"src/structures"},"props":[]},{"id":"ClientUser#id","name":"id","description":"The ID of the User","memberof":"ClientUser","type":{"types":[[["String",""]]]},"meta":{"line":25,"file":"User.js","path":"src/structures"},"props":[]},{"id":"ClientUser#discriminator","name":"discriminator","description":"A discriminator based on username for the User","memberof":"ClientUser","type":{"types":[[["String",""]]]},"meta":{"line":30,"file":"User.js","path":"src/structures"},"props":[]},{"id":"ClientUser#avatar","name":"avatar","description":"The ID of the user's avatar","memberof":"ClientUser","type":{"types":[[["String",""]]]},"meta":{"line":35,"file":"User.js","path":"src/structures"},"props":[]},{"id":"ClientUser#bot","name":"bot","description":"Whether or not the User is a Bot.","memberof":"ClientUser","type":{"types":[[["Boolean",""]]]},"meta":{"line":40,"file":"User.js","path":"src/structures"},"props":[]},{"id":"ClientUser#status","name":"status","description":"The status of the user:\n\n* **`online`** - user is online\n* **`offline`** - user is offline\n* **`idle`** - user is AFK","memberof":"ClientUser","type":{"types":[[["String",""]]]},"meta":{"line":49,"file":"User.js","path":"src/structures"},"props":[]},{"id":"ClientUser#game","name":"game","description":"The game that the user is playing, `null` if they aren't playing a game.","memberof":"ClientUser","type":{"types":[[["String",""]]]},"meta":{"line":54,"file":"User.js","path":"src/structures"},"props":[]}],"events":[]},{"id":"DMChannel","name":"DMChannel","description":"Represents a Direct Message Channel between two users.","meta":{"line":11,"file":"DMChannel.js","path":"src/structures"},"extends":["Channel"],"methods":[{"id":"DMChannel#toString","name":"toString","description":"When concatenated with a String, this automatically concatenates the recipient's mention instead of the\nDM channel object.","memberof":"DMChannel","meta":{"line":37,"file":"DMChannel.js","path":"src/structures"},"returns":{"types":[[["String",""]]]},"params":[]},{"id":"DMChannel#sendMessage","name":"sendMessage","description":"Send a message to this channel","memberof":"DMChannel","examples":["// send a message\nchannel.sendMessage('hello!')\n .then(message => console.log(`Sent message: ${message.content}`))\n .catch(console.log);"],"meta":{"line":28,"file":"TextBasedChannel.js","path":"src/structures/interface"},"returns":{"types":[[["Promise",".<"],["Message",">"]]]},"params":[{"name":"content","description":"the content to send","type":{"types":[[["String",""]]]}},{"name":"options","description":"the options to provide","optional":true,"type":{"types":[[["MessageOptions",""]]]}}],"implements":["TextBasedChannel#sendMessage"]},{"id":"DMChannel#sendTTSMessage","name":"sendTTSMessage","description":"Send a text-to-speech message to this channel","memberof":"DMChannel","examples":["// send a TTS message\nchannel.sendTTSMessage('hello!')\n .then(message => console.log(`Sent tts message: ${message.content}`))\n .catch(console.log);"],"meta":{"line":41,"file":"TextBasedChannel.js","path":"src/structures/interface"},"returns":{"types":[[["Promise",".<"],["Message",">"]]]},"params":[{"name":"content","description":"the content to send","type":{"types":[[["String",""]]]}}],"implements":["TextBasedChannel#sendTTSMessage"]},{"id":"DMChannel#getMessages","name":"getMessages","description":"Gets the past messages sent in this channel. Resolves with a Collection mapping message ID's to Message objects.","memberof":"DMChannel","examples":["// get messages\nchannel.getMessages({limit: 10})\n .then(messages => console.log(`Received ${messages.size} messages`))\n .catch(console.log);"],"meta":{"line":69,"file":"TextBasedChannel.js","path":"src/structures/interface"},"returns":{"types":[[["Promise",".<"],["Collection",".<"],["String",", "],["Message",">, "],["Error",">"]]]},"params":[{"name":"options","description":"the query parameters to pass in","optional":true,"type":{"types":[[["ChannelLogsQueryOptions",""]]]}}],"implements":["TextBasedChannel#getMessages"]},{"id":"DMChannel#delete","name":"delete","description":"Deletes the channel","memberof":"DMChannel","examples":["// delete the channel\nchannel.delete()\n .then() // success\n .catch(console.log); // log error"],"inherits":"Channel#delete","inherited":true,"meta":{"line":39,"file":"Channel.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Channel",">"]]]},"params":[]}],"properties":[{"id":"DMChannel#recipient","name":"recipient","description":"The recipient on the other end of the DM","memberof":"DMChannel","type":{"types":[[["User",""]]]},"meta":{"line":24,"file":"DMChannel.js","path":"src/structures"},"props":[]},{"id":"DMChannel#lastMessageID","name":"lastMessageID","description":"The ID of the last sent message, if available","memberof":"DMChannel","type":{"types":[[["String",""]]]},"meta":{"line":29,"file":"DMChannel.js","path":"src/structures"},"props":[]},{"id":"DMChannel#messages","name":"messages","description":"A Collection containing the messages sent to this channel.","memberof":"DMChannel","type":{"types":[[["Collection",".<"],["String",", "],["Message",">"]]]},"meta":{"line":15,"file":"TextBasedChannel.js","path":"src/structures/interface"},"props":[]},{"id":"DMChannel#client","name":"client","description":"The client that instantiated the Channel","memberof":"DMChannel","type":{"types":[[["Client",""]]]},"meta":{"line":10,"file":"Channel.js","path":"src/structures"},"props":[]},{"id":"DMChannel#id","name":"id","description":"The unique ID of the channel","memberof":"DMChannel","type":{"types":[[["String",""]]]},"meta":{"line":27,"file":"Channel.js","path":"src/structures"},"props":[]}],"events":[]},{"id":"GroupDMChannel","name":"GroupDMChannel","description":"Represents a Group DM on Discord","meta":{"line":48,"file":"GroupDMChannel.js","path":"src/structures"},"extends":["Channel"],"methods":[{"id":"GroupDMChannel#sendMessage","name":"sendMessage","description":"Send a message to this channel","memberof":"GroupDMChannel","examples":["// send a message\nchannel.sendMessage('hello!')\n .then(message => console.log(`Sent message: ${message.content}`))\n .catch(console.log);"],"meta":{"line":28,"file":"TextBasedChannel.js","path":"src/structures/interface"},"returns":{"types":[[["Promise",".<"],["Message",">"]]]},"params":[{"name":"content","description":"the content to send","type":{"types":[[["String",""]]]}},{"name":"options","description":"the options to provide","optional":true,"type":{"types":[[["MessageOptions",""]]]}}],"implements":["TextBasedChannel#sendMessage"]},{"id":"GroupDMChannel#sendTTSMessage","name":"sendTTSMessage","description":"Send a text-to-speech message to this channel","memberof":"GroupDMChannel","examples":["// send a TTS message\nchannel.sendTTSMessage('hello!')\n .then(message => console.log(`Sent tts message: ${message.content}`))\n .catch(console.log);"],"meta":{"line":41,"file":"TextBasedChannel.js","path":"src/structures/interface"},"returns":{"types":[[["Promise",".<"],["Message",">"]]]},"params":[{"name":"content","description":"the content to send","type":{"types":[[["String",""]]]}}],"implements":["TextBasedChannel#sendTTSMessage"]},{"id":"GroupDMChannel#getMessages","name":"getMessages","description":"Gets the past messages sent in this channel. Resolves with a Collection mapping message ID's to Message objects.","memberof":"GroupDMChannel","examples":["// get messages\nchannel.getMessages({limit: 10})\n .then(messages => console.log(`Received ${messages.size} messages`))\n .catch(console.log);"],"meta":{"line":69,"file":"TextBasedChannel.js","path":"src/structures/interface"},"returns":{"types":[[["Promise",".<"],["Collection",".<"],["String",", "],["Message",">, "],["Error",">"]]]},"params":[{"name":"options","description":"the query parameters to pass in","optional":true,"type":{"types":[[["ChannelLogsQueryOptions",""]]]}}],"implements":["TextBasedChannel#getMessages"]},{"id":"GroupDMChannel#delete","name":"delete","description":"Deletes the channel","memberof":"GroupDMChannel","examples":["// delete the channel\nchannel.delete()\n .then() // success\n .catch(console.log); // log error"],"inherits":"Channel#delete","inherited":true,"meta":{"line":39,"file":"Channel.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Channel",">"]]]},"params":[]}],"properties":[{"id":"GroupDMChannel#recipients","name":"recipients","description":"A collection of the recipients of this DM, mapped by their ID.","memberof":"GroupDMChannel","type":{"types":[[["Collection",".<"],["String",", "],["User",">"]]]},"meta":{"line":81,"file":"GroupDMChannel.js","path":"src/structures"},"props":[]},{"id":"GroupDMChannel#name","name":"name","description":"The name of this Group DM, can be null if one isn't set.","memberof":"GroupDMChannel","type":{"types":[[["String",""]]]},"meta":{"line":94,"file":"GroupDMChannel.js","path":"src/structures"},"props":[]},{"id":"GroupDMChannel#id","name":"id","description":"The ID of this Group DM Channel.","memberof":"GroupDMChannel","type":{"types":[[["String",""]]]},"meta":{"line":99,"file":"GroupDMChannel.js","path":"src/structures"},"props":[]},{"id":"GroupDMChannel#icon","name":"icon","description":"A hash of the Group DM icon.","memberof":"GroupDMChannel","type":{"types":[[["String",""]]]},"meta":{"line":104,"file":"GroupDMChannel.js","path":"src/structures"},"props":[]},{"id":"GroupDMChannel#lastMessageID","name":"lastMessageID","description":"The ID of the last message in the channel, if one was sent.","memberof":"GroupDMChannel","type":{"types":[[["String",""]]]},"meta":{"line":109,"file":"GroupDMChannel.js","path":"src/structures"},"props":[]},{"id":"GroupDMChannel#owner","name":"owner","description":"The owner of this Group DM.","memberof":"GroupDMChannel","type":{"types":[[["User",""]]]},"meta":{"line":114,"file":"GroupDMChannel.js","path":"src/structures"},"props":[]},{"id":"GroupDMChannel#messages","name":"messages","description":"A Collection containing the messages sent to this channel.","memberof":"GroupDMChannel","type":{"types":[[["Collection",".<"],["String",", "],["Message",">"]]]},"meta":{"line":15,"file":"TextBasedChannel.js","path":"src/structures/interface"},"props":[]},{"id":"GroupDMChannel#client","name":"client","description":"The client that instantiated the Channel","memberof":"GroupDMChannel","type":{"types":[[["Client",""]]]},"meta":{"line":10,"file":"Channel.js","path":"src/structures"},"props":[]}],"events":[]},{"id":"Guild","name":"Guild","description":"Represents a Guild (or a Server) on Discord.","meta":{"line":25,"file":"Guild.js","path":"src/structures"},"methods":[{"id":"Guild#toString","name":"toString","description":"When concatenated with a String, this automatically concatenates the Guild's name instead of the Guild object.","memberof":"Guild","examples":["// logs: Hello from My Guild!\nconsole.log(`Hello from ${guild}!`);","// logs: Hello from My Guild!\nconsole.log(`Hello from ' + guild + '!');"],"meta":{"line":130,"file":"Guild.js","path":"src/structures"},"returns":{"types":[[["String",""]]]},"params":[]},{"id":"Guild#kick","name":"kick","description":"Tries to kick a member from the guild.","memberof":"Guild","examples":["// kicks a member from a guild:\nguild.kick(message.author)\n .then(member => console.log(`Kicked ${member}`))\n .catch(error => console.log(error));"],"meta":{"line":144,"file":"Guild.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["GuildMember",", "],["Error",">"]]]},"params":[{"name":"member","description":"the member to kick","type":{"types":[[["GuildMemberResolvable",""]]]}}]},{"id":"Guild#member","name":"member","description":"Returns the GuildMember form of a User object, if the User is present in the guild.","memberof":"Guild","examples":["// get the guild member of a user\nconst member = guild.member(message.author);"],"meta":{"line":156,"file":"Guild.js","path":"src/structures"},"returns":{"types":[[["GuildMember",""]],[["null",""]]]},"params":[{"name":"user","description":"the user that you want to obtain the GuildMember of.","type":{"types":[[["UserResolvable",""]]]}}]},{"id":"Guild#equals","name":"equals","description":"Whether this Guild equals another Guild. It compares all properties, so for most operations\nit is advisable to just compare `guild.id === guild2.id` as it is much faster and is often\nwhat most users need.","memberof":"Guild","meta":{"line":167,"file":"Guild.js","path":"src/structures"},"returns":{"types":[[["Boolean",""]]]},"params":[{"name":"guild","description":"the guild to compare","type":{"types":[[["Guild",""]]]}}]},{"id":"Guild#createChannel","name":"createChannel","description":"Creates a new Channel in the Guild.","memberof":"Guild","examples":["// create a new text channel\nguild.createChannel('new general', 'text')\n .then(channel => console.log(`Created new channel ${channel}`))\n .catch(console.log);"],"meta":{"line":347,"file":"Guild.js","path":"src/structures"},"returns":{"types":[[["Promise",".<("],["TextChannel","|"],["VoiceChannel","), "],["Error",">"]]]},"params":[{"name":"name","description":"the name of the new channel.","type":{"types":[[["String",""]]]}},{"name":"type","description":"the type of the new channel, either `text` or `voice`.","type":{"types":[[["String",""]]]}}]},{"id":"Guild#createRole","name":"createRole","description":"Creates a new role in the guild, as of now this is just a blank role.","memberof":"Guild","examples":["// create a new role\nguild.createRole()\n .then(role => console.log(`Created role ${role}`))\n .catch(console.log);"],"meta":{"line":360,"file":"Guild.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Role",", "],["Error",">"]]]},"params":[]},{"id":"Guild#leave","name":"leave","description":"Causes the Client to leave the guild.","memberof":"Guild","examples":["// leave a guild\nguild.leave()\n .then(g => console.log(`Left the guild ${g}`))\n .catch(console.log);"],"meta":{"line":373,"file":"Guild.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Guild",", "],["Error",">"]]]},"params":[]},{"id":"Guild#delete","name":"delete","description":"Causes the Client to delete the guild.","memberof":"Guild","examples":["// delete a guild\nguild.delete()\n .then(g => console.log(`Deleted the guild ${g}`))\n .catch(console.log);"],"meta":{"line":386,"file":"Guild.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Guild",", "],["Error",">"]]]},"params":[]},{"id":"Guild#edit","name":"edit","description":"Updates the Guild with new information - e.g. a new name.","memberof":"Guild","examples":["// set the guild name and region\nguild.edit({\n name: 'Discord Guild',\n region: 'london',\n})\n.then(updated => console.log(`New guild name ${updated.name} in region ${updated.region}`))\n.catch(console.log);"],"meta":{"line":403,"file":"Guild.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Guild",", "],["Error",">"]]]},"params":[{"name":"data","description":"the data to update the guild with.","type":{"types":[[["GuildEditData",""]]]}}]},{"id":"Guild#setName","name":"setName","description":"Edit the name of the Guild.","memberof":"Guild","examples":["// edit the guild name\nguild.setName('Discord Guild')\n .then(updated => console.log(`Updated guild name to ${guild.name}`))\n .catch(console.log);"],"meta":{"line":417,"file":"Guild.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Guild",", "],["Error",">"]]]},"params":[{"name":"name","description":"the new name of the Guild.","type":{"types":[[["String",""]]]}}]},{"id":"Guild#setRegion","name":"setRegion","description":"Edit the region of the Guild.","memberof":"Guild","examples":["// edit the guild region\nguild.setRegion('london')\n .then(updated => console.log(`Updated guild region to ${guild.region}`))\n .catch(console.log);"],"meta":{"line":431,"file":"Guild.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Guild",", "],["Error",">"]]]},"params":[{"name":"region","description":"the new region of the guild.","type":{"types":[[["Region",""]]]}}]},{"id":"Guild#setVerificationLevel","name":"setVerificationLevel","description":"Edit the verification level of the Guild.","memberof":"Guild","examples":["// edit the guild verification level\nguild.setVerificationLevel(1)\n .then(updated => console.log(`Updated guild verification level to ${guild.verificationLevel}`))\n .catch(console.log);"],"meta":{"line":445,"file":"Guild.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Guild",", "],["Error",">"]]]},"params":[{"name":"verificationLevel","description":"the new verification level of the guild.","type":{"types":[[["VerificationLevel",""]]]}}]},{"id":"Guild#setAFKChannel","name":"setAFKChannel","description":"Edit the AFK channel of the Guild.","memberof":"Guild","examples":["// edit the guild AFK channel\nguild.setAFKChannel(channel)\n .then(updated => console.log(`Updated guild AFK channel to ${guild.afkChannel}`))\n .catch(console.log);"],"meta":{"line":459,"file":"Guild.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Guild",", "],["Error",">"]]]},"params":[{"name":"afkChannel","description":"the new AFK channel.","type":{"types":[[["GuildChannelResolvable",""]]]}}]},{"id":"Guild#setAFKTimeout","name":"setAFKTimeout","description":"Edit the AFK timeout of the Guild.","memberof":"Guild","examples":["// edit the guild AFK channel\nguild.setAFKTimeout(60)\n .then(updated => console.log(`Updated guild AFK timeout to ${guild.afkTimeout}`))\n .catch(console.log);"],"meta":{"line":473,"file":"Guild.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Guild",", "],["Error",">"]]]},"params":[{"name":"afkTimeout","description":"the time in seconds that a user must be idle to be considered AFK.","type":{"types":[[["Number",""]]]}}]},{"id":"Guild#setIcon","name":"setIcon","description":"Set a new Guild Icon.","memberof":"Guild","examples":["// edit the guild icon\nguild.setIcon(fs.readFileSync('./icon.png'))\n .then(updated => console.log('Updated the guild icon'))\n .catch(console.log);"],"meta":{"line":487,"file":"Guild.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Guild",", "],["Error",">"]]]},"params":[{"name":"icon","description":"the new icon of the guild.","type":{"types":[[["Base64Resolvable",""]]]}}]},{"id":"Guild#setOwner","name":"setOwner","description":"Sets a new owner of the Guild.","memberof":"Guild","examples":["// edit the guild owner\nguild.setOwner(guilds.members[0])\n .then(updated => console.log(`Updated the guild owner to ${updated.owner.username}`))\n .catch(console.log);"],"meta":{"line":501,"file":"Guild.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Guild",", "],["Error",">"]]]},"params":[{"name":"owner","description":"the new owner of the Guild.","type":{"types":[[["GuildMemberResolvable",""]]]}}]},{"id":"Guild#setSplash","name":"setSplash","description":"Set a new Guild Splash Logo.","memberof":"Guild","examples":["// edit the guild splash\nguild.setIcon(fs.readFileSync('./splash.png'))\n .then(updated => console.log('Updated the guild splash'))\n .catch(console.log);"],"meta":{"line":515,"file":"Guild.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Guild",", "],["Error",">"]]]},"params":[{"name":"splash","description":"the new splash screen of the guild.","type":{"types":[[["Base64Resolvable",""]]]}}]}],"properties":[{"id":"Guild#client","name":"client","description":"The Client that created the instance of the the Guild.","memberof":"Guild","type":{"types":[[["Client",""]]]},"meta":{"line":31,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#members","name":"members","description":"A Collection of members that are in this Guild. The key is the member's ID, the value is the member.","memberof":"Guild","type":{"types":[[["Collection",".<"],["String",", "],["GuildMember",">"]]]},"meta":{"line":37,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#channels","name":"channels","description":"A Collection of channels that are in this Guild. The key is the channel's ID, the value is the channel.","memberof":"Guild","type":{"types":[[["Collection",".<"],["String",", "],["GuildChannel",">"]]]},"meta":{"line":43,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#roles","name":"roles","description":"A Collection of roles that are in this Guild. The key is the role's ID, the value is the role.","memberof":"Guild","type":{"types":[[["Collection",".<"],["String",", "],["Role",">"]]]},"meta":{"line":49,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#available","name":"available","description":"Whether the Guild is available to access. If it is not available, it indicates a server outage.","memberof":"Guild","type":{"types":[[["Boolean",""]]]},"meta":{"line":60,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#id","name":"id","description":"The Unique ID of the Guild, useful for comparisons.","memberof":"Guild","type":{"types":[[["String",""]]]},"meta":{"line":65,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#splash","name":"splash","description":"The hash of the guild splash image, or null if no splash (VIP only)","memberof":"Guild","type":{"types":[[["String",""]]]},"meta":{"line":216,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#region","name":"region","description":"The region the guild is located in","memberof":"Guild","type":{"types":[[["String",""]]]},"meta":{"line":221,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#name","name":"name","description":"The name of the guild","memberof":"Guild","type":{"types":[[["String",""]]]},"meta":{"line":226,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#memberCount","name":"memberCount","description":"The amount of initial members in the guild.","memberof":"Guild","type":{"types":[[["Number",""]]]},"meta":{"line":231,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#large","name":"large","description":"Whether the guild is \"large\" (has more than 250 members)","memberof":"Guild","type":{"types":[[["Boolean",""]]]},"meta":{"line":236,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#joinDate","name":"joinDate","description":"The date at which the logged-in client joined the guild.","memberof":"Guild","type":{"types":[[["Date",""]]]},"meta":{"line":241,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#icon","name":"icon","description":"The hash of the guild icon, or null if there is no icon.","memberof":"Guild","type":{"types":[[["String",""]]]},"meta":{"line":246,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#features","name":"features","description":"An array of guild features.","memberof":"Guild","type":{"types":[[["Array",".<"],["Object",">"]]]},"meta":{"line":251,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#emojis","name":"emojis","description":"An array of guild emojis.","memberof":"Guild","type":{"types":[[["Array",".<"],["Object",">"]]]},"meta":{"line":256,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#afkTimeout","name":"afkTimeout","description":"The time in seconds before a user is counted as \"away from keyboard\".","memberof":"Guild","type":{"types":[[["Number",""]]]},"meta":{"line":261,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#afkChannelID","name":"afkChannelID","description":"The ID of the voice channel where AFK members are moved.","memberof":"Guild","type":{"types":[[["String",""]]]},"meta":{"line":266,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#embedEnabled","name":"embedEnabled","description":"Whether embedded images are enabled on this guild.","memberof":"Guild","type":{"types":[[["Boolean",""]]]},"meta":{"line":271,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#verificationLevel","name":"verificationLevel","description":"The verification level of the guild.","memberof":"Guild","type":{"types":[[["Number",""]]]},"meta":{"line":276,"file":"Guild.js","path":"src/structures"},"props":[]},{"id":"Guild#owner","name":"owner","description":"The owner of the guild","memberof":"Guild","type":{"types":[[["User",""]]]},"meta":{"line":290,"file":"Guild.js","path":"src/structures"},"props":[]}],"events":[]},{"id":"GuildChannel","name":"GuildChannel","description":"Represents a Guild Channel (i.e. Text Channels and Voice Channels)","meta":{"line":27,"file":"GuildChannel.js","path":"src/structures"},"extends":["Channel"],"methods":[{"id":"GuildChannel#equals","name":"equals","description":"Checks if this channel has the same type, topic, position, name, overwrites and ID as another channel.\nIn most cases, a simple `channel.id === channel2.id` will do, and is much faster too.","memberof":"GuildChannel","meta":{"line":73,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["Boolean",""]]]},"params":[{"name":"channel","description":"the channel to compare this channel to","type":{"types":[[["GuildChannel",""]]]}}]},{"id":"GuildChannel#permissionsFor","name":"permissionsFor","description":"Gets the overall set of permissions for a user in this channel, taking into account roles and permission\noverwrites.","memberof":"GuildChannel","meta":{"line":105,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["EvaluatedPermissions",""]]]},"params":[{"name":"member","description":"the user that you want to obtain the overall permissions for","type":{"types":[[["GuildMemberResolvable",""]]]}}]},{"id":"GuildChannel#overwritePermissions","name":"overwritePermissions","description":"Overwrites the permissions for a user or role in this channel.","memberof":"GuildChannel","examples":["// overwrite permissions for a message author\nmessage.channel.overwritePermissions(message.author, {\n SEND_MESSAGES: false\n})\n.then(() => console.log('Done!'))\n.catch(console.log);"],"meta":{"line":185,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["null",", "],["Error",">"]]]},"params":[{"name":"userOrRole","description":"the user or role to update","type":{"types":[[["Role",""]],[["UserResolvable",""]]]}},{"name":"config","description":"the configuration for the update","type":{"types":[[["PermissionOverwriteOptions",""]]]}}]},{"id":"GuildChannel#setName","name":"setName","description":"Set a new name for the Guild Channel","memberof":"GuildChannel","examples":["// set a new channel name\nchannel.setName('not general')\n .then(newChannel => console.log(`Channel's new name is ${newChannel.name}`))\n .catch(console.log);"],"meta":{"line":237,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["GuildChannel",">"]]]},"params":[{"name":"name","description":"the new name for the guild channel","type":{"types":[[["String",""]]]}}]},{"id":"GuildChannel#setPosition","name":"setPosition","description":"Set a new position for the Guild Channel","memberof":"GuildChannel","examples":["// set a new channel position\nchannel.setPosition(2)\n .then(newChannel => console.log(`Channel's new position is ${newChannel.position}`))\n .catch(console.log);"],"meta":{"line":251,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["GuildChannel",">"]]]},"params":[{"name":"position","description":"the new position for the guild channel","type":{"types":[[["Number",""]]]}}]},{"id":"GuildChannel#setTopic","name":"setTopic","description":"Set a new topic for the Guild Channel","memberof":"GuildChannel","examples":["// set a new channel topic\nchannel.setTopic('needs more rate limiting')\n .then(newChannel => console.log(`Channel's new topic is ${newChannel.topic}`))\n .catch(console.log);"],"meta":{"line":265,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["GuildChannel",">"]]]},"params":[{"name":"topic","description":"the new topic for the guild channel","type":{"types":[[["String",""]]]}}]},{"id":"GuildChannel#toString","name":"toString","description":"When concatenated with a String, this automatically concatenates the Channel's name instead of the Channel object.","memberof":"GuildChannel","examples":["// Outputs: Hello from general\nconsole.log(`Hello from ${channel}`);","// Outputs: Hello from general\nconsole.log('Hello from ' + ${channel});"],"meta":{"line":279,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["String",""]]]},"params":[]},{"id":"GuildChannel#delete","name":"delete","description":"Deletes the channel","memberof":"GuildChannel","examples":["// delete the channel\nchannel.delete()\n .then() // success\n .catch(console.log); // log error"],"inherits":"Channel#delete","inherited":true,"meta":{"line":39,"file":"Channel.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Channel",">"]]]},"params":[]}],"properties":[{"id":"GuildChannel#type","name":"type","description":"The type of the Guild Channel","memberof":"GuildChannel","type":{"types":[[["Number",""]]]},"meta":{"line":38,"file":"GuildChannel.js","path":"src/structures"},"props":[]},{"id":"GuildChannel#topic","name":"topic","description":"The topic of the Guild Channel, if there is one.","memberof":"GuildChannel","type":{"types":[[["String",""]]]},"meta":{"line":43,"file":"GuildChannel.js","path":"src/structures"},"props":[]},{"id":"GuildChannel#position","name":"position","description":"The position of the channel in the list.","memberof":"GuildChannel","type":{"types":[[["Number",""]]]},"meta":{"line":48,"file":"GuildChannel.js","path":"src/structures"},"props":[]},{"id":"GuildChannel#name","name":"name","description":"The name of the Guild Channel","memberof":"GuildChannel","type":{"types":[[["String",""]]]},"meta":{"line":53,"file":"GuildChannel.js","path":"src/structures"},"props":[]},{"id":"GuildChannel#permissionOverwrites","name":"permissionOverwrites","description":"A map of permission overwrites in this channel for roles and users.","memberof":"GuildChannel","type":{"types":[[["Collection",".<"],["String",", "],["PermissionOverwrites",">"]]]},"meta":{"line":59,"file":"GuildChannel.js","path":"src/structures"},"props":[]},{"id":"GuildChannel#client","name":"client","description":"The client that instantiated the Channel","memberof":"GuildChannel","type":{"types":[[["Client",""]]]},"meta":{"line":10,"file":"Channel.js","path":"src/structures"},"props":[]},{"id":"GuildChannel#id","name":"id","description":"The unique ID of the channel","memberof":"GuildChannel","type":{"types":[[["String",""]]]},"meta":{"line":27,"file":"Channel.js","path":"src/structures"},"props":[]}],"events":[]},{"id":"GuildMember","name":"GuildMember","description":"Represents a Member of a Guild on Discord","meta":{"line":7,"file":"GuildMember.js","path":"src/structures"},"methods":[{"id":"GuildMember#deleteDM","name":"deleteDM","description":"Deletes any DM's with this Guild Member","memberof":"GuildMember","meta":{"line":138,"file":"GuildMember.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["DMChannel",">"]]]},"params":[]},{"id":"GuildMember#kick","name":"kick","description":"Kick this member from the Guild","memberof":"GuildMember","meta":{"line":146,"file":"GuildMember.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["GuildMember",">"]]]},"params":[]},{"id":"GuildMember#sendMessage","name":"sendMessage","description":"Send a message to this channel","memberof":"GuildMember","examples":["// send a message\nchannel.sendMessage('hello!')\n .then(message => console.log(`Sent message: ${message.content}`))\n .catch(console.log);"],"meta":{"line":28,"file":"TextBasedChannel.js","path":"src/structures/interface"},"returns":{"types":[[["Promise",".<"],["Message",">"]]]},"params":[{"name":"content","description":"the content to send","type":{"types":[[["String",""]]]}},{"name":"options","description":"the options to provide","optional":true,"type":{"types":[[["MessageOptions",""]]]}}],"implements":["TextBasedChannel#sendMessage"]},{"id":"GuildMember#sendTTSMessage","name":"sendTTSMessage","description":"Send a text-to-speech message to this channel","memberof":"GuildMember","examples":["// send a TTS message\nchannel.sendTTSMessage('hello!')\n .then(message => console.log(`Sent tts message: ${message.content}`))\n .catch(console.log);"],"meta":{"line":41,"file":"TextBasedChannel.js","path":"src/structures/interface"},"returns":{"types":[[["Promise",".<"],["Message",">"]]]},"params":[{"name":"content","description":"the content to send","type":{"types":[[["String",""]]]}}],"implements":["TextBasedChannel#sendTTSMessage"]}],"properties":[{"id":"GuildMember#client","name":"client","description":"The client that instantiated this GuildMember","memberof":"GuildMember","type":{"types":[[["Client",""]]]},"meta":{"line":13,"file":"GuildMember.js","path":"src/structures"},"props":[]},{"id":"GuildMember#guild","name":"guild","description":"The guild that this member is part of","memberof":"GuildMember","type":{"types":[[["Guild",""]]]},"meta":{"line":18,"file":"GuildMember.js","path":"src/structures"},"props":[]},{"id":"GuildMember#user","name":"user","description":"The user that this guild member instance Represents","memberof":"GuildMember","type":{"types":[[["User",""]]]},"meta":{"line":23,"file":"GuildMember.js","path":"src/structures"},"props":[]},{"id":"GuildMember#serverDeaf","name":"serverDeaf","description":"Whether this member is deafened server-wide","memberof":"GuildMember","type":{"types":[[["Boolean",""]]]},"meta":{"line":36,"file":"GuildMember.js","path":"src/structures"},"props":[]},{"id":"GuildMember#serverMute","name":"serverMute","description":"Whether this member is muted server-wide","memberof":"GuildMember","type":{"types":[[["Boolean",""]]]},"meta":{"line":41,"file":"GuildMember.js","path":"src/structures"},"props":[]},{"id":"GuildMember#selfMute","name":"selfMute","description":"Whether this member is self-muted","memberof":"GuildMember","type":{"types":[[["Boolean",""]]]},"meta":{"line":46,"file":"GuildMember.js","path":"src/structures"},"props":[]},{"id":"GuildMember#selfDeaf","name":"selfDeaf","description":"Whether this member is self-deafened","memberof":"GuildMember","type":{"types":[[["Boolean",""]]]},"meta":{"line":51,"file":"GuildMember.js","path":"src/structures"},"props":[]},{"id":"GuildMember#voiceSessionID","name":"voiceSessionID","description":"The voice session ID of this member, if any","memberof":"GuildMember","type":{"types":[[["String",""]]]},"meta":{"line":56,"file":"GuildMember.js","path":"src/structures"},"props":[]},{"id":"GuildMember#voiceChannelID","name":"voiceChannelID","description":"The voice channel ID of this member, if any","memberof":"GuildMember","type":{"types":[[["String",""]]]},"meta":{"line":61,"file":"GuildMember.js","path":"src/structures"},"props":[]},{"id":"GuildMember#joinDate","name":"joinDate","description":"The date this member joined the guild","memberof":"GuildMember","type":{"types":[[["Date",""]]]},"meta":{"line":66,"file":"GuildMember.js","path":"src/structures"},"props":[]},{"id":"GuildMember#speaking","name":"speaking","description":"Whether this meember is speaking","memberof":"GuildMember","type":{"types":[[["Boolean",""]]]},"meta":{"line":71,"file":"GuildMember.js","path":"src/structures"},"props":[]},{"id":"GuildMember#roles","name":"roles","description":"A list of roles that are applied to this GuildMember","memberof":"GuildMember","type":{"types":[[["Array",".<"],["Role",">"]]]},"meta":{"line":80,"file":"GuildMember.js","path":"src/structures"},"props":[]},{"id":"GuildMember#mute","name":"mute","description":"Whether this member is muted in any way","memberof":"GuildMember","type":{"types":[[["Boolean",""]]]},"meta":{"line":103,"file":"GuildMember.js","path":"src/structures"},"props":[]},{"id":"GuildMember#deaf","name":"deaf","description":"Whether this member is deafened in any way","memberof":"GuildMember","type":{"types":[[["Boolean",""]]]},"meta":{"line":112,"file":"GuildMember.js","path":"src/structures"},"props":[]},{"id":"GuildMember#voiceChannel","name":"voiceChannel","description":"The voice channel this member is in, if any","memberof":"GuildMember","type":{"types":[[["VoiceChannel",""]]]},"meta":{"line":121,"file":"GuildMember.js","path":"src/structures"},"props":[]},{"id":"GuildMember#id","name":"id","description":"The ID of this User","memberof":"GuildMember","type":{"types":[[["String",""]]]},"meta":{"line":130,"file":"GuildMember.js","path":"src/structures"},"props":[]}],"events":[]},{"id":"Message","name":"Message","description":"Represents a Message on Discord","meta":{"line":5,"file":"Message.js","path":"src/structures"},"methods":[{"id":"Message#equals","name":"equals","description":"Used mainly internally. Whether two messages are identical in properties. If you want to compare messages\nwithout checking all the properties, use `message.id === message2.id`, which is much more efficient. This\nmethod allows you to see if there are differences in content, embeds, attachments, nonce and tts properties.","memberof":"Message","meta":{"line":196,"file":"Message.js","path":"src/structures"},"returns":{"types":[[["Boolean",""]]]},"params":[{"name":"message","description":"The message to compare it to","type":{"types":[[["Message",""]]]}},{"name":"rawData","description":"Raw data passed through the WebSocket about this message","type":{"types":[[["Object",""]]]}}]},{"id":"Message#delete","name":"delete","description":"Deletes the message","memberof":"Message","examples":["// delete a message\nmessage.delete()\n .then(msg => console.log(`Deleted message from ${msg.author}`))\n .catch(console.log);"],"meta":{"line":230,"file":"Message.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Message",", "],["Error",">"]]]},"params":[]},{"id":"Message#edit","name":"edit","description":"Edit the content of a message","memberof":"Message","examples":["// update the content of a message\nmessage.edit('This is my new content!')\n .then(msg => console.log(`Updated the content of a message from ${msg.author}`))\n .catch(console.log);"],"meta":{"line":244,"file":"Message.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Message",", "],["Error",">"]]]},"params":[{"name":"content","description":"the new content of a message","type":{"types":[[["String",""]]]}}]},{"id":"Message#reply","name":"reply","description":"Reply to a message","memberof":"Message","examples":["// reply to a message\nmessage.reply('Hey, I'm a reply!')\n .then(msg => console.log(`Sent a reply to ${msg.author}`))\n .catch(console.log);"],"meta":{"line":259,"file":"Message.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Message",", "],["Error",">"]]]},"params":[{"name":"content","description":"the content of the message","type":{"types":[[["String",""]]]}},{"name":"options","description":"the options to provide","optional":true,"type":{"types":[[["MessageOptions",""]]]}}]}],"properties":[{"id":"Message#channel","name":"channel","description":"The channel that the message was sent in","memberof":"Message","type":{"types":[[["Channel",""]]]},"meta":{"line":11,"file":"Message.js","path":"src/structures"},"props":[]},{"id":"Message#guild","name":"guild","description":"If the message was sent in a guild, this will be the guild the message was sent in","memberof":"Message","type":{"types":[[["Guild",""]]]},"meta":{"line":18,"file":"Message.js","path":"src/structures"},"props":[]},{"id":"Message#client","name":"client","description":"The client that instantiated the Message","memberof":"Message","type":{"types":[[["Client",""]]]},"meta":{"line":25,"file":"Message.js","path":"src/structures"},"props":[]},{"id":"Message#pinned","name":"pinned","description":"Whether or not this message is pinned","memberof":"Message","type":{"types":[[["Boolean",""]]]},"meta":{"line":36,"file":"Message.js","path":"src/structures"},"props":[]},{"id":"Message#author","name":"author","description":"The author of the message","memberof":"Message","type":{"types":[[["User",""]]]},"meta":{"line":41,"file":"Message.js","path":"src/structures"},"props":[]},{"id":"Message#content","name":"content","description":"The content of the message","memberof":"Message","type":{"types":[[["String",""]]]},"meta":{"line":46,"file":"Message.js","path":"src/structures"},"props":[]},{"id":"Message#timestamp","name":"timestamp","description":"When the message was sent","memberof":"Message","type":{"types":[[["Date",""]]]},"meta":{"line":51,"file":"Message.js","path":"src/structures"},"props":[]},{"id":"Message#editedTimestamp","name":"editedTimestamp","description":"If the message was edited, the timestamp at which it was last edited","memberof":"Message","type":{"types":[[["Date",""]]]},"meta":{"line":56,"file":"Message.js","path":"src/structures"},"props":[]},{"id":"Message#tts","name":"tts","description":"Whether or not the message was Text-To-Speech","memberof":"Message","type":{"types":[[["Boolean",""]]]},"meta":{"line":61,"file":"Message.js","path":"src/structures"},"props":[]},{"id":"Message#mentionEveryone","name":"mentionEveryone","description":"Whether the message mentioned @everyone or not","memberof":"Message","type":{"types":[[["Boolean",""]]]},"meta":{"line":66,"file":"Message.js","path":"src/structures"},"props":[]},{"id":"Message#nonce","name":"nonce","description":"A random number used for checking message delivery","memberof":"Message","type":{"types":[[["String",""]]]},"meta":{"line":71,"file":"Message.js","path":"src/structures"},"props":[]},{"id":"Message#embeds","name":"embeds","description":"A list of embeds in the message - e.g. YouTube Player","memberof":"Message","type":{"types":[[["Array",".<"],["Object",">"]]]},"meta":{"line":76,"file":"Message.js","path":"src/structures"},"props":[]},{"id":"Message#attachments","name":"attachments","description":"A list of attachments in the message - e.g. Pictures","memberof":"Message","type":{"types":[[["Array",".<"],["Object",">"]]]},"meta":{"line":81,"file":"Message.js","path":"src/structures"},"props":[]},{"id":"Message#mentions","name":"mentions","description":"An object containing a further users, roles or channels collections","memberof":"Message","type":{"types":[[["Object",""]]]},"meta":{"line":90,"file":"Message.js","path":"src/structures"},"props":[{"name":"mentions.users","description":"Mentioned users, maps their ID to the user object.","type":{"types":[[["Collection",".<"],["String",", "],["User",">"]]]}},{"name":"mentions.roles","description":"Mentioned roles, maps their ID to the role object.","type":{"types":[[["Collection",".<"],["String",", "],["Role",">"]]]}},{"name":"mentions.channels","description":"Mentioned channels, maps their ID to the channel object.","type":{"types":[[["Collection",".<"],["String",", "],["GuildChannel",">"]]]}}]},{"id":"Message#id","name":"id","description":"The ID of the message (unique in the channel it was sent)","memberof":"Message","type":{"types":[[["String",""]]]},"meta":{"line":99,"file":"Message.js","path":"src/structures"},"props":[]}],"events":[]},{"id":"PermissionOverwrites","name":"PermissionOverwrites","description":"Represents a permission overwrite for a Role or Member in a Guild Channel.","meta":{"line":4,"file":"PermissionOverwrites.js","path":"src/structures"},"methods":[],"properties":[{"id":"PermissionOverwrites#channel","name":"channel","description":"The GuildChannel this overwrite is for","memberof":"PermissionOverwrites","type":{"types":[[["GuildChannel",""]]]},"meta":{"line":10,"file":"PermissionOverwrites.js","path":"src/structures"},"props":[]},{"id":"PermissionOverwrites#type","name":"type","description":"The type of this overwrite","memberof":"PermissionOverwrites","type":{"types":[[["String",""]]]},"meta":{"line":21,"file":"PermissionOverwrites.js","path":"src/structures"},"props":[]},{"id":"PermissionOverwrites#id","name":"id","description":"The ID of this overwrite, either a User ID or a Role ID","memberof":"PermissionOverwrites","type":{"types":[[["String",""]]]},"meta":{"line":26,"file":"PermissionOverwrites.js","path":"src/structures"},"props":[]}],"events":[]},{"id":"Role","name":"Role","description":"Represents a Role on Discord","meta":{"line":6,"file":"Role.js","path":"src/structures"},"methods":[{"id":"Role#delete","name":"delete","description":"Deletes the role","memberof":"Role","examples":["// delete a role\nrole.delete()\n .then(r => console.log(`Deleted role ${r}`))\n .catch(console.log);"],"meta":{"line":82,"file":"Role.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Role",", "],["Error",">"]]]},"params":[]},{"id":"Role#edit","name":"edit","description":"Edits the role","memberof":"Role","examples":["// edit a role\nrole.edit({name: 'new role'})\n .then(r => console.log(`Edited role ${r}`))\n .catch(console.log);"],"meta":{"line":96,"file":"Role.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Role",", "],["Error",">"]]]},"params":[{"name":"data","description":"the new data for the role","type":{"types":[[["RoleData",""]]]}}]},{"id":"Role#setName","name":"setName","description":"Set a new name for the role","memberof":"Role","examples":["// set the name of the role\nrole.setName('new role')\n .then(r => console.log(`Edited name of role ${r}`))\n .catch(console.log);"],"meta":{"line":110,"file":"Role.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Role",", "],["Error",">"]]]},"params":[{"name":"name","description":"the new name of the role","type":{"types":[[["String",""]]]}}]},{"id":"Role#setColor","name":"setColor","description":"Set a new color for the role","memberof":"Role","examples":["// set the color of a role\nrole.setColor(parseInt('FF0000', 16))\n .then(r => console.log(`Set color of role ${r}`))\n .catch(console.log);"],"meta":{"line":124,"file":"Role.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Role",", "],["Error",">"]]]},"params":[{"name":"color","description":"the new color for the role","type":{"types":[[["Number",""]]]}}]},{"id":"Role#setHoist","name":"setHoist","description":"Set whether or not the role should be hoisted","memberof":"Role","examples":["// set the hoist of the role\nrole.setHoist(true)\n .then(r => console.log(`Role hoisted: ${r.hoist}`))\n .catch(console.log);"],"meta":{"line":138,"file":"Role.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Role",", "],["Error",">"]]]},"params":[{"name":"hoist","description":"whether or not to hoist the role","type":{"types":[[["Boolean",""]]]}}]},{"id":"Role#setPosition","name":"setPosition","description":"Set the position of the role","memberof":"Role","examples":["// set the position of the role\nrole.setPosition(1)\n .then(r => console.log(`Role position: ${r.position}`))\n .catch(console.log);"],"meta":{"line":152,"file":"Role.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Role",", "],["Error",">"]]]},"params":[{"name":"position","description":"the position of the role","type":{"types":[[["Number",""]]]}}]},{"id":"Role#setPermissions","name":"setPermissions","description":"Set the permissions of the role","memberof":"Role","examples":["// set the permissions of the role\nrole.setPermissions(['KICK_MEMBERS', 'BAN_MEMBERS'])\n .then(r => console.log(`Role updated ${r}`))\n .catch(console.log);"],"meta":{"line":166,"file":"Role.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Role",", "],["Error",">"]]]},"params":[{"name":"permissions","description":"the permissions of the role","type":{"types":[[["Array",".<"],["String",">"]]]}}]},{"id":"Role#serialize","name":"serialize","description":"Get an object mapping permission names to whether or not the role enables that permission","memberof":"Role","examples":["// print the serialized role\nconsole.log(role.serialize());"],"meta":{"line":177,"file":"Role.js","path":"src/structures"},"returns":{"types":[[["Object",".<"],["String",", "],["Boolean",">"]]]},"params":[]},{"id":"Role#hasPermission","name":"hasPermission","description":"Whether or not the role includes the given permission","memberof":"Role","examples":["// see if a role can ban a member\nif (role.hasPermission('BAN_MEMBERS')) {\n console.log('This role can ban members');\n} else {\n console.log('This role can\\'t ban members');\n}"],"meta":{"line":199,"file":"Role.js","path":"src/structures"},"returns":{"types":[[["Boolean",""]]]},"params":[{"name":"permission","description":"the name of the permission to test","type":{"types":[[["String",""]]]}},{"name":"explicit","description":"whether or not the inclusion of the permission is explicit","optional":true,"type":{"types":[[["Boolean",""]]]}}]},{"id":"Role#toString","name":"toString","description":"When concatenated with a String, this automatically concatenates the Role mention rather than the Role object.","memberof":"Role","meta":{"line":221,"file":"Role.js","path":"src/structures"},"returns":{"types":[[["String",""]]]},"params":[]}],"properties":[{"id":"Role#guild","name":"guild","description":"The guild that the role belongs to","memberof":"Role","type":{"types":[[["Guild",""]]]},"meta":{"line":12,"file":"Role.js","path":"src/structures"},"props":[]},{"id":"Role#client","name":"client","description":"The client that instantiated the role","memberof":"Role","type":{"types":[[["Client",""]]]},"meta":{"line":17,"file":"Role.js","path":"src/structures"},"props":[]},{"id":"Role#id","name":"id","description":"The ID of the role (unique to the guild it is part of)","memberof":"Role","type":{"types":[[["String",""]]]},"meta":{"line":40,"file":"Role.js","path":"src/structures"},"props":[]},{"id":"Role#name","name":"name","description":"The name of the role","memberof":"Role","type":{"types":[[["String",""]]]},"meta":{"line":45,"file":"Role.js","path":"src/structures"},"props":[]},{"id":"Role#color","name":"color","description":"The base 10 color of the role","memberof":"Role","type":{"types":[[["Number",""]]]},"meta":{"line":50,"file":"Role.js","path":"src/structures"},"props":[]},{"id":"Role#hoist","name":"hoist","description":"If true, users that are part of this role will appear in a separate category in the users list","memberof":"Role","type":{"types":[[["Boolean",""]]]},"meta":{"line":55,"file":"Role.js","path":"src/structures"},"props":[]},{"id":"Role#position","name":"position","description":"The position of the role in the role manager","memberof":"Role","type":{"types":[[["Number",""]]]},"meta":{"line":60,"file":"Role.js","path":"src/structures"},"props":[]},{"id":"Role#permissions","name":"permissions","description":"The evaluated permissions number","memberof":"Role","type":{"types":[[["Number",""]]]},"meta":{"line":65,"file":"Role.js","path":"src/structures"},"props":[]},{"id":"Role#managed","name":"managed","description":"Whether or not the role is managed by an external service","memberof":"Role","type":{"types":[[["Boolean",""]]]},"meta":{"line":70,"file":"Role.js","path":"src/structures"},"props":[]}],"events":[]},{"id":"TextChannel","name":"TextChannel","description":"Represents a Server Text Channel on Discord.","meta":{"line":10,"file":"TextChannel.js","path":"src/structures"},"extends":["GuildChannel"],"methods":[{"id":"TextChannel#sendMessage","name":"sendMessage","description":"Send a message to this channel","memberof":"TextChannel","examples":["// send a message\nchannel.sendMessage('hello!')\n .then(message => console.log(`Sent message: ${message.content}`))\n .catch(console.log);"],"meta":{"line":28,"file":"TextBasedChannel.js","path":"src/structures/interface"},"returns":{"types":[[["Promise",".<"],["Message",">"]]]},"params":[{"name":"content","description":"the content to send","type":{"types":[[["String",""]]]}},{"name":"options","description":"the options to provide","optional":true,"type":{"types":[[["MessageOptions",""]]]}}],"implements":["TextBasedChannel#sendMessage"]},{"id":"TextChannel#sendTTSMessage","name":"sendTTSMessage","description":"Send a text-to-speech message to this channel","memberof":"TextChannel","examples":["// send a TTS message\nchannel.sendTTSMessage('hello!')\n .then(message => console.log(`Sent tts message: ${message.content}`))\n .catch(console.log);"],"meta":{"line":41,"file":"TextBasedChannel.js","path":"src/structures/interface"},"returns":{"types":[[["Promise",".<"],["Message",">"]]]},"params":[{"name":"content","description":"the content to send","type":{"types":[[["String",""]]]}}],"implements":["TextBasedChannel#sendTTSMessage"]},{"id":"TextChannel#getMessages","name":"getMessages","description":"Gets the past messages sent in this channel. Resolves with a Collection mapping message ID's to Message objects.","memberof":"TextChannel","examples":["// get messages\nchannel.getMessages({limit: 10})\n .then(messages => console.log(`Received ${messages.size} messages`))\n .catch(console.log);"],"meta":{"line":69,"file":"TextBasedChannel.js","path":"src/structures/interface"},"returns":{"types":[[["Promise",".<"],["Collection",".<"],["String",", "],["Message",">, "],["Error",">"]]]},"params":[{"name":"options","description":"the query parameters to pass in","optional":true,"type":{"types":[[["ChannelLogsQueryOptions",""]]]}}],"implements":["TextBasedChannel#getMessages"]},{"id":"TextChannel#equals","name":"equals","description":"Checks if this channel has the same type, topic, position, name, overwrites and ID as another channel.\nIn most cases, a simple `channel.id === channel2.id` will do, and is much faster too.","memberof":"TextChannel","inherits":"GuildChannel#equals","inherited":true,"meta":{"line":73,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["Boolean",""]]]},"params":[{"name":"channel","description":"the channel to compare this channel to","type":{"types":[[["GuildChannel",""]]]}}]},{"id":"TextChannel#permissionsFor","name":"permissionsFor","description":"Gets the overall set of permissions for a user in this channel, taking into account roles and permission\noverwrites.","memberof":"TextChannel","inherits":"GuildChannel#permissionsFor","inherited":true,"meta":{"line":105,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["EvaluatedPermissions",""]]]},"params":[{"name":"member","description":"the user that you want to obtain the overall permissions for","type":{"types":[[["GuildMemberResolvable",""]]]}}]},{"id":"TextChannel#overwritePermissions","name":"overwritePermissions","description":"Overwrites the permissions for a user or role in this channel.","memberof":"TextChannel","examples":["// overwrite permissions for a message author\nmessage.channel.overwritePermissions(message.author, {\n SEND_MESSAGES: false\n})\n.then(() => console.log('Done!'))\n.catch(console.log);"],"inherits":"GuildChannel#overwritePermissions","inherited":true,"meta":{"line":185,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["null",", "],["Error",">"]]]},"params":[{"name":"userOrRole","description":"the user or role to update","type":{"types":[[["Role",""]],[["UserResolvable",""]]]}},{"name":"config","description":"the configuration for the update","type":{"types":[[["PermissionOverwriteOptions",""]]]}}]},{"id":"TextChannel#setName","name":"setName","description":"Set a new name for the Guild Channel","memberof":"TextChannel","examples":["// set a new channel name\nchannel.setName('not general')\n .then(newChannel => console.log(`Channel's new name is ${newChannel.name}`))\n .catch(console.log);"],"inherits":"GuildChannel#setName","inherited":true,"meta":{"line":237,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["GuildChannel",">"]]]},"params":[{"name":"name","description":"the new name for the guild channel","type":{"types":[[["String",""]]]}}]},{"id":"TextChannel#setPosition","name":"setPosition","description":"Set a new position for the Guild Channel","memberof":"TextChannel","examples":["// set a new channel position\nchannel.setPosition(2)\n .then(newChannel => console.log(`Channel's new position is ${newChannel.position}`))\n .catch(console.log);"],"inherits":"GuildChannel#setPosition","inherited":true,"meta":{"line":251,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["GuildChannel",">"]]]},"params":[{"name":"position","description":"the new position for the guild channel","type":{"types":[[["Number",""]]]}}]},{"id":"TextChannel#setTopic","name":"setTopic","description":"Set a new topic for the Guild Channel","memberof":"TextChannel","examples":["// set a new channel topic\nchannel.setTopic('needs more rate limiting')\n .then(newChannel => console.log(`Channel's new topic is ${newChannel.topic}`))\n .catch(console.log);"],"inherits":"GuildChannel#setTopic","inherited":true,"meta":{"line":265,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["GuildChannel",">"]]]},"params":[{"name":"topic","description":"the new topic for the guild channel","type":{"types":[[["String",""]]]}}]},{"id":"TextChannel#toString","name":"toString","description":"When concatenated with a String, this automatically concatenates the Channel's name instead of the Channel object.","memberof":"TextChannel","examples":["// Outputs: Hello from general\nconsole.log(`Hello from ${channel}`);","// Outputs: Hello from general\nconsole.log('Hello from ' + ${channel});"],"inherits":"GuildChannel#toString","inherited":true,"meta":{"line":279,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["String",""]]]},"params":[]}],"properties":[{"id":"TextChannel#lastMessageID","name":"lastMessageID","description":"The ID of the last message in the channel, if one was sent.","memberof":"TextChannel","type":{"types":[[["String",""]]]},"meta":{"line":23,"file":"TextChannel.js","path":"src/structures"},"props":[]},{"id":"TextChannel#messages","name":"messages","description":"A Collection containing the messages sent to this channel.","memberof":"TextChannel","type":{"types":[[["Collection",".<"],["String",", "],["Message",">"]]]},"meta":{"line":15,"file":"TextBasedChannel.js","path":"src/structures/interface"},"props":[]},{"id":"TextChannel#type","name":"type","description":"The type of the Guild Channel","memberof":"TextChannel","type":{"types":[[["Number",""]]]},"meta":{"line":38,"file":"GuildChannel.js","path":"src/structures"},"props":[]},{"id":"TextChannel#topic","name":"topic","description":"The topic of the Guild Channel, if there is one.","memberof":"TextChannel","type":{"types":[[["String",""]]]},"meta":{"line":43,"file":"GuildChannel.js","path":"src/structures"},"props":[]},{"id":"TextChannel#position","name":"position","description":"The position of the channel in the list.","memberof":"TextChannel","type":{"types":[[["Number",""]]]},"meta":{"line":48,"file":"GuildChannel.js","path":"src/structures"},"props":[]},{"id":"TextChannel#name","name":"name","description":"The name of the Guild Channel","memberof":"TextChannel","type":{"types":[[["String",""]]]},"meta":{"line":53,"file":"GuildChannel.js","path":"src/structures"},"props":[]},{"id":"TextChannel#permissionOverwrites","name":"permissionOverwrites","description":"A map of permission overwrites in this channel for roles and users.","memberof":"TextChannel","type":{"types":[[["Collection",".<"],["String",", "],["PermissionOverwrites",">"]]]},"meta":{"line":59,"file":"GuildChannel.js","path":"src/structures"},"props":[]}],"events":[]},{"id":"User","name":"User","description":"Represents a User on Discord.","meta":{"line":7,"file":"User.js","path":"src/structures"},"methods":[{"id":"User#toString","name":"toString","description":"When concatenated with a String, this automatically concatenates the User's mention instead of the User object.","memberof":"User","examples":["// logs: Hello from <@123456789>!\nconsole.log(`Hello from ${user}!`);"],"meta":{"line":64,"file":"User.js","path":"src/structures"},"returns":{"types":[[["String",""]]]},"params":[]},{"id":"User#deleteDM","name":"deleteDM","description":"Deletes a DM Channel (if one exists) between the Client and the User. Resolves with the Channel if successful.","memberof":"User","meta":{"line":72,"file":"User.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["DMChannel",">"]]]},"params":[]},{"id":"User#equals","name":"equals","description":"Checks if the user is equal to another. It compares username, ID, discriminator, status and the game being played.\nIt is recommended to compare equality by using `user.id === user2.id` unless you want to compare all properties.","memberof":"User","meta":{"line":82,"file":"User.js","path":"src/structures"},"returns":{"types":[[["Boolean",""]]]},"params":[{"name":"user","description":"the user to compare","type":{"types":[[["User",""]]]}}]},{"id":"User#sendMessage","name":"sendMessage","description":"Send a message to this channel","memberof":"User","examples":["// send a message\nchannel.sendMessage('hello!')\n .then(message => console.log(`Sent message: ${message.content}`))\n .catch(console.log);"],"meta":{"line":28,"file":"TextBasedChannel.js","path":"src/structures/interface"},"returns":{"types":[[["Promise",".<"],["Message",">"]]]},"params":[{"name":"content","description":"the content to send","type":{"types":[[["String",""]]]}},{"name":"options","description":"the options to provide","optional":true,"type":{"types":[[["MessageOptions",""]]]}}],"implements":["TextBasedChannel#sendMessage"]},{"id":"User#sendTTSMessage","name":"sendTTSMessage","description":"Send a text-to-speech message to this channel","memberof":"User","examples":["// send a TTS message\nchannel.sendTTSMessage('hello!')\n .then(message => console.log(`Sent tts message: ${message.content}`))\n .catch(console.log);"],"meta":{"line":41,"file":"TextBasedChannel.js","path":"src/structures/interface"},"returns":{"types":[[["Promise",".<"],["Message",">"]]]},"params":[{"name":"content","description":"the content to send","type":{"types":[[["String",""]]]}}],"implements":["TextBasedChannel#sendTTSMessage"]}],"properties":[{"id":"User#username","name":"username","description":"The username of the User","memberof":"User","type":{"types":[[["String",""]]]},"meta":{"line":20,"file":"User.js","path":"src/structures"},"props":[]},{"id":"User#id","name":"id","description":"The ID of the User","memberof":"User","type":{"types":[[["String",""]]]},"meta":{"line":25,"file":"User.js","path":"src/structures"},"props":[]},{"id":"User#discriminator","name":"discriminator","description":"A discriminator based on username for the User","memberof":"User","type":{"types":[[["String",""]]]},"meta":{"line":30,"file":"User.js","path":"src/structures"},"props":[]},{"id":"User#avatar","name":"avatar","description":"The ID of the user's avatar","memberof":"User","type":{"types":[[["String",""]]]},"meta":{"line":35,"file":"User.js","path":"src/structures"},"props":[]},{"id":"User#bot","name":"bot","description":"Whether or not the User is a Bot.","memberof":"User","type":{"types":[[["Boolean",""]]]},"meta":{"line":40,"file":"User.js","path":"src/structures"},"props":[]},{"id":"User#status","name":"status","description":"The status of the user:\n\n* **`online`** - user is online\n* **`offline`** - user is offline\n* **`idle`** - user is AFK","memberof":"User","type":{"types":[[["String",""]]]},"meta":{"line":49,"file":"User.js","path":"src/structures"},"props":[]},{"id":"User#game","name":"game","description":"The game that the user is playing, `null` if they aren't playing a game.","memberof":"User","type":{"types":[[["String",""]]]},"meta":{"line":54,"file":"User.js","path":"src/structures"},"props":[]}],"events":[]},{"id":"VoiceChannel","name":"VoiceChannel","description":"Represents a Server Voice Channel on Discord.","meta":{"line":8,"file":"VoiceChannel.js","path":"src/structures"},"extends":["GuildChannel"],"methods":[{"id":"VoiceChannel#setBitrate","name":"setBitrate","description":"Sets the bitrate of the channel","memberof":"VoiceChannel","examples":["// set the bitrate of a voice channel\nvoiceChannel.setBitrate(48000)\n .then(vc => console.log(`Set bitrate to ${vc.bitrate} for ${vc.name}`))\n .catch(console.log);"],"meta":{"line":42,"file":"VoiceChannel.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["VoiceChannel",">"]]]},"params":[{"name":"bitrate","description":"the new bitrate","type":{"types":[[["Number",""]]]}}]},{"id":"VoiceChannel#join","name":"join","description":"Attempts to join this Voice Channel","memberof":"VoiceChannel","examples":["// join a voice channel\nvoiceChannel.join()\n .then(connection => console.log('Connected!'))\n .catch(console.log);"],"meta":{"line":55,"file":"VoiceChannel.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["VoiceConnection",", "],["Error",">"]]]},"params":[]},{"id":"VoiceChannel#equals","name":"equals","description":"Checks if this channel has the same type, topic, position, name, overwrites and ID as another channel.\nIn most cases, a simple `channel.id === channel2.id` will do, and is much faster too.","memberof":"VoiceChannel","inherits":"GuildChannel#equals","inherited":true,"meta":{"line":73,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["Boolean",""]]]},"params":[{"name":"channel","description":"the channel to compare this channel to","type":{"types":[[["GuildChannel",""]]]}}]},{"id":"VoiceChannel#permissionsFor","name":"permissionsFor","description":"Gets the overall set of permissions for a user in this channel, taking into account roles and permission\noverwrites.","memberof":"VoiceChannel","inherits":"GuildChannel#permissionsFor","inherited":true,"meta":{"line":105,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["EvaluatedPermissions",""]]]},"params":[{"name":"member","description":"the user that you want to obtain the overall permissions for","type":{"types":[[["GuildMemberResolvable",""]]]}}]},{"id":"VoiceChannel#overwritePermissions","name":"overwritePermissions","description":"Overwrites the permissions for a user or role in this channel.","memberof":"VoiceChannel","examples":["// overwrite permissions for a message author\nmessage.channel.overwritePermissions(message.author, {\n SEND_MESSAGES: false\n})\n.then(() => console.log('Done!'))\n.catch(console.log);"],"inherits":"GuildChannel#overwritePermissions","inherited":true,"meta":{"line":185,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["null",", "],["Error",">"]]]},"params":[{"name":"userOrRole","description":"the user or role to update","type":{"types":[[["Role",""]],[["UserResolvable",""]]]}},{"name":"config","description":"the configuration for the update","type":{"types":[[["PermissionOverwriteOptions",""]]]}}]},{"id":"VoiceChannel#setName","name":"setName","description":"Set a new name for the Guild Channel","memberof":"VoiceChannel","examples":["// set a new channel name\nchannel.setName('not general')\n .then(newChannel => console.log(`Channel's new name is ${newChannel.name}`))\n .catch(console.log);"],"inherits":"GuildChannel#setName","inherited":true,"meta":{"line":237,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["GuildChannel",">"]]]},"params":[{"name":"name","description":"the new name for the guild channel","type":{"types":[[["String",""]]]}}]},{"id":"VoiceChannel#setPosition","name":"setPosition","description":"Set a new position for the Guild Channel","memberof":"VoiceChannel","examples":["// set a new channel position\nchannel.setPosition(2)\n .then(newChannel => console.log(`Channel's new position is ${newChannel.position}`))\n .catch(console.log);"],"inherits":"GuildChannel#setPosition","inherited":true,"meta":{"line":251,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["GuildChannel",">"]]]},"params":[{"name":"position","description":"the new position for the guild channel","type":{"types":[[["Number",""]]]}}]},{"id":"VoiceChannel#setTopic","name":"setTopic","description":"Set a new topic for the Guild Channel","memberof":"VoiceChannel","examples":["// set a new channel topic\nchannel.setTopic('needs more rate limiting')\n .then(newChannel => console.log(`Channel's new topic is ${newChannel.topic}`))\n .catch(console.log);"],"inherits":"GuildChannel#setTopic","inherited":true,"meta":{"line":265,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["GuildChannel",">"]]]},"params":[{"name":"topic","description":"the new topic for the guild channel","type":{"types":[[["String",""]]]}}]},{"id":"VoiceChannel#toString","name":"toString","description":"When concatenated with a String, this automatically concatenates the Channel's name instead of the Channel object.","memberof":"VoiceChannel","examples":["// Outputs: Hello from general\nconsole.log(`Hello from ${channel}`);","// Outputs: Hello from general\nconsole.log('Hello from ' + ${channel});"],"inherits":"GuildChannel#toString","inherited":true,"meta":{"line":279,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["String",""]]]},"params":[]}],"properties":[{"id":"VoiceChannel#members","name":"members","description":"The members in this Voice Channel.","memberof":"VoiceChannel","type":{"types":[[["Collection",".<"],["String",", "],["GuildMember",">"]]]},"meta":{"line":15,"file":"VoiceChannel.js","path":"src/structures"},"props":[]},{"id":"VoiceChannel#bitrate","name":"bitrate","description":"The bitrate of this voice channel","memberof":"VoiceChannel","type":{"types":[[["Number",""]]]},"meta":{"line":24,"file":"VoiceChannel.js","path":"src/structures"},"props":[]},{"id":"VoiceChannel#userLimit","name":"userLimit","description":"The maximum amount of users allowed in this channel - 0 means unlimited.","memberof":"VoiceChannel","type":{"types":[[["Number",""]]]},"meta":{"line":29,"file":"VoiceChannel.js","path":"src/structures"},"props":[]},{"id":"VoiceChannel#type","name":"type","description":"The type of the Guild Channel","memberof":"VoiceChannel","type":{"types":[[["Number",""]]]},"meta":{"line":38,"file":"GuildChannel.js","path":"src/structures"},"props":[]},{"id":"VoiceChannel#topic","name":"topic","description":"The topic of the Guild Channel, if there is one.","memberof":"VoiceChannel","type":{"types":[[["String",""]]]},"meta":{"line":43,"file":"GuildChannel.js","path":"src/structures"},"props":[]},{"id":"VoiceChannel#position","name":"position","description":"The position of the channel in the list.","memberof":"VoiceChannel","type":{"types":[[["Number",""]]]},"meta":{"line":48,"file":"GuildChannel.js","path":"src/structures"},"props":[]},{"id":"VoiceChannel#name","name":"name","description":"The name of the Guild Channel","memberof":"VoiceChannel","type":{"types":[[["String",""]]]},"meta":{"line":53,"file":"GuildChannel.js","path":"src/structures"},"props":[]},{"id":"VoiceChannel#permissionOverwrites","name":"permissionOverwrites","description":"A map of permission overwrites in this channel for roles and users.","memberof":"VoiceChannel","type":{"types":[[["Collection",".<"],["String",", "],["PermissionOverwrites",">"]]]},"meta":{"line":59,"file":"GuildChannel.js","path":"src/structures"},"props":[]}],"events":[]},{"id":"Collection","name":"Collection","description":"A utility class to help make it easier to access the data stores","meta":{"line":5,"file":"Collection.js","path":"src/util"},"extends":["Map"],"methods":[{"id":"Collection#array","name":"array","description":"Returns an ordered array of the values of this collection.","memberof":"Collection","examples":["// identical to:\nArray.from(collection.values());"],"meta":{"line":14,"file":"Collection.js","path":"src/util"},"returns":{"types":[[["Array",""]]]},"params":[]},{"id":"Collection#first","name":"first","description":"Returns the first item in this collection.","memberof":"Collection","examples":["// identical to:\nArray.from(collection.values())[0];"],"meta":{"line":25,"file":"Collection.js","path":"src/util"},"returns":{"types":[[["Object",""]]]},"params":[]},{"id":"Collection#last","name":"last","description":"Returns the last item in this collection.","memberof":"Collection","meta":{"line":33,"file":"Collection.js","path":"src/util"},"returns":{"types":[[["Object",""]]]},"params":[]},{"id":"Collection#random","name":"random","description":"Returns a random item from this collection.","memberof":"Collection","meta":{"line":42,"file":"Collection.js","path":"src/util"},"returns":{"types":[[["Object",""]]]},"params":[]},{"id":"Collection#findAll","name":"findAll","description":"Returns an array of items where `item[key] === value` of the collection","memberof":"Collection","examples":["collection.getAll('username', 'Bob');"],"meta":{"line":64,"file":"Collection.js","path":"src/util"},"returns":{"types":[[["Array",".<"],["Object",">"]]]},"params":[{"name":"key","description":"the key to filter by","type":{"types":[[["String",""]]]}},{"name":"value","description":"the expected value","type":{"types":[[["any",""]]]}}]},{"id":"Collection#find","name":"find","description":"Returns a single item where `item[key] === value`","memberof":"Collection","examples":["collection.get('id', '123123...');"],"meta":{"line":82,"file":"Collection.js","path":"src/util"},"returns":{"types":[[["Object",""]]]},"params":[{"name":"key","description":"the key to filter by","type":{"types":[[["String",""]]]}},{"name":"value","description":"the expected value","type":{"types":[[["any",""]]]}}]},{"id":"Collection#exists","name":"exists","description":"Returns true if the collection has an item where `item[key] === value`","memberof":"Collection","examples":["if (collection.exists('id', '123123...')) {\n console.log('user here!');\n}"],"meta":{"line":101,"file":"Collection.js","path":"src/util"},"returns":{"types":[[["Object",""]]]},"params":[{"name":"key","description":"the key to filter by","type":{"types":[[["String",""]]]}},{"name":"value","description":"the expected value","type":{"types":[[["any",""]]]}}]}],"properties":[{"id":"Collection#length","name":"length","description":"The length (size) of this collection.","memberof":"Collection","type":{"types":[[["Number",""]]]},"meta":{"line":52,"file":"Collection.js","path":"src/util"},"props":[]}],"events":[]}],"interfaces":[{"id":"TextBasedChannel","name":"TextBasedChannel","description":"Interface for classes that have text-channel-like features","meta":{"line":8,"file":"TextBasedChannel.js","path":"src/structures/interface"},"methods":[{"id":"TextBasedChannel#sendMessage","name":"sendMessage","description":"Send a message to this channel","memberof":"TextBasedChannel","examples":["// send a message\nchannel.sendMessage('hello!')\n .then(message => console.log(`Sent message: ${message.content}`))\n .catch(console.log);"],"meta":{"line":28,"file":"TextBasedChannel.js","path":"src/structures/interface"},"returns":{"types":[[["Promise",".<"],["Message",">"]]]},"params":[{"name":"content","description":"the content to send","type":{"types":[[["String",""]]]}},{"name":"options","description":"the options to provide","optional":true,"type":{"types":[[["MessageOptions",""]]]}}]},{"id":"TextBasedChannel#sendTTSMessage","name":"sendTTSMessage","description":"Send a text-to-speech message to this channel","memberof":"TextBasedChannel","examples":["// send a TTS message\nchannel.sendTTSMessage('hello!')\n .then(message => console.log(`Sent tts message: ${message.content}`))\n .catch(console.log);"],"meta":{"line":41,"file":"TextBasedChannel.js","path":"src/structures/interface"},"returns":{"types":[[["Promise",".<"],["Message",">"]]]},"params":[{"name":"content","description":"the content to send","type":{"types":[[["String",""]]]}}]},{"id":"TextBasedChannel#getMessages","name":"getMessages","description":"Gets the past messages sent in this channel. Resolves with a Collection mapping message ID's to Message objects.","memberof":"TextBasedChannel","examples":["// get messages\nchannel.getMessages({limit: 10})\n .then(messages => console.log(`Received ${messages.size} messages`))\n .catch(console.log);"],"meta":{"line":69,"file":"TextBasedChannel.js","path":"src/structures/interface"},"returns":{"types":[[["Promise",".<"],["Collection",".<"],["String",", "],["Message",">, "],["Error",">"]]]},"params":[{"name":"options","description":"the query parameters to pass in","optional":true,"type":{"types":[[["ChannelLogsQueryOptions",""]]]}}]}],"properties":[{"id":"TextBasedChannel#messages","name":"messages","description":"A Collection containing the messages sent to this channel.","memberof":"TextBasedChannel","type":{"types":[[["Collection",".<"],["String",", "],["Message",">"]]]},"meta":{"line":15,"file":"TextBasedChannel.js","path":"src/structures/interface"},"props":[]}],"events":[]}],"typedefs":[{"id":"UserResolvable","name":"UserResolvable","description":"Data that resolves to give a User object. This can be:\n* A User object\n* A User ID\n* A Message (resolves to the message author)\n* A Guild (owner of the guild)","type":{"types":[[["User",""]],[["String",""]],[["Message",""]],[["Guild",""]]]},"meta":{"line":23,"file":"ClientDataResolver.js","path":"src/client"}},{"id":"GuildResolvable","name":"GuildResolvable","description":"Data that resolves to give a Guild object. This can be:\n* A Guild object","type":{"types":[[["Guild",""]]]},"meta":{"line":51,"file":"ClientDataResolver.js","path":"src/client"}},{"id":"GuildMemberResolvable","name":"GuildMemberResolvable","description":"Data that resolves to give a GuildMember object. This can be:\n* A GuildMember object\n* A User object","type":{"types":[[["Guild",""]]]},"meta":{"line":69,"file":"ClientDataResolver.js","path":"src/client"}},{"id":"Base64Resolvable","name":"Base64Resolvable","description":"Data that resolves to give a Base64 string, typically for image uploading. This can be:\n* A Buffer\n* A Base64 String","type":{"types":[[["Buffer",""]],[["String",""]]]},"meta":{"line":98,"file":"ClientDataResolver.js","path":"src/client"}},{"id":"ChannelResolvable","name":"ChannelResolvable","description":"Data that can be resolved to give a Channel. This can be:\n* An instance of a Channel\n* An ID of a Channel","type":{"types":[[["Channel",""]],[["String",""]]]},"meta":{"line":118,"file":"ClientDataResolver.js","path":"src/client"}},{"id":"StringResolvable","name":"StringResolvable","description":"Data that can be resolved to give a String. This can be:\n* A String\n* An Array (joined with a new line delimiter to give a string)\n* Any object","type":{"types":[[["String",""]],[["Array",""]],[["Object",""]]]},"meta":{"line":142,"file":"ClientDataResolver.js","path":"src/client"}},{"id":"PermissionOverwriteOptions","name":"PermissionOverwriteOptions","description":"An object mapping permission flags to `true` (enabled) or `false` (disabled)\n```js\n{\n 'SEND_MESSAGES': true,\n 'ATTACH_FILES': false,\n}\n```","type":{"types":[[["Object",""]]]},"meta":{"line":161,"file":"GuildChannel.js","path":"src/structures"}},{"id":"ChannelLogsQueryOptions","name":"ChannelLogsQueryOptions","description":"The parameters to pass in when requesting previous messages from a channel. `around`, `before` and\n`after` are mutually exclusive. All the parameters are optional.\n```js\n{\n limit: 30, // the message limit, defaults to 50\n before: '123', // gets messages before the given message ID\n after: '123', // gets messages after the given message ID\n around: '123', // gets messages around the given message ID\n}\n```","type":{"types":[[["Object",""]]]},"meta":{"line":45,"file":"TextBasedChannel.js","path":"src/structures/interface"}},{"id":"ClientOptions","name":"ClientOptions","description":"Options that can be passed to a client:\n```js\n{\n ws: {\n large_threshold: 250,\n compress: true,\n properties: {\n $os: process ? process.platform : 'discord.js',\n $browser: 'discord.js',\n $device: 'discord.js',\n $referrer: '',\n $referring_domain: '',\n },\n },\n protocol_version: 6,\n max_message_cache: 200,\n rest_ws_bridge_timeout: 5000,\n api_request_method: 'sequential',\n shard_id: 0,\n shard_count: 0,\n};\n```","type":{"types":[[["Object",""]]]},"meta":{"line":1,"file":"Constants.js","path":"src/util"}}],"custom":{"general":[{"category":"general","name":"Getting Started","data":"# Welcome!\ndiscord.js is an easy-to-use and intuitive JavaScript library that wraps around the Discord API.\n\n## Installation\nTo install discord.js from npm:\n```bash\nnpm i --save discord.js\n```\n\nTo install discord.js from the master branch:\n```bash\nnpm i --save hydrabolt/discord.js\n```\n\nTo install discord.js from the development branch:\n```bash\nnpm i --save hydrabolt/discord.js#indev\n```\n\nTo install discord.js from the rewrite branch:\n```bash\nnpm i --save hydrabolt/discord.js#indev-rewrite\n```\n\n## Tutorials\nLuckyEvie, a helper in the discord.js channel, has put together a great tutorial on getting to grips with discord.js.\nIt's worth a read and you can find it [here.](https://eslachance.gitbooks.io/discord-js-bot-guide/content/samples/selfbots,_the_awesomest_thing_in_the_universe.html)\n"}],"examples":[{"category":"examples","name":"Ping Pong","data":"```js\n/*\n A ping pong bot, whenever you send \"ping\", it replies \"pong\".\n*/\n\n// import the discord.js module\nconst Discord = require('discord.js');\n\n// create an instance of a Discord Client, and call it bot\nconst bot = new Discord.Client();\n\n// the token of your bot - https://discordapp.com/developers/applications/me\nconst token = 'your bot token here';\n\n// the ready event is vital, it means that your bot will only start reacting to information\n// from Discord _after_ ready is emitted.\nbot.on('ready', () => {\n console.log('I am ready!');\n});\n\n// create an event listener for messages\nbot.on('message', message => {\n // if the message is \"ping\",\n if (message.content === 'ping') {\n // send \"pong\" to the same channel.\n message.channel.sendMessage('pong');\n }\n});\n\n// log our bot in\nbot.login(token);\n\n```"}]}}
\ No newline at end of file
diff --git a/package.json b/package.json
index 68e89f69a..4469dedcb 100644
--- a/package.json
+++ b/package.json
@@ -26,14 +26,15 @@
},
"homepage": "https://github.com/hydrabolt/discord.js#readme",
"dependencies": {
+ "node-opus": "^0.1.13",
"object.values": "^1.0.3",
"superagent": "^1.5.0",
+ "tweetnacl": "^0.14.3",
"ws": "^1.1.1"
},
"devDependencies": {
"fs-extra": "^0.30.0",
- "jsdoc-parse": "^1.2.7",
- "load-grunt-tasks": "^3.3.0"
+ "jsdoc-parse": "^1.2.7"
},
"optionalDependencies": {
"node-opus": "^0.1.11"
diff --git a/src/client/voice/ClientVoiceManager.js b/src/client/voice/ClientVoiceManager.js
index 962c061dd..6fd97dd57 100644
--- a/src/client/voice/ClientVoiceManager.js
+++ b/src/client/voice/ClientVoiceManager.js
@@ -39,8 +39,9 @@ class ClientVoiceManager {
if (pendingRequest.token && pendingRequest.sessionID && pendingRequest.endpoint) {
const { channel, token, sessionID, endpoint, resolve, reject } = pendingRequest;
const voiceConnection = new VoiceConnection(this, channel, token, sessionID, endpoint, resolve, reject);
+ this.pending.delete(guildID);
this.connections.set(guildID, voiceConnection);
- voiceConnection.on('disconnected', () => {
+ voiceConnection.once('disconnected', () => {
this.connections.delete(guildID);
});
}
@@ -102,6 +103,17 @@ class ClientVoiceManager {
*/
joinChannel(channel) {
return new Promise((resolve, reject) => {
+ if (this.pending.get(channel.guild.id)) {
+ return reject(new Error('already connecting to a channel in this guild'));
+ }
+ const existingConn = this.connections.get(channel.guild.id);
+ if (existingConn) {
+ if (existingConn.channel.id !== channel.id) {
+ this._sendWSJoin(channel);
+ this.connections.get(channel.guild.id).channel = channel;
+ }
+ resolve(existingConn);
+ }
this.pending.set(channel.guild.id, {
channel,
sessionID: null,
diff --git a/src/client/voice/VoiceConnection.js b/src/client/voice/VoiceConnection.js
index 2051cfa46..aca3fc6a2 100644
--- a/src/client/voice/VoiceConnection.js
+++ b/src/client/voice/VoiceConnection.js
@@ -2,6 +2,7 @@ const VoiceConnectionWebSocket = require('./VoiceConnectionWebSocket');
const VoiceConnectionUDPClient = require('./VoiceConnectionUDPClient');
const Constants = require('../../util/Constants');
const EventEmitter = require('events').EventEmitter;
+const DefaultPlayer = require('./player/DefaultPlayer');
/**
* Represents a connection to a Voice Channel in Discord
@@ -16,6 +17,11 @@ class VoiceConnection extends EventEmitter {
* @private
*/
this.manager = manager;
+ /**
+ * The player
+ * @type {BasePlayer}
+ */
+ this.player = new DefaultPlayer(this);
/**
* The endpoint of the connection
* @type {String}
@@ -83,12 +89,15 @@ class VoiceConnection extends EventEmitter {
}
_onClose(e) {
+ e = e && e.code === 1000 ? null : e;
return this._shutdown(e);
}
_shutdown(e) {
+ console.log('being shut down! D:');
this.ready = false;
this.websocket._shutdown();
+ this.player._shutdown();
if (this.udp) {
this.udp._shutdown();
}
@@ -105,14 +114,20 @@ class VoiceConnection extends EventEmitter {
this.websocket.on('close', err => this._onClose(err));
this.websocket.on('ready-for-udp', data => {
this.udp = new VoiceConnectionUDPClient(this, data);
+ this.data = data;
this.udp.on('error', err => this._onError(err));
this.udp.on('close', err => this._onClose(err));
});
- this.websocket.on('ready', () => {
+ this.websocket.on('ready', secretKey => {
+ this.data.secret = secretKey;
this.ready = true;
this.emit('ready');
this._resolve(this);
});
+ this.websocket.on('speaking', data => {
+ const guild = this.channel.guild;
+ guild._memberSpeakUpdate(data.user_id, data.speaking);
+ });
}
}
diff --git a/src/client/voice/VoiceConnectionWebSocket.js b/src/client/voice/VoiceConnectionWebSocket.js
index c5faac84e..98fe32b53 100644
--- a/src/client/voice/VoiceConnectionWebSocket.js
+++ b/src/client/voice/VoiceConnectionWebSocket.js
@@ -54,8 +54,13 @@ class VoiceConnectionWebSocket extends EventEmitter {
this.heartbeat = setInterval(() => {
this.send({
op: Constants.VoiceOPCodes.HEARTBEAT,
+ d: null,
});
}, interval);
+ this.send({
+ op: Constants.VoiceOPCodes.HEARTBEAT,
+ d: null,
+ });
}
_onMessage(event) {
@@ -77,7 +82,14 @@ class VoiceConnectionWebSocket extends EventEmitter {
for (const index in packet.d.secret_key) {
this.secretKey[index] = packet.d.secret_key[index];
}
- this.emit('ready');
+ this.emit('ready', this.secretKey);
+ break;
+ case Constants.VoiceOPCodes.SPEAKING:
+ /*
+ { op: 5,
+ d: { user_id: '123123', ssrc: 1, speaking: true } }
+ */
+ this.emit('speaking', packet.d);
break;
default:
this.emit('unknown', packet);
diff --git a/src/client/voice/dispatcher/StreamDispatcher.js b/src/client/voice/dispatcher/StreamDispatcher.js
new file mode 100644
index 000000000..36b066d2e
--- /dev/null
+++ b/src/client/voice/dispatcher/StreamDispatcher.js
@@ -0,0 +1,161 @@
+const EventEmitter = require('events').EventEmitter;
+const NaCl = require('tweetnacl');
+
+const nonce = new Buffer(24);
+nonce.fill(0);
+
+class StreamDispatcher extends EventEmitter {
+ constructor(player, stream) {
+ super();
+ this.player = player;
+ this.stream = stream;
+ this.streamingData = {
+ channels: 2,
+ };
+ this._startStreaming();
+ this._triggered = false;
+ }
+
+ _setSpeaking(value) {
+ this.speaking = value;
+ this.emit('speaking', value);
+ }
+
+ _sendBuffer(buffer, sequence, timestamp) {
+ this.player.connection.udp.send(
+ this._createPacket(sequence, timestamp, this.player.opusEncoder.encode(buffer))
+ );
+ }
+
+ _createPacket(sequence, timestamp, buffer) {
+ const packetBuffer = new Buffer(buffer.length + 28);
+ packetBuffer.fill(0);
+ packetBuffer[0] = 0x80;
+ packetBuffer[1] = 0x78;
+
+ packetBuffer.writeUIntBE(sequence, 2, 2);
+ packetBuffer.writeUIntBE(timestamp, 4, 4);
+ packetBuffer.writeUIntBE(this.player.connection.data.ssrc, 8, 4);
+
+ packetBuffer.copy(nonce, 0, 0, 12);
+ buffer = NaCl.secretbox(buffer, nonce, this.player.connection.data.secret);
+
+ for (let i = 0; i < buffer.length; i++) {
+ packetBuffer[i + 12] = buffer[i];
+ }
+
+ return packetBuffer;
+ }
+
+ _send() {
+ try {
+ if (this._triggered) {
+ return this._setSpeaking(false);
+ }
+ const data = this.streamingData;
+ if (data.missed >= 5) {
+ return this._triggerTerminalState('error', new Error('stream is not generating fast enough'));
+ }
+ if (this.paused) {
+ data.timestamp = (data.timestamp + 4294967295) ? data.timestamp + 960 : 0;
+ return setTimeout(() => this._send(), data.length * 10);
+ }
+ const bufferLength = 1920 * data.channels;
+ this._setSpeaking(true);
+ let buffer = this.stream.read(bufferLength);
+
+ if (!buffer) {
+ data.missed++;
+ return setTimeout(() => this._send(), data.length * 10);
+ }
+
+ data.missed = 0;
+
+ if (buffer.length !== bufferLength) {
+ const newBuffer = new Buffer(bufferLength).fill(0);
+ buffer.copy(newBuffer);
+ buffer = newBuffer;
+ }
+
+ data.count++;
+ data.sequence = (data.sequence + 1) < (65536) ? data.sequence + 1 : 0;
+ data.timestamp = (data.timestamp + 4294967295) ? data.timestamp + 960 : 0;
+
+ this._sendBuffer(buffer, data.sequence, data.timestamp);
+
+ const nextTime = data.startTime + (data.count * data.length);
+
+ setTimeout(() => this._send(), data.length + (nextTime - Date.now()));
+ } catch (e) {
+ this._triggerTerminalState('error', e);
+ }
+ }
+
+ _triggerEnd() {
+ this.emit('end');
+ }
+
+ _triggerError(e) {
+ this.emit('error', e);
+ }
+
+ _triggerTerminalState(state, e) {
+ if (this._triggered) {
+ return;
+ }
+ this.emit('debug', `triggered terminal state ${state} - stream is now dead`);
+ this._triggered = true;
+ this._setSpeaking(false);
+ switch (state) {
+ case 'end':
+ this._triggerEnd(e);
+ break;
+ case 'error':
+ this._triggerError(e);
+ break;
+ default:
+ this.emit('error', 'unknown trigger state');
+ break;
+ }
+ }
+
+ _startStreaming() {
+ if (!this.stream) {
+ return this.emit('error', 'no stream');
+ }
+ this.stream.on('end', e => this._triggerTerminalState('end', e));
+ this.stream.on('error', e => this._triggerTerminalState('error', e));
+ const data = this.streamingData;
+ data.count = 0;
+ data.sequence = 0;
+ data.timestamp = 0;
+ data.length = 20;
+ data.missed = 0;
+ data.startTime = Date.now();
+ this._send();
+ }
+
+ _pause(value) {
+ if (value) {
+ this.paused = true;
+ this._setSpeaking(false);
+ } else {
+ this.paused = false;
+ this._setSpeaking(true);
+ }
+ }
+
+ end() {
+ this._triggerTerminalState('end', 'user requested');
+ }
+
+ pause() {
+ this._pause(true);
+ }
+
+ resume() {
+ this._pause(false);
+ }
+}
+
+module.exports = StreamDispatcher;
diff --git a/src/client/voice/opus/BaseOpusEngine.js b/src/client/voice/opus/BaseOpusEngine.js
new file mode 100644
index 000000000..6c3ba6e34
--- /dev/null
+++ b/src/client/voice/opus/BaseOpusEngine.js
@@ -0,0 +1,15 @@
+class BaseOpus {
+ constructor(player) {
+ this.player = player;
+ }
+
+ encode(buffer) {
+ return buffer;
+ }
+
+ decode(buffer) {
+ return buffer;
+ }
+}
+
+module.exports = BaseOpus;
diff --git a/src/client/voice/opus/NodeOpusEngine.js b/src/client/voice/opus/NodeOpusEngine.js
new file mode 100644
index 000000000..2305174a7
--- /dev/null
+++ b/src/client/voice/opus/NodeOpusEngine.js
@@ -0,0 +1,27 @@
+const OpusEngine = require('./BaseOpusEngine');
+
+let opus;
+
+class NodeOpusEngine extends OpusEngine {
+ constructor(player) {
+ super(player);
+ try {
+ opus = require('node-opus');
+ } catch (err) {
+ throw err;
+ }
+ this.encoder = new opus.OpusEncoder(48000, 2);
+ }
+
+ encode(buffer) {
+ super.encode(buffer);
+ return this.encoder.encode(buffer, 1920);
+ }
+
+ decode(buffer) {
+ super.encode(buffer);
+ return this.encoder.decode(buffer, 1920);
+ }
+}
+
+module.exports = NodeOpusEngine;
diff --git a/src/client/voice/opus/OpusEngineList.js b/src/client/voice/opus/OpusEngineList.js
new file mode 100644
index 000000000..b30a7c860
--- /dev/null
+++ b/src/client/voice/opus/OpusEngineList.js
@@ -0,0 +1,25 @@
+const list = [
+ require('./NodeOpusEngine'),
+];
+
+exports.add = encoder => {
+ list.push(encoder);
+};
+
+function fetch(Encoder) {
+ try {
+ return new Encoder();
+ } catch (err) {
+ return;
+ }
+}
+
+exports.fetch = () => {
+ for (const encoder of list) {
+ const success = fetch(encoder);
+ if (success) {
+ return success;
+ }
+ }
+ throw new Error('could not find an opus engine');
+};
diff --git a/src/client/voice/pcm/ConverterEngine.js b/src/client/voice/pcm/ConverterEngine.js
new file mode 100644
index 000000000..be2ab5f4d
--- /dev/null
+++ b/src/client/voice/pcm/ConverterEngine.js
@@ -0,0 +1,13 @@
+class ConverterEngine {
+
+ constructor(player) {
+ this.player = player;
+ }
+
+ createConvertStream() {
+ return;
+ }
+
+}
+
+module.exports = ConverterEngine;
diff --git a/src/client/voice/pcm/ConverterEngineList.js b/src/client/voice/pcm/ConverterEngineList.js
new file mode 100644
index 000000000..56d430e48
--- /dev/null
+++ b/src/client/voice/pcm/ConverterEngineList.js
@@ -0,0 +1 @@
+exports.fetch = () => require('./FfmpegConverterEngine');
diff --git a/src/client/voice/pcm/FfmpegConverterEngine.js b/src/client/voice/pcm/FfmpegConverterEngine.js
new file mode 100644
index 000000000..78932e13a
--- /dev/null
+++ b/src/client/voice/pcm/FfmpegConverterEngine.js
@@ -0,0 +1,33 @@
+const ConverterEngine = require('./ConverterEngine');
+const ChildProcess = require('child_process');
+
+function chooseCommand() {
+ for (const cmd of ['ffmpeg', 'avconv', './ffmpeg', './avconv']) {
+ if (!ChildProcess.spawnSync(cmd, ['-h']).error) {
+ return cmd;
+ }
+ }
+}
+
+class FfmpegConverterEngine extends ConverterEngine {
+ constructor(player) {
+ super(player);
+ this.command = chooseCommand();
+ }
+
+ createConvertStream() {
+ super.createConvertStream();
+ const encoder = ChildProcess.spawn(this.command, [
+ '-analyzeduration', '0',
+ '-loglevel', '0',
+ '-i', '-',
+ '-f', 's16le',
+ '-ar', '48000',
+ '-ss', '0',
+ 'pipe:1',
+ ], { stdio: ['pipe', 'pipe', 'ignore'] });
+ return encoder;
+ }
+}
+
+module.exports = FfmpegConverterEngine;
diff --git a/src/client/voice/player/BasePlayer.js b/src/client/voice/player/BasePlayer.js
new file mode 100644
index 000000000..973767b88
--- /dev/null
+++ b/src/client/voice/player/BasePlayer.js
@@ -0,0 +1,93 @@
+const OpusEngines = require('../opus/OpusEngineList');
+const ConverterEngines = require('../pcm/ConverterEngineList');
+const Constants = require('../../../util/Constants');
+const StreamDispatcher = require('../dispatcher/StreamDispatcher');
+const EventEmitter = require('events').EventEmitter;
+
+class VoiceConnectionPlayer extends EventEmitter {
+
+ constructor(connection) {
+ super();
+ this.connection = connection;
+ this.opusEncoder = OpusEngines.fetch();
+ const Engine = ConverterEngines.fetch();
+ this.converterEngine = new Engine(this);
+ this.speaking = false;
+ this.processMap = new Map();
+ }
+
+ convertStream(stream) {
+ const encoder = this.converterEngine.createConvertStream();
+ stream.pipe(encoder.stdin);
+ this.processMap.set(encoder.stdout, {
+ pcmConverter: encoder,
+ inputStream: stream,
+ });
+ return encoder.stdout;
+ }
+
+ _shutdown() {
+ for (const stream of this.processMap.keys()) {
+ this.killStream(stream);
+ }
+ }
+
+ killStream(stream) {
+ const streams = this.processMap.get(stream);
+ this.emit('debug', 'cleaning up streams after end/error');
+ if (streams) {
+ if (streams.inputStream && streams.pcmConverter) {
+ try {
+ if (streams.pcmConverter.stdin) {
+ streams.pcmConverter.stdin.end();
+ this.emit('debug', 'stream kill part 1/5 pass');
+ }
+ if (streams.pcmConverter.stdout.destroy) {
+ streams.pcmConverter.stdout.destroy();
+ this.emit('debug', 'stream kill part 2/5 pass');
+ }
+ if (streams.pcmConverter && streams.pcmConverter.kill) {
+ streams.pcmConverter.kill('SIGINT');
+ this.emit('debug', 'stream kill part 3/5 pass');
+ }
+ if (streams.inputStream.unpipe) {
+ streams.inputStream.unpipe(streams.pcmConverter.stdin);
+ this.emit('debug', 'stream kill part 4/5 pass');
+ }
+ if (streams.inputStream.destroy) {
+ streams.inputStream.destroy();
+ this.emit('debug', 'stream kill part 5/5 pass');
+ }
+ } catch (e) {
+ console.log(e);
+ return e;
+ }
+ }
+ }
+ }
+
+ setSpeaking(value) {
+ if (this.speaking === value) {
+ return;
+ }
+ this.speaking = value;
+ this.connection.websocket.send({
+ op: Constants.VoiceOPCodes.SPEAKING,
+ d: {
+ speaking: value,
+ delay: 0,
+ },
+ });
+ }
+
+ playPCMStream(pcmStream) {
+ const dispatcher = new StreamDispatcher(this, pcmStream);
+ dispatcher.on('speaking', value => this.setSpeaking(value));
+ dispatcher.on('end', () => this.killStream(pcmStream));
+ dispatcher.on('error', () => this.killStream(pcmStream));
+ return dispatcher;
+ }
+
+}
+
+module.exports = VoiceConnectionPlayer;
diff --git a/src/client/voice/player/DefaultPlayer.js b/src/client/voice/player/DefaultPlayer.js
new file mode 100644
index 000000000..70ac60080
--- /dev/null
+++ b/src/client/voice/player/DefaultPlayer.js
@@ -0,0 +1,15 @@
+const BasePlayer = require('./BasePlayer');
+const fs = require('fs-extra');
+
+class DefaultPlayer extends BasePlayer {
+
+ playFile(file) {
+ const fileStream = fs.createReadStream(file).on('error', console.log);
+ const pcmStream = this.convertStream(fileStream).on('error', console.log);
+ const dispatcher = this.playPCMStream(pcmStream);
+ return dispatcher;
+ }
+
+}
+
+module.exports = DefaultPlayer;
diff --git a/src/client/websocket/packets/handlers/VoiceStateUpdate.js b/src/client/websocket/packets/handlers/VoiceStateUpdate.js
index 5603ef16d..ba7fe4e81 100644
--- a/src/client/websocket/packets/handlers/VoiceStateUpdate.js
+++ b/src/client/websocket/packets/handlers/VoiceStateUpdate.js
@@ -18,7 +18,12 @@ class VoiceStateUpdateHandler extends AbstractHandler {
member.voiceChannel.members.delete(oldVoiceChannelMember.id);
}
- if (client.voice.pending.has(guild.id)) {
+ // if the member left the voice channel, unset their speaking property
+ if (!data.channel_id) {
+ member.speaking = null;
+ }
+
+ if (client.voice.pending.has(guild.id) && member.user.id === client.user.id && data.channel_id) {
client.voice._receivedVoiceStateUpdate(data.guild_id, data.session_id);
}
diff --git a/src/structures/Guild.js b/src/structures/Guild.js
index 11668e8ba..034601837 100644
--- a/src/structures/Guild.js
+++ b/src/structures/Guild.js
@@ -192,6 +192,14 @@ class Guild {
return base;
}
+ _memberSpeakUpdate(user, speaking) {
+ const member = this.members.get(user);
+ if (member) {
+ member.speaking = speaking;
+ }
+ this.client.emit(Constants.Events.GUILD_MEMBER_SPEAKING, member, speaking);
+ }
+
/**
* Sets up the Guild
* @param {any} data
@@ -288,12 +296,6 @@ class Guild {
}
}
- /**
- * The embed channel of the Guild.
- * @type {GuildChannel}
- */
- this.embedChannel = this.channels.get(data.embed_channel_id);
-
if (data.roles) {
this.roles.clear();
for (const role of data.roles) {
diff --git a/src/structures/GuildMember.js b/src/structures/GuildMember.js
index bc38719dd..4ebb583c5 100644
--- a/src/structures/GuildMember.js
+++ b/src/structures/GuildMember.js
@@ -64,6 +64,11 @@ class GuildMember {
* @type {Date}
*/
this.joinDate = new Date(data.joined_at);
+ /**
+ * Whether this meember is speaking
+ * @type {?Boolean}
+ */
+ this.speaking = this.speaking;
this._roles = data.roles;
}
diff --git a/src/structures/VoiceChannel.js b/src/structures/VoiceChannel.js
index 82cce7569..e4cf5ae6e 100644
--- a/src/structures/VoiceChannel.js
+++ b/src/structures/VoiceChannel.js
@@ -55,6 +55,15 @@ class VoiceChannel extends GuildChannel {
join() {
return this.client.voice.joinChannel(this);
}
+
+ leave() {
+ const exists = this.client.voice.connections.get(this.guild.id);
+ if (exists) {
+ if (exists.channel.id === this.id) {
+ exists.disconnect();
+ }
+ }
+ }
}
module.exports = VoiceChannel;
diff --git a/src/util/Constants.js b/src/util/Constants.js
index 760984324..cfff76fa0 100644
--- a/src/util/Constants.js
+++ b/src/util/Constants.js
@@ -159,6 +159,7 @@ exports.Events = {
MESSAGE_DELETE: 'messageDelete',
MESSAGE_UPDATE: 'messageUpdate',
RECONNECTING: 'reconnecting',
+ GUILD_MEMBER_SPEAKING: 'guildMemberSpeaking',
};
exports.WSEvents = {
diff --git a/test/random.js b/test/random.js
index 3d6f0f844..4c918a16c 100644
--- a/test/random.js
+++ b/test/random.js
@@ -177,6 +177,11 @@ client.on('messageUpdate', (old, message) => {
console.log('Message updated from', old.content, 'to', message.content);
});
+client.on('guildMemberSpeaking', (member, speaking) => {
+ const message = speaking ? `${member.user.username} is speaking` : `${member.user.username} is not speaking`;
+ member.guild.channels.get(member.guild.id).sendMessage(message);
+});
+
client.on('message', msg => {
if (msg.content.startsWith('?raw')) {
msg.channel.sendMessage('```' + msg.content + '```');
@@ -191,3 +196,16 @@ client.on('message', msg => {
}
}
});
+
+let disp;
+
+client.on('message', msg => {
+ if (msg.content.startsWith('/join')) {
+ const chan = msg.content.split(' ').slice(1).join(' ');
+ msg.channel.guild.channels.get(chan).join()
+ .then(conn => {
+ msg.reply('done');
+ })
+ .catch(console.log);
+ }
+})