diff --git a/docs/docs.json b/docs/docs.json index c24d06147..db14380bb 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -1 +1 @@ -{"meta":{"version":2},"custom":{"general":{"Getting Started":"# Welcome!\ndiscord.js is an easy-to-use and intuitive JavaScript library that wraps around the Discord API.\n"}},"json":{"classes":{"Client":{"meta":{"id":"Client","longname":"Client","name":"Client","scope":"global","kind":"class","description":"Creates a new Discord Client\n```js\nconst Discord = require(\"discord.js\");\nconst client = new Discord.Client();\n```","meta":{"lineno":18,"filename":"Client.js","path":"src/client"},"order":0},"functions":[{"id":"Client#login","longname":"Client#login","name":"login","scope":"instance","kind":"function","description":"Logs the client in. If successful, resolves with the account's token.","memberof":"Client","params":[{"type":{"names":["string"]},"description":"The email or token used for the account. If it is an email, a password _must_ be\nprovided.","name":"emailOrToken"},{"type":{"names":["string"]},"optional":true,"description":"The password for the account, only needed if an email was provided.","name":"password"}],"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);"],"returns":[{"type":{"names":["Promise."]}}],"meta":{"lineno":47,"filename":"Client.js","path":"src/client"},"order":1}],"properties":[{"id":"Client#user","longname":"Client#user","name":"user","scope":"instance","kind":"member","description":"The User of the logged in Client, only available after `READY` has been fired.","memberof":"Client","params":[],"type":{"names":["ClientUser"]},"meta":{"lineno":60,"filename":"Client.js","path":"src/client"},"order":2}],"events":[]},"Guild":{"meta":{"id":"Guild","longname":"Guild","name":"Guild","scope":"global","kind":"class","description":"Represents a Guild (or a Server) on Discord.","meta":{"lineno":25,"filename":"Guild.js","path":"src/structures"},"order":3},"functions":[{"id":"Guild#toString","longname":"Guild#toString","name":"toString","scope":"instance","kind":"function","description":"When concatenated with a String, this automatically concatenates the Guild's name instead of the Guild object.","memberof":"Guild","params":[],"examples":["// logs: Hello from My Guild!\nconsole.log(`Hello from ${guild}!`);","// logs: Hello from My Guild!\nconsole.log(`Hello from ' + guild + '!');"],"returns":[{"type":{"names":["String"]}}],"meta":{"lineno":97,"filename":"Guild.js","path":"src/structures"},"order":8},{"id":"Guild#kick","longname":"Guild#kick","name":"kick","scope":"instance","kind":"function","description":"Tries to kick a member from the guild.","memberof":"Guild","params":[{"type":{"names":["GuildMemberResolvable"]},"description":"the member to kick","name":"member"}],"examples":["// kicks a member from a guild:\nguild.kick(message.author)\n .then(member => console.log(`Kicked ${member}`))\n .catch(error => console.log(error));"],"returns":[{"type":{"names":["Promise."]}}],"meta":{"lineno":111,"filename":"Guild.js","path":"src/structures"},"order":9},{"id":"Guild#member","longname":"Guild#member","name":"member","scope":"instance","kind":"function","description":"Returns the GuildMember form of a User object, if the User is present in the guild.","memberof":"Guild","params":[{"type":{"names":["UserResolvable"]},"description":"the user that you want to obtain the GuildMember of.","name":"user"}],"examples":["// get the guild member of a user\nconst member = guild.member(message.author);"],"returns":[{"type":{"names":["GuildMember","null"]}}],"meta":{"lineno":123,"filename":"Guild.js","path":"src/structures"},"order":10},{"id":"Guild#equals","longname":"Guild#equals","name":"equals","scope":"instance","kind":"function","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","params":[{"type":{"names":["Guild"]},"description":"the guild to compare","name":"guild"}],"returns":[{"type":{"names":["Boolean"]}}],"meta":{"lineno":134,"filename":"Guild.js","path":"src/structures"},"order":11},{"id":"Guild#createChannel","longname":"Guild#createChannel","name":"createChannel","scope":"instance","kind":"function","description":"Creates a new Channel in the Guild.","memberof":"Guild","params":[{"type":{"names":["String"]},"description":"the name of the new channel.","name":"name"},{"type":{"names":["any"]},"description":"the type of the new channel, either `text` or `voice`.","name":"type"}],"examples":["// create a new text channel\nguild.createChannel('new general', 'text')\n .then(channel => console.log(`Created new channel ${channel}`))\n .catch(console.log);"],"returns":[{"type":{"names":["Promise.<(TextChannel|VoiceChannel), Error>"]}}],"meta":{"lineno":301,"filename":"Guild.js","path":"src/structures"},"order":27},{"id":"Guild#createRole","longname":"Guild#createRole","name":"createRole","scope":"instance","kind":"function","description":"Creates a new role in the guild, as of now this is just a blank role.","memberof":"Guild","params":[],"examples":["// create a new role\nguild.createRole()\n .then(role => console.log(`Created role ${role}`))\n .catch(console.log);"],"returns":[{"type":{"names":["Promise."]}}],"meta":{"lineno":314,"filename":"Guild.js","path":"src/structures"},"order":28},{"id":"Guild#leave","longname":"Guild#leave","name":"leave","scope":"instance","kind":"function","description":"Causes the Client to leave the guild.","memberof":"Guild","params":[],"examples":["// leave a guild\nguild.leave()\n .then(g => console.log(`Left the guild ${g}`))\n .catch(console.log);"],"returns":[{"type":{"names":["Promise."]}}],"meta":{"lineno":327,"filename":"Guild.js","path":"src/structures"},"order":29},{"id":"Guild#delete","longname":"Guild#delete","name":"delete","scope":"instance","kind":"function","description":"Causes the Client to delete the guild.","memberof":"Guild","params":[],"examples":["// delete a guild\nguild.delete()\n .then(g => console.log(`Deleted the guild ${g}`))\n .catch(console.log);"],"returns":[{"type":{"names":["Promise."]}}],"meta":{"lineno":340,"filename":"Guild.js","path":"src/structures"},"order":30},{"id":"Guild#edit","longname":"Guild#edit","name":"edit","scope":"instance","kind":"function","description":"Updates the Guild with new information - e.g. a new name.","memberof":"Guild","params":[{"type":{"names":["GuildEditData"]},"description":"the data to update the guild with.","name":"data"}],"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);"],"returns":[{"type":{"names":["Promise."]}}],"meta":{"lineno":357,"filename":"Guild.js","path":"src/structures"},"order":31},{"id":"Guild#setName","longname":"Guild#setName","name":"setName","scope":"instance","kind":"function","description":"Edit the name of the Guild.","memberof":"Guild","params":[{"type":{"names":["String"]},"description":"the new name of the Guild.","name":"name"}],"examples":["// edit the guild name\nguild.setName('Discord Guild')\n .then(updated => console.log(`Updated guild name to ${guild.name}`))\n .catch(console.log);"],"returns":[{"type":{"names":["Promise."]}}],"meta":{"lineno":371,"filename":"Guild.js","path":"src/structures"},"order":32},{"id":"Guild#setRegion","longname":"Guild#setRegion","name":"setRegion","scope":"instance","kind":"function","description":"Edit the region of the Guild.","memberof":"Guild","params":[{"type":{"names":["Region"]},"description":"the new region of the guild.","name":"region"}],"examples":["// edit the guild region\nguild.setRegion('london')\n .then(updated => console.log(`Updated guild region to ${guild.region}`))\n .catch(console.log);"],"returns":[{"type":{"names":["Promise."]}}],"meta":{"lineno":385,"filename":"Guild.js","path":"src/structures"},"order":33},{"id":"Guild#setVerificationLevel","longname":"Guild#setVerificationLevel","name":"setVerificationLevel","scope":"instance","kind":"function","description":"Edit the verification level of the Guild.","memberof":"Guild","params":[{"type":{"names":["VerificationLevel"]},"description":"the new verification level of the guild.","name":"verificationLevel"}],"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);"],"returns":[{"type":{"names":["Promise."]}}],"meta":{"lineno":399,"filename":"Guild.js","path":"src/structures"},"order":34},{"id":"Guild#setAFKChannel","longname":"Guild#setAFKChannel","name":"setAFKChannel","scope":"instance","kind":"function","description":"Edit the AFK channel of the Guild.","memberof":"Guild","params":[{"type":{"names":["GuildChannelResolvable"]},"description":"the new AFK channel.","name":"afkChannel"}],"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);"],"returns":[{"type":{"names":["Promise."]}}],"meta":{"lineno":413,"filename":"Guild.js","path":"src/structures"},"order":35},{"id":"Guild#setAFKTimeout","longname":"Guild#setAFKTimeout","name":"setAFKTimeout","scope":"instance","kind":"function","description":"Edit the AFK timeout of the Guild.","memberof":"Guild","params":[{"type":{"names":["Number"]},"description":"the time in seconds that a user must be idle to be considered AFK.","name":"afkTimeout"}],"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);"],"returns":[{"type":{"names":["Promise."]}}],"meta":{"lineno":427,"filename":"Guild.js","path":"src/structures"},"order":36},{"id":"Guild#setIcon","longname":"Guild#setIcon","name":"setIcon","scope":"instance","kind":"function","description":"Set a new Guild Icon.","memberof":"Guild","params":[{"type":{"names":["Base64Resolvable"]},"description":"the new icon of the guild.","name":"icon"}],"examples":["// edit the guild icon\nguild.setIcon(fs.readFileSync('./icon.png'))\n .then(updated => console.log('Updated the guild icon'))\n .catch(console.log);"],"returns":[{"type":{"names":["Promise."]}}],"meta":{"lineno":441,"filename":"Guild.js","path":"src/structures"},"order":37},{"id":"Guild#setOwner","longname":"Guild#setOwner","name":"setOwner","scope":"instance","kind":"function","description":"Sets a new owner of the Guild.","memberof":"Guild","params":[{"type":{"names":["GuildMemberResolvable"]},"description":"the new owner of the Guild.","name":"owner"}],"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);"],"returns":[{"type":{"names":["Promise."]}}],"meta":{"lineno":455,"filename":"Guild.js","path":"src/structures"},"order":38},{"id":"Guild#setSplash","longname":"Guild#setSplash","name":"setSplash","scope":"instance","kind":"function","description":"Set a new Guild Splash Logo.","memberof":"Guild","params":[{"type":{"names":["Base64Resolvable"]},"description":"the new splash screen of the guild.","name":"splash"}],"examples":["// edit the guild splash\nguild.setIcon(fs.readFileSync('./splash.png'))\n .then(updated => console.log('Updated the guild splash'))\n .catch(console.log);"],"returns":[{"type":{"names":["Promise."]}}],"meta":{"lineno":469,"filename":"Guild.js","path":"src/structures"},"order":39}],"properties":[{"id":"Guild#client","longname":"Guild#client","name":"client","scope":"instance","kind":"member","description":"The Client that created the instance of the the Guild.","memberof":"Guild","type":{"names":["Client"]},"meta":{"lineno":31,"filename":"Guild.js","path":"src/structures"},"order":4},{"id":"Guild#store","longname":"Guild#store","name":"store","scope":"instance","kind":"member","description":"The data store of the Guild.","memberof":"Guild","type":{"names":["GuildDataStore"]},"meta":{"lineno":37,"filename":"Guild.js","path":"src/structures"},"order":5},{"id":"Guild#available","longname":"Guild#available","name":"available","scope":"instance","kind":"member","description":"Whether the Guild is available to access. If it is not available, it indicates a server outage.","memberof":"Guild","type":{"names":["Boolean"]},"meta":{"lineno":48,"filename":"Guild.js","path":"src/structures"},"order":6},{"id":"Guild#id","longname":"Guild#id","name":"id","scope":"instance","kind":"member","description":"The Unique ID of the Guild, useful for comparisons.","memberof":"Guild","type":{"names":["String"]},"meta":{"lineno":53,"filename":"Guild.js","path":"src/structures"},"order":7},{"id":"Guild#splash","longname":"Guild#splash","name":"splash","scope":"instance","kind":"member","description":"The hash of the guild splash image, or null if no splash (VIP only)","memberof":"Guild","type":{"names":["String"]},"nullable":true,"meta":{"lineno":169,"filename":"Guild.js","path":"src/structures"},"order":12},{"id":"Guild#region","longname":"Guild#region","name":"region","scope":"instance","kind":"member","description":"The region the guild is located in","memberof":"Guild","type":{"names":["String"]},"meta":{"lineno":174,"filename":"Guild.js","path":"src/structures"},"order":13},{"id":"Guild#name","longname":"Guild#name","name":"name","scope":"instance","kind":"member","description":"The name of the guild","memberof":"Guild","type":{"names":["String"]},"meta":{"lineno":179,"filename":"Guild.js","path":"src/structures"},"order":14},{"id":"Guild#memberCount","longname":"Guild#memberCount","name":"memberCount","scope":"instance","kind":"member","description":"The amount of initial members in the guild.","memberof":"Guild","type":{"names":["Number"]},"meta":{"lineno":184,"filename":"Guild.js","path":"src/structures"},"order":15},{"id":"Guild#large","longname":"Guild#large","name":"large","scope":"instance","kind":"member","description":"Whether the guild is \"large\" (has more than 250 members)","memberof":"Guild","type":{"names":["Boolean"]},"meta":{"lineno":189,"filename":"Guild.js","path":"src/structures"},"order":16},{"id":"Guild#joinDate","longname":"Guild#joinDate","name":"joinDate","scope":"instance","kind":"member","description":"The date at which the logged-in client joined the guild.","memberof":"Guild","type":{"names":["Date"]},"meta":{"lineno":194,"filename":"Guild.js","path":"src/structures"},"order":17},{"id":"Guild#icon","longname":"Guild#icon","name":"icon","scope":"instance","kind":"member","description":"The hash of the guild icon, or null if there is no icon.","memberof":"Guild","type":{"names":["String"]},"nullable":true,"meta":{"lineno":199,"filename":"Guild.js","path":"src/structures"},"order":18},{"id":"Guild#features","longname":"Guild#features","name":"features","scope":"instance","kind":"member","description":"An array of guild features.","memberof":"Guild","type":{"names":["Array."]},"meta":{"lineno":204,"filename":"Guild.js","path":"src/structures"},"order":19},{"id":"Guild#emojis","longname":"Guild#emojis","name":"emojis","scope":"instance","kind":"member","description":"An array of guild emojis.","memberof":"Guild","type":{"names":["Array."]},"meta":{"lineno":209,"filename":"Guild.js","path":"src/structures"},"order":20},{"id":"Guild#afkTimeout","longname":"Guild#afkTimeout","name":"afkTimeout","scope":"instance","kind":"member","description":"The time in seconds before a user is counted as \"away from keyboard\".","memberof":"Guild","type":{"names":["Number"]},"nullable":true,"meta":{"lineno":214,"filename":"Guild.js","path":"src/structures"},"order":21},{"id":"Guild#afkChannelID","longname":"Guild#afkChannelID","name":"afkChannelID","scope":"instance","kind":"member","description":"The ID of the voice channel where AFK members are moved.","memberof":"Guild","type":{"names":["String"]},"nullable":true,"meta":{"lineno":219,"filename":"Guild.js","path":"src/structures"},"order":22},{"id":"Guild#embedEnabled","longname":"Guild#embedEnabled","name":"embedEnabled","scope":"instance","kind":"member","description":"Whether embedded images are enabled on this guild.","memberof":"Guild","type":{"names":["Boolean"]},"meta":{"lineno":224,"filename":"Guild.js","path":"src/structures"},"order":23},{"id":"Guild#verificationLevel","longname":"Guild#verificationLevel","name":"verificationLevel","scope":"instance","kind":"member","description":"The verification level of the guild.","memberof":"Guild","type":{"names":["Number"]},"meta":{"lineno":229,"filename":"Guild.js","path":"src/structures"},"order":24},{"id":"Guild#owner","longname":"Guild#owner","name":"owner","scope":"instance","kind":"member","description":"The owner of the guild","memberof":"Guild","type":{"names":["User"]},"meta":{"lineno":243,"filename":"Guild.js","path":"src/structures"},"order":25},{"id":"Guild#embedChannel","longname":"Guild#embedChannel","name":"embedChannel","scope":"instance","kind":"member","description":"The embed channel of the Guild.","memberof":"Guild","type":{"names":["GuildChannel"]},"meta":{"lineno":256,"filename":"Guild.js","path":"src/structures"},"order":26},{"id":"Guild#channels","longname":"Guild#channels","name":"channels","scope":"instance","kind":"member","description":"The channels in the guild.","memberof":"Guild","params":[],"type":{"names":["Array."]},"readonly":true,"meta":{"lineno":478,"filename":"Guild.js","path":"src/structures"},"order":40},{"id":"Guild#$channels","longname":"Guild#$channels","name":"$channels","scope":"instance","kind":"member","description":"A dictionary mapping the IDs of channels in this guild to the channel itself. If you want to find a channel\nin the guild by ID, use `guild.$channels[id]` rather than filtering `guild.channels` as it is much more efficient.","memberof":"Guild","params":[],"type":{"names":["Object."]},"readonly":true,"meta":{"lineno":486,"filename":"Guild.js","path":"src/structures"},"order":41},{"id":"Guild#roles","longname":"Guild#roles","name":"roles","scope":"instance","kind":"member","description":"The roles in the guild.","memberof":"Guild","params":[],"type":{"names":["Array."]},"readonly":true,"meta":{"lineno":493,"filename":"Guild.js","path":"src/structures"},"order":42},{"id":"Guild#$roles","longname":"Guild#$roles","name":"$roles","scope":"instance","kind":"member","description":"A dictionary mapping the IDs of roles in this guild to the role itself. If you want to find a role\nin the guild by ID, use `guild.$roles[id]` rather than filtering `guild.roles` as it is much more efficient.","memberof":"Guild","params":[],"type":{"names":["Object."]},"readonly":true,"meta":{"lineno":501,"filename":"Guild.js","path":"src/structures"},"order":43},{"id":"Guild#members","longname":"Guild#members","name":"members","scope":"instance","kind":"member","description":"The members of the guild.","memberof":"Guild","params":[],"type":{"names":["Array."]},"readonly":true,"meta":{"lineno":508,"filename":"Guild.js","path":"src/structures"},"order":44},{"id":"Guild#$members","longname":"Guild#$members","name":"$members","scope":"instance","kind":"member","description":"A dictionary mapping the IDs of members in this guild to the member object itself. If you want to find a member\nin the guild by ID, use `guild.$members[id]` rather than filtering `guild.members` as it is much more efficient.","memberof":"Guild","params":[],"type":{"names":["Object."]},"readonly":true,"meta":{"lineno":516,"filename":"Guild.js","path":"src/structures"},"order":45}],"events":[]},"Message":{"meta":{"id":"Message","longname":"Message","name":"Message","scope":"global","kind":"class","description":"Represents a Message on Discord","meta":{"lineno":4,"filename":"Message.js","path":"src/structures"},"order":46},"functions":[],"properties":[],"events":[]},"TextChannel":{"meta":{"id":"TextChannel","longname":"TextChannel","name":"TextChannel","scope":"global","kind":"class","description":"Represents a Server Text Channel on Discord.","meta":{"lineno":8,"filename":"TextChannel.js","path":"src/structures"},"order":47},"functions":[],"properties":[],"events":[]},"User":{"meta":{"id":"User","longname":"User","name":"User","scope":"global","kind":"class","description":"Represents a User on Discord.","meta":{"lineno":6,"filename":"User.js","path":"src/structures"},"order":48},"functions":[{"id":"User#deleteDM","longname":"User#deleteDM","name":"deleteDM","scope":"instance","kind":"function","description":"Deletes a DM Channel (if one exists) between the Client and the User. Resolves with the Channel if successful.","memberof":"User","params":[],"returns":[{"type":{"names":["Promise."]}}],"meta":{"lineno":64,"filename":"User.js","path":"src/structures"},"order":56},{"id":"User#equals","longname":"User#equals","name":"equals","scope":"instance","kind":"function","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","params":[{"type":{"names":["User"]},"description":"the user to compare","name":"user"}],"returns":[{"description":"Boolean"}],"meta":{"lineno":74,"filename":"User.js","path":"src/structures"},"order":57}],"properties":[{"id":"User#username","longname":"User#username","name":"username","scope":"instance","kind":"member","description":"The username of the User","memberof":"User","type":{"names":["String"]},"meta":{"lineno":19,"filename":"User.js","path":"src/structures"},"order":49},{"id":"User#id","longname":"User#id","name":"id","scope":"instance","kind":"member","description":"The ID of the User","memberof":"User","type":{"names":["String"]},"meta":{"lineno":24,"filename":"User.js","path":"src/structures"},"order":50},{"id":"User#discriminator","longname":"User#discriminator","name":"discriminator","scope":"instance","kind":"member","description":"A discriminator based on username for the User","memberof":"User","type":{"names":["String"]},"meta":{"lineno":29,"filename":"User.js","path":"src/structures"},"order":51},{"id":"User#avatar","longname":"User#avatar","name":"avatar","scope":"instance","kind":"member","description":"The ID of the user's avatar","memberof":"User","type":{"names":["String"]},"meta":{"lineno":34,"filename":"User.js","path":"src/structures"},"order":52},{"id":"User#bot","longname":"User#bot","name":"bot","scope":"instance","kind":"member","description":"Whether or not the User is a Bot.","memberof":"User","type":{"names":["Boolean"]},"meta":{"lineno":39,"filename":"User.js","path":"src/structures"},"order":53},{"id":"User#status","longname":"User#status","name":"status","scope":"instance","kind":"member","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":{"names":["String"]},"meta":{"lineno":48,"filename":"User.js","path":"src/structures"},"order":54},{"id":"User#game","longname":"User#game","name":"game","scope":"instance","kind":"member","description":"The game that the user is playing, `null` if they aren't playing a game.","memberof":"User","type":{"names":["String"]},"meta":{"lineno":53,"filename":"User.js","path":"src/structures"},"order":55}],"events":[]},"VoiceChannel":{"meta":{"id":"VoiceChannel","longname":"VoiceChannel","name":"VoiceChannel","scope":"global","kind":"class","description":"Represents a Server Voice Channel on Discord.","meta":{"lineno":7,"filename":"VoiceChannel.js","path":"src/structures"},"order":58},"functions":[],"properties":[],"events":[]}}}} \ No newline at end of file +{"meta":{"version":2},"custom":{"general":{"Getting Started":"# Welcome!\ndiscord.js is an easy-to-use and intuitive JavaScript library that wraps around the Discord API.\n"}},"json":{"classes":{"Client":{"meta":{"id":"Client","longname":"Client","name":"Client","scope":"global","kind":"class","description":"Creates a new Discord Client\n```js\nconst Discord = require(\"discord.js\");\nconst client = new Discord.Client();\n```","meta":{"lineno":18,"filename":"Client.js","path":"src/client"},"order":0},"functions":[{"id":"Client#login","longname":"Client#login","name":"login","scope":"instance","kind":"function","description":"Logs the client in. If successful, resolves with the account's token.","memberof":"Client","params":[{"type":{"names":["string"]},"description":"The email or token used for the account. If it is an email, a password _must_ be\nprovided.","name":"emailOrToken"},{"type":{"names":["string"]},"optional":true,"description":"The password for the account, only needed if an email was provided.","name":"password"}],"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);"],"returns":[{"type":{"names":["Promise."]}}],"meta":{"lineno":47,"filename":"Client.js","path":"src/client"},"order":1}],"properties":[{"id":"Client#user","longname":"Client#user","name":"user","scope":"instance","kind":"member","description":"The User of the logged in Client, only available after `READY` has been fired.","memberof":"Client","params":[],"type":{"names":["ClientUser"]},"meta":{"lineno":60,"filename":"Client.js","path":"src/client"},"order":2}],"events":[]},"Guild":{"meta":{"id":"Guild","longname":"Guild","name":"Guild","scope":"global","kind":"class","description":"Represents a Guild (or a Server) on Discord.","meta":{"lineno":25,"filename":"Guild.js","path":"src/structures"},"order":3},"functions":[{"id":"Guild#toString","longname":"Guild#toString","name":"toString","scope":"instance","kind":"function","description":"When concatenated with a String, this automatically concatenates the Guild's name instead of the Guild object.","memberof":"Guild","params":[],"examples":["// logs: Hello from My Guild!\nconsole.log(`Hello from ${guild}!`);","// logs: Hello from My Guild!\nconsole.log(`Hello from ' + guild + '!');"],"returns":[{"type":{"names":["String"]}}],"meta":{"lineno":97,"filename":"Guild.js","path":"src/structures"},"order":8},{"id":"Guild#kick","longname":"Guild#kick","name":"kick","scope":"instance","kind":"function","description":"Tries to kick a member from the guild.","memberof":"Guild","params":[{"type":{"names":["GuildMemberResolvable"]},"description":"the member to kick","name":"member"}],"examples":["// kicks a member from a guild:\nguild.kick(message.author)\n .then(member => console.log(`Kicked ${member}`))\n .catch(error => console.log(error));"],"returns":[{"type":{"names":["Promise."]}}],"meta":{"lineno":111,"filename":"Guild.js","path":"src/structures"},"order":9},{"id":"Guild#member","longname":"Guild#member","name":"member","scope":"instance","kind":"function","description":"Returns the GuildMember form of a User object, if the User is present in the guild.","memberof":"Guild","params":[{"type":{"names":["UserResolvable"]},"description":"the user that you want to obtain the GuildMember of.","name":"user"}],"examples":["// get the guild member of a user\nconst member = guild.member(message.author);"],"returns":[{"type":{"names":["GuildMember","null"]}}],"meta":{"lineno":123,"filename":"Guild.js","path":"src/structures"},"order":10},{"id":"Guild#equals","longname":"Guild#equals","name":"equals","scope":"instance","kind":"function","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","params":[{"type":{"names":["Guild"]},"description":"the guild to compare","name":"guild"}],"returns":[{"type":{"names":["Boolean"]}}],"meta":{"lineno":134,"filename":"Guild.js","path":"src/structures"},"order":11},{"id":"Guild#createChannel","longname":"Guild#createChannel","name":"createChannel","scope":"instance","kind":"function","description":"Creates a new Channel in the Guild.","memberof":"Guild","params":[{"type":{"names":["String"]},"description":"the name of the new channel.","name":"name"},{"type":{"names":["any"]},"description":"the type of the new channel, either `text` or `voice`.","name":"type"}],"examples":["// create a new text channel\nguild.createChannel('new general', 'text')\n .then(channel => console.log(`Created new channel ${channel}`))\n .catch(console.log);"],"returns":[{"type":{"names":["Promise.<(TextChannel|VoiceChannel), Error>"]}}],"meta":{"lineno":301,"filename":"Guild.js","path":"src/structures"},"order":27},{"id":"Guild#createRole","longname":"Guild#createRole","name":"createRole","scope":"instance","kind":"function","description":"Creates a new role in the guild, as of now this is just a blank role.","memberof":"Guild","params":[],"examples":["// create a new role\nguild.createRole()\n .then(role => console.log(`Created role ${role}`))\n .catch(console.log);"],"returns":[{"type":{"names":["Promise."]}}],"meta":{"lineno":314,"filename":"Guild.js","path":"src/structures"},"order":28},{"id":"Guild#leave","longname":"Guild#leave","name":"leave","scope":"instance","kind":"function","description":"Causes the Client to leave the guild.","memberof":"Guild","params":[],"examples":["// leave a guild\nguild.leave()\n .then(g => console.log(`Left the guild ${g}`))\n .catch(console.log);"],"returns":[{"type":{"names":["Promise."]}}],"meta":{"lineno":327,"filename":"Guild.js","path":"src/structures"},"order":29},{"id":"Guild#delete","longname":"Guild#delete","name":"delete","scope":"instance","kind":"function","description":"Causes the Client to delete the guild.","memberof":"Guild","params":[],"examples":["// delete a guild\nguild.delete()\n .then(g => console.log(`Deleted the guild ${g}`))\n .catch(console.log);"],"returns":[{"type":{"names":["Promise."]}}],"meta":{"lineno":340,"filename":"Guild.js","path":"src/structures"},"order":30},{"id":"Guild#edit","longname":"Guild#edit","name":"edit","scope":"instance","kind":"function","description":"Updates the Guild with new information - e.g. a new name.","memberof":"Guild","params":[{"type":{"names":["GuildEditData"]},"description":"the data to update the guild with.","name":"data"}],"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);"],"returns":[{"type":{"names":["Promise."]}}],"meta":{"lineno":357,"filename":"Guild.js","path":"src/structures"},"order":31},{"id":"Guild#setName","longname":"Guild#setName","name":"setName","scope":"instance","kind":"function","description":"Edit the name of the Guild.","memberof":"Guild","params":[{"type":{"names":["String"]},"description":"the new name of the Guild.","name":"name"}],"examples":["// edit the guild name\nguild.setName('Discord Guild')\n .then(updated => console.log(`Updated guild name to ${guild.name}`))\n .catch(console.log);"],"returns":[{"type":{"names":["Promise."]}}],"meta":{"lineno":371,"filename":"Guild.js","path":"src/structures"},"order":32},{"id":"Guild#setRegion","longname":"Guild#setRegion","name":"setRegion","scope":"instance","kind":"function","description":"Edit the region of the Guild.","memberof":"Guild","params":[{"type":{"names":["Region"]},"description":"the new region of the guild.","name":"region"}],"examples":["// edit the guild region\nguild.setRegion('london')\n .then(updated => console.log(`Updated guild region to ${guild.region}`))\n .catch(console.log);"],"returns":[{"type":{"names":["Promise."]}}],"meta":{"lineno":385,"filename":"Guild.js","path":"src/structures"},"order":33},{"id":"Guild#setVerificationLevel","longname":"Guild#setVerificationLevel","name":"setVerificationLevel","scope":"instance","kind":"function","description":"Edit the verification level of the Guild.","memberof":"Guild","params":[{"type":{"names":["VerificationLevel"]},"description":"the new verification level of the guild.","name":"verificationLevel"}],"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);"],"returns":[{"type":{"names":["Promise."]}}],"meta":{"lineno":399,"filename":"Guild.js","path":"src/structures"},"order":34},{"id":"Guild#setAFKChannel","longname":"Guild#setAFKChannel","name":"setAFKChannel","scope":"instance","kind":"function","description":"Edit the AFK channel of the Guild.","memberof":"Guild","params":[{"type":{"names":["GuildChannelResolvable"]},"description":"the new AFK channel.","name":"afkChannel"}],"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);"],"returns":[{"type":{"names":["Promise."]}}],"meta":{"lineno":413,"filename":"Guild.js","path":"src/structures"},"order":35},{"id":"Guild#setAFKTimeout","longname":"Guild#setAFKTimeout","name":"setAFKTimeout","scope":"instance","kind":"function","description":"Edit the AFK timeout of the Guild.","memberof":"Guild","params":[{"type":{"names":["Number"]},"description":"the time in seconds that a user must be idle to be considered AFK.","name":"afkTimeout"}],"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);"],"returns":[{"type":{"names":["Promise."]}}],"meta":{"lineno":427,"filename":"Guild.js","path":"src/structures"},"order":36},{"id":"Guild#setIcon","longname":"Guild#setIcon","name":"setIcon","scope":"instance","kind":"function","description":"Set a new Guild Icon.","memberof":"Guild","params":[{"type":{"names":["Base64Resolvable"]},"description":"the new icon of the guild.","name":"icon"}],"examples":["// edit the guild icon\nguild.setIcon(fs.readFileSync('./icon.png'))\n .then(updated => console.log('Updated the guild icon'))\n .catch(console.log);"],"returns":[{"type":{"names":["Promise."]}}],"meta":{"lineno":441,"filename":"Guild.js","path":"src/structures"},"order":37},{"id":"Guild#setOwner","longname":"Guild#setOwner","name":"setOwner","scope":"instance","kind":"function","description":"Sets a new owner of the Guild.","memberof":"Guild","params":[{"type":{"names":["GuildMemberResolvable"]},"description":"the new owner of the Guild.","name":"owner"}],"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);"],"returns":[{"type":{"names":["Promise."]}}],"meta":{"lineno":455,"filename":"Guild.js","path":"src/structures"},"order":38},{"id":"Guild#setSplash","longname":"Guild#setSplash","name":"setSplash","scope":"instance","kind":"function","description":"Set a new Guild Splash Logo.","memberof":"Guild","params":[{"type":{"names":["Base64Resolvable"]},"description":"the new splash screen of the guild.","name":"splash"}],"examples":["// edit the guild splash\nguild.setIcon(fs.readFileSync('./splash.png'))\n .then(updated => console.log('Updated the guild splash'))\n .catch(console.log);"],"returns":[{"type":{"names":["Promise."]}}],"meta":{"lineno":469,"filename":"Guild.js","path":"src/structures"},"order":39}],"properties":[{"id":"Guild#client","longname":"Guild#client","name":"client","scope":"instance","kind":"member","description":"The Client that created the instance of the the Guild.","memberof":"Guild","type":{"names":["Client"]},"meta":{"lineno":31,"filename":"Guild.js","path":"src/structures"},"order":4},{"id":"Guild#store","longname":"Guild#store","name":"store","scope":"instance","kind":"member","description":"The data store of the Guild.","memberof":"Guild","type":{"names":["GuildDataStore"]},"meta":{"lineno":37,"filename":"Guild.js","path":"src/structures"},"order":5},{"id":"Guild#available","longname":"Guild#available","name":"available","scope":"instance","kind":"member","description":"Whether the Guild is available to access. If it is not available, it indicates a server outage.","memberof":"Guild","type":{"names":["Boolean"]},"meta":{"lineno":48,"filename":"Guild.js","path":"src/structures"},"order":6},{"id":"Guild#id","longname":"Guild#id","name":"id","scope":"instance","kind":"member","description":"The Unique ID of the Guild, useful for comparisons.","memberof":"Guild","type":{"names":["String"]},"meta":{"lineno":53,"filename":"Guild.js","path":"src/structures"},"order":7},{"id":"Guild#splash","longname":"Guild#splash","name":"splash","scope":"instance","kind":"member","description":"The hash of the guild splash image, or null if no splash (VIP only)","memberof":"Guild","type":{"names":["String"]},"nullable":true,"meta":{"lineno":169,"filename":"Guild.js","path":"src/structures"},"order":12},{"id":"Guild#region","longname":"Guild#region","name":"region","scope":"instance","kind":"member","description":"The region the guild is located in","memberof":"Guild","type":{"names":["String"]},"meta":{"lineno":174,"filename":"Guild.js","path":"src/structures"},"order":13},{"id":"Guild#name","longname":"Guild#name","name":"name","scope":"instance","kind":"member","description":"The name of the guild","memberof":"Guild","type":{"names":["String"]},"meta":{"lineno":179,"filename":"Guild.js","path":"src/structures"},"order":14},{"id":"Guild#memberCount","longname":"Guild#memberCount","name":"memberCount","scope":"instance","kind":"member","description":"The amount of initial members in the guild.","memberof":"Guild","type":{"names":["Number"]},"meta":{"lineno":184,"filename":"Guild.js","path":"src/structures"},"order":15},{"id":"Guild#large","longname":"Guild#large","name":"large","scope":"instance","kind":"member","description":"Whether the guild is \"large\" (has more than 250 members)","memberof":"Guild","type":{"names":["Boolean"]},"meta":{"lineno":189,"filename":"Guild.js","path":"src/structures"},"order":16},{"id":"Guild#joinDate","longname":"Guild#joinDate","name":"joinDate","scope":"instance","kind":"member","description":"The date at which the logged-in client joined the guild.","memberof":"Guild","type":{"names":["Date"]},"meta":{"lineno":194,"filename":"Guild.js","path":"src/structures"},"order":17},{"id":"Guild#icon","longname":"Guild#icon","name":"icon","scope":"instance","kind":"member","description":"The hash of the guild icon, or null if there is no icon.","memberof":"Guild","type":{"names":["String"]},"nullable":true,"meta":{"lineno":199,"filename":"Guild.js","path":"src/structures"},"order":18},{"id":"Guild#features","longname":"Guild#features","name":"features","scope":"instance","kind":"member","description":"An array of guild features.","memberof":"Guild","type":{"names":["Array."]},"meta":{"lineno":204,"filename":"Guild.js","path":"src/structures"},"order":19},{"id":"Guild#emojis","longname":"Guild#emojis","name":"emojis","scope":"instance","kind":"member","description":"An array of guild emojis.","memberof":"Guild","type":{"names":["Array."]},"meta":{"lineno":209,"filename":"Guild.js","path":"src/structures"},"order":20},{"id":"Guild#afkTimeout","longname":"Guild#afkTimeout","name":"afkTimeout","scope":"instance","kind":"member","description":"The time in seconds before a user is counted as \"away from keyboard\".","memberof":"Guild","type":{"names":["Number"]},"nullable":true,"meta":{"lineno":214,"filename":"Guild.js","path":"src/structures"},"order":21},{"id":"Guild#afkChannelID","longname":"Guild#afkChannelID","name":"afkChannelID","scope":"instance","kind":"member","description":"The ID of the voice channel where AFK members are moved.","memberof":"Guild","type":{"names":["String"]},"nullable":true,"meta":{"lineno":219,"filename":"Guild.js","path":"src/structures"},"order":22},{"id":"Guild#embedEnabled","longname":"Guild#embedEnabled","name":"embedEnabled","scope":"instance","kind":"member","description":"Whether embedded images are enabled on this guild.","memberof":"Guild","type":{"names":["Boolean"]},"meta":{"lineno":224,"filename":"Guild.js","path":"src/structures"},"order":23},{"id":"Guild#verificationLevel","longname":"Guild#verificationLevel","name":"verificationLevel","scope":"instance","kind":"member","description":"The verification level of the guild.","memberof":"Guild","type":{"names":["Number"]},"meta":{"lineno":229,"filename":"Guild.js","path":"src/structures"},"order":24},{"id":"Guild#owner","longname":"Guild#owner","name":"owner","scope":"instance","kind":"member","description":"The owner of the guild","memberof":"Guild","type":{"names":["User"]},"meta":{"lineno":243,"filename":"Guild.js","path":"src/structures"},"order":25},{"id":"Guild#embedChannel","longname":"Guild#embedChannel","name":"embedChannel","scope":"instance","kind":"member","description":"The embed channel of the Guild.","memberof":"Guild","type":{"names":["GuildChannel"]},"meta":{"lineno":256,"filename":"Guild.js","path":"src/structures"},"order":26},{"id":"Guild#channels","longname":"Guild#channels","name":"channels","scope":"instance","kind":"member","description":"The channels in the guild.","memberof":"Guild","params":[],"type":{"names":["Array."]},"readonly":true,"meta":{"lineno":478,"filename":"Guild.js","path":"src/structures"},"order":40},{"id":"Guild#$channels","longname":"Guild#$channels","name":"$channels","scope":"instance","kind":"member","description":"A dictionary mapping the IDs of channels in this guild to the channel itself. If you want to find a channel\nin the guild by ID, use `guild.$channels[id]` rather than filtering `guild.channels` as it is much more efficient.","memberof":"Guild","params":[],"type":{"names":["Object."]},"readonly":true,"meta":{"lineno":486,"filename":"Guild.js","path":"src/structures"},"order":41},{"id":"Guild#roles","longname":"Guild#roles","name":"roles","scope":"instance","kind":"member","description":"The roles in the guild.","memberof":"Guild","params":[],"type":{"names":["Array."]},"readonly":true,"meta":{"lineno":493,"filename":"Guild.js","path":"src/structures"},"order":42},{"id":"Guild#$roles","longname":"Guild#$roles","name":"$roles","scope":"instance","kind":"member","description":"A dictionary mapping the IDs of roles in this guild to the role itself. If you want to find a role\nin the guild by ID, use `guild.$roles[id]` rather than filtering `guild.roles` as it is much more efficient.","memberof":"Guild","params":[],"type":{"names":["Object."]},"readonly":true,"meta":{"lineno":501,"filename":"Guild.js","path":"src/structures"},"order":43},{"id":"Guild#members","longname":"Guild#members","name":"members","scope":"instance","kind":"member","description":"The members of the guild.","memberof":"Guild","params":[],"type":{"names":["Array."]},"readonly":true,"meta":{"lineno":508,"filename":"Guild.js","path":"src/structures"},"order":44},{"id":"Guild#$members","longname":"Guild#$members","name":"$members","scope":"instance","kind":"member","description":"A dictionary mapping the IDs of members in this guild to the member object itself. If you want to find a member\nin the guild by ID, use `guild.$members[id]` rather than filtering `guild.members` as it is much more efficient.","memberof":"Guild","params":[],"type":{"names":["Object."]},"readonly":true,"meta":{"lineno":516,"filename":"Guild.js","path":"src/structures"},"order":45}],"events":[]},"Message":{"meta":{"id":"Message","longname":"Message","name":"Message","scope":"global","kind":"class","description":"Represents a Message on Discord","meta":{"lineno":4,"filename":"Message.js","path":"src/structures"},"order":46},"functions":[{"id":"Message#equals","longname":"Message#equals","name":"equals","scope":"instance","kind":"function","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","params":[{"type":{"names":["Message"]},"description":"The message to compare it to","name":"message"},{"type":{"names":["Object"]},"description":"Raw data passed through the WebSocket about this message","name":"rawData"}],"returns":[{"type":{"names":["Boolean"]}}],"meta":{"lineno":149,"filename":"Message.js","path":"src/structures"},"order":61},{"id":"Message#delete","longname":"Message#delete","name":"delete","scope":"instance","kind":"function","description":"Deletes the message","memberof":"Message","params":[],"examples":["// delete a message\nmessage.delete()\n .then(msg => console.log(`Deleted message from ${msg.author}`))\n .catch(console.log);"],"returns":[{"type":{"names":["Promise."]}}],"meta":{"lineno":183,"filename":"Message.js","path":"src/structures"},"order":62},{"id":"Message#edit","longname":"Message#edit","name":"edit","scope":"instance","kind":"function","description":"Edit the content of a message","memberof":"Message","params":[{"type":{"names":["String"]},"description":"the new content of a message","name":"content"}],"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);"],"returns":[{"type":{"names":["Promise."]}}],"meta":{"lineno":197,"filename":"Message.js","path":"src/structures"},"order":63}],"properties":[{"id":"Message#channel","longname":"Message#channel","name":"channel","scope":"instance","kind":"member","description":"The channel that the message was sent in","memberof":"Message","type":{"names":["Channel"]},"meta":{"lineno":10,"filename":"Message.js","path":"src/structures"},"order":47},{"id":"Message#guild","longname":"Message#guild","name":"guild","scope":"instance","kind":"member","description":"If the message was sent in a guild, this will be the guild the message was sent in","memberof":"Message","type":{"names":["Guild"]},"nullable":true,"meta":{"lineno":17,"filename":"Message.js","path":"src/structures"},"order":48},{"id":"Message#client","longname":"Message#client","name":"client","scope":"instance","kind":"member","description":"The client that instantiated the Object","memberof":"Message","type":{"names":["Client"]},"meta":{"lineno":24,"filename":"Message.js","path":"src/structures"},"order":49},{"id":"Message#author","longname":"Message#author","name":"author","scope":"instance","kind":"member","description":"The author of the message","memberof":"Message","type":{"names":["User"]},"meta":{"lineno":35,"filename":"Message.js","path":"src/structures"},"order":50},{"id":"Message#content","longname":"Message#content","name":"content","scope":"instance","kind":"member","description":"The content of the message","memberof":"Message","type":{"names":["String"]},"meta":{"lineno":40,"filename":"Message.js","path":"src/structures"},"order":51},{"id":"Message#timestamp","longname":"Message#timestamp","name":"timestamp","scope":"instance","kind":"member","description":"When the message was sent","memberof":"Message","type":{"names":["Date"]},"meta":{"lineno":45,"filename":"Message.js","path":"src/structures"},"order":52},{"id":"Message#editedTimestamp","longname":"Message#editedTimestamp","name":"editedTimestamp","scope":"instance","kind":"member","description":"If the message was edited, the timestamp at which it was last edited","memberof":"Message","type":{"names":["Date"]},"nullable":true,"meta":{"lineno":50,"filename":"Message.js","path":"src/structures"},"order":53},{"id":"Message#tts","longname":"Message#tts","name":"tts","scope":"instance","kind":"member","description":"Whether or not the message was Text-To-Speech","memberof":"Message","type":{"names":["Boolean"]},"meta":{"lineno":55,"filename":"Message.js","path":"src/structures"},"order":54},{"id":"Message#mentionEveryone","longname":"Message#mentionEveryone","name":"mentionEveryone","scope":"instance","kind":"member","description":"Whether the message mentioned @everyone or not","memberof":"Message","type":{"names":["Boolean"]},"meta":{"lineno":60,"filename":"Message.js","path":"src/structures"},"order":55},{"id":"Message#nonce","longname":"Message#nonce","name":"nonce","scope":"instance","kind":"member","description":"A random number used for checking message delivery","memberof":"Message","type":{"names":["String"]},"meta":{"lineno":65,"filename":"Message.js","path":"src/structures"},"order":56},{"id":"Message#embeds","longname":"Message#embeds","name":"embeds","scope":"instance","kind":"member","description":"A list of embeds in the message - e.g. YouTube Player","memberof":"Message","type":{"names":["Array."]},"meta":{"lineno":70,"filename":"Message.js","path":"src/structures"},"order":57},{"id":"Message#attachments","longname":"Message#attachments","name":"attachments","scope":"instance","kind":"member","description":"A list of attachments in the message - e.g. Pictures","memberof":"Message","type":{"names":["Array."]},"meta":{"lineno":75,"filename":"Message.js","path":"src/structures"},"order":58},{"id":"Message#mentions","longname":"Message#mentions","name":"mentions","scope":"instance","kind":"member","description":"A list of users mentioned in the message","memberof":"Message","type":{"names":["Array."]},"meta":{"lineno":80,"filename":"Message.js","path":"src/structures"},"order":59},{"id":"Message#id","longname":"Message#id","name":"id","scope":"instance","kind":"member","description":"The ID of the message (unique in the channel it was sent)","memberof":"Message","meta":{"lineno":84,"filename":"Message.js","path":"src/structures"},"order":60}],"events":[]},"TextChannel":{"meta":{"id":"TextChannel","longname":"TextChannel","name":"TextChannel","scope":"global","kind":"class","description":"Represents a Server Text Channel on Discord.","meta":{"lineno":8,"filename":"TextChannel.js","path":"src/structures"},"order":64},"functions":[],"properties":[],"events":[]},"User":{"meta":{"id":"User","longname":"User","name":"User","scope":"global","kind":"class","description":"Represents a User on Discord.","meta":{"lineno":6,"filename":"User.js","path":"src/structures"},"order":65},"functions":[{"id":"User#deleteDM","longname":"User#deleteDM","name":"deleteDM","scope":"instance","kind":"function","description":"Deletes a DM Channel (if one exists) between the Client and the User. Resolves with the Channel if successful.","memberof":"User","params":[],"returns":[{"type":{"names":["Promise."]}}],"meta":{"lineno":64,"filename":"User.js","path":"src/structures"},"order":73},{"id":"User#equals","longname":"User#equals","name":"equals","scope":"instance","kind":"function","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","params":[{"type":{"names":["User"]},"description":"the user to compare","name":"user"}],"returns":[{"description":"Boolean"}],"meta":{"lineno":74,"filename":"User.js","path":"src/structures"},"order":74}],"properties":[{"id":"User#username","longname":"User#username","name":"username","scope":"instance","kind":"member","description":"The username of the User","memberof":"User","type":{"names":["String"]},"meta":{"lineno":19,"filename":"User.js","path":"src/structures"},"order":66},{"id":"User#id","longname":"User#id","name":"id","scope":"instance","kind":"member","description":"The ID of the User","memberof":"User","type":{"names":["String"]},"meta":{"lineno":24,"filename":"User.js","path":"src/structures"},"order":67},{"id":"User#discriminator","longname":"User#discriminator","name":"discriminator","scope":"instance","kind":"member","description":"A discriminator based on username for the User","memberof":"User","type":{"names":["String"]},"meta":{"lineno":29,"filename":"User.js","path":"src/structures"},"order":68},{"id":"User#avatar","longname":"User#avatar","name":"avatar","scope":"instance","kind":"member","description":"The ID of the user's avatar","memberof":"User","type":{"names":["String"]},"meta":{"lineno":34,"filename":"User.js","path":"src/structures"},"order":69},{"id":"User#bot","longname":"User#bot","name":"bot","scope":"instance","kind":"member","description":"Whether or not the User is a Bot.","memberof":"User","type":{"names":["Boolean"]},"meta":{"lineno":39,"filename":"User.js","path":"src/structures"},"order":70},{"id":"User#status","longname":"User#status","name":"status","scope":"instance","kind":"member","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":{"names":["String"]},"meta":{"lineno":48,"filename":"User.js","path":"src/structures"},"order":71},{"id":"User#game","longname":"User#game","name":"game","scope":"instance","kind":"member","description":"The game that the user is playing, `null` if they aren't playing a game.","memberof":"User","type":{"names":["String"]},"meta":{"lineno":53,"filename":"User.js","path":"src/structures"},"order":72}],"events":[]},"VoiceChannel":{"meta":{"id":"VoiceChannel","longname":"VoiceChannel","name":"VoiceChannel","scope":"global","kind":"class","description":"Represents a Server Voice Channel on Discord.","meta":{"lineno":7,"filename":"VoiceChannel.js","path":"src/structures"},"order":75},"functions":[],"properties":[],"events":[]}}}} \ No newline at end of file diff --git a/src/structures/Message.js b/src/structures/Message.js index c225fe697..132086236 100644 --- a/src/structures/Message.js +++ b/src/structures/Message.js @@ -3,12 +3,24 @@ */ class Message { constructor(channel, data, client) { + /** + * The channel that the message was sent in + * @type {Channel} + */ this.channel = channel; if (channel.guild) { + /** + * If the message was sent in a guild, this will be the guild the message was sent in + * @type {?Guild} + */ this.guild = channel.guild; } + /** + * The client that instantiated the Object + * @type {Client} + */ this.client = client; if (data) { this.setup(data); @@ -16,16 +28,59 @@ class Message { } setup(data) { + /** + * The author of the message + * @type {User} + */ this.author = this.client.store.newUser(data.author); + /** + * The content of the message + * @type {String} + */ this.content = data.content; + /** + * When the message was sent + * @type {Date} + */ this.timestamp = new Date(data.timestamp); + /** + * If the message was edited, the timestamp at which it was last edited + * @type {?Date} + */ this.editedTimestamp = data.edited_timestamp ? new Date(data.edited_timestamp) : null; + /** + * Whether or not the message was Text-To-Speech + * @type {Boolean} + */ this.tts = data.tts; + /** + * Whether the message mentioned @everyone or not + * @type {Boolean} + */ this.mentionEveryone = data.mention_everyone; + /** + * A random number used for checking message delivery + * @type {String} + */ this.nonce = data.nonce; + /** + * A list of embeds in the message - e.g. YouTube Player + * @type {Array} + */ this.embeds = data.embeds; + /** + * A list of attachments in the message - e.g. Pictures + * @type {Array} + */ this.attachments = data.attachments; + /** + * A list of users mentioned in the message + * @type {Array} + */ this.mentions = []; + /** + * The ID of the message (unique in the channel it was sent) + */ this.id = data.id; for (const mention of data.mentions) { let user = this.client.store.get('users', mention.id); @@ -83,6 +138,14 @@ class Message { } } + /** + * Used mainly internally. Whether two messages are identical in properties. If you want to compare messages + * without checking all the properties, use `message.id === message2.id`, which is much more efficient. This + * method allows you to see if there are differences in content, embeds, attachments, nonce and tts properties. + * @param {Message} message The message to compare it to + * @param {Object} rawData Raw data passed through the WebSocket about this message + * @returns {Boolean} + */ equals(message, rawData) { const embedUpdate = !message.author && !message.attachments; @@ -108,10 +171,29 @@ class Message { return base; } + /** + * Deletes the message + * @returns {Promise} + * @example + * // delete a message + * message.delete() + * .then(msg => console.log(`Deleted message from ${msg.author}`)) + * .catch(console.log); + */ delete() { return this.client.rest.methods.deleteMessage(this); } + /** + * Edit the content of a message + * @param {String} content the new content of a message + * @returns {Promise} + * @example + * // update the content of a message + * message.edit('This is my new content!') + * .then(msg => console.log(`Updated the content of a message from ${msg.author}`)) + * .catch(console.log); + */ edit(content) { return this.client.rest.methods.updateMessage(this, content); }