Files
discord.js/docs/docs.json
2016-08-21 17:26:38 +01:00

1 line
20 KiB
JSON

{"meta":{"version":10,"date":1471796798712},"classes":[{"id":"Client","name":"Client","description":"Creates a new Discord Client\n```js\nconst Discord = require(\"discord.js\");\nconst client = new Discord.Client();\n```","meta":{"line":18,"file":"Client.js","path":"src/client"},"classConstructor":{"id":"Client()","name":"Client","description":"Creates an instance of Client.","memberof":"Client"},"methods":[{"id":"Client#login","name":"login","description":"Logs the client in. If successful, resolves with the account's token. <warn>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.</warn>","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":120,"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.","type":{"types":[[["String",""]]]}}]}],"properties":[{"id":"Client#password","name":"password","description":"The password, if there is one, for the logged in Client","memberof":"Client","type":{"types":[[["String",""]]]},"meta":{"line":98,"file":"Client.js","path":"src/client"}}],"events":[{"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":91,"file":"Guild.js","path":"src/structures"}}]},{"id":"ClientDataResolver","name":"ClientDataResolver","description":"The DataResolver identifies different objects and tries to resolve a specific piece of information from them, e.g.\nextracting a User from a Message object.","meta":{"line":18,"file":"ClientDataResolver.js","path":"src/client"},"access":"private","methods":[{"id":"ClientDataResolver#resolveString","name":"resolveString","description":"Resolves a StringResolvable to a String","memberof":"ClientDataResolver","meta":{"line":155,"file":"ClientDataResolver.js","path":"src/client"},"returns":{"types":[[["String",""]]]},"params":[{"name":"stringResolvable","description":"the string resolvable to resolve","type":{"types":[[["StringResolvable",""]]]}}]}],"properties":[],"events":[]},{"id":"ClientManager","name":"ClientManager","description":"Manages the State and Background Tasks of the Client","meta":{"line":7,"file":"ClientManager.js","path":"src/client"},"access":"private","methods":[{"id":"ClientManager#setupKeepAlive","name":"setupKeepAlive","description":"Sets up a keep-alive interval to keep the Client's connection valid","memberof":"ClientManager","meta":{"line":46,"file":"ClientManager.js","path":"src/client"},"returns":{"types":[[["null",""]]]},"params":[{"name":"time","description":"the interval in milliseconds at which heartbeat packets should be sent","type":{"types":[[["Number",""]]]}}]}],"properties":[{"id":"ClientManager#heartbeatInterval","name":"heartbeatInterval","description":"The heartbeat interval, null if not yet set","memberof":"ClientManager","type":{"types":[[["Number",""]]]},"meta":{"line":19,"file":"ClientManager.js","path":"src/client"}}],"events":[]},{"id":"RequestHandler","name":"RequestHandler","description":"A base class for different types of rate limiting handlers for the REST API.","meta":{"line":5,"file":"RequestHandler.js","path":"src/client/rest/RequestHandlers"},"access":"private","methods":[{"id":"RequestHandler#handle","name":"handle","description":"Attempts to get this RequestHandler to process its current queue","memberof":"RequestHandler","meta":{"line":43,"file":"RequestHandler.js","path":"src/client/rest/RequestHandlers"},"returns":{"types":[[["null",""]]]},"params":[]}],"properties":[{"id":"RequestHandler#globalLimit","name":"globalLimit","description":"Whether or not the client is being rate limited on every endpoint.","memberof":"RequestHandler","type":{"types":[[["Boolean",""]]]},"meta":{"line":24,"file":"RequestHandler.js","path":"src/client/rest/RequestHandlers"}}],"events":[]},{"id":"SequentialRequestHandler","name":"SequentialRequestHandler","description":"Handles API Requests sequentially, i.e. we wait until the current request is finished before moving onto\nthe next. This plays a _lot_ nicer in terms of avoiding 429's when there is more than one session of the account,\nbut it can be slower.","meta":{"line":10,"file":"Sequential.js","path":"src/client/rest/RequestHandlers"},"extends":["RequestHandler"],"access":"private","methods":[{"id":"SequentialRequestHandler#handle","name":"handle","description":"Attempts to get this RequestHandler to process its current queue","memberof":"SequentialRequestHandler","inherits":"RequestHandler#handle","inherited":true,"meta":{"line":43,"file":"RequestHandler.js","path":"src/client/rest/RequestHandlers"},"returns":{"types":[[["null",""]]]},"params":[]}],"properties":[{"id":"SequentialRequestHandler#globalLimit","name":"globalLimit","description":"Whether or not the client is being rate limited on every endpoint.","memberof":"SequentialRequestHandler","type":{"types":[[["Boolean",""]]]},"meta":{"line":24,"file":"RequestHandler.js","path":"src/client/rest/RequestHandlers"}}],"events":[]},{"id":"WebSocketManager","name":"WebSocketManager","description":"The WebSocket Manager of the Client","meta":{"line":10,"file":"WebSocketManager.js","path":"src/client/websocket"},"access":"private","methods":[{"id":"WebSocketManager#tryReconnect","name":"tryReconnect","description":"Tries to reconnect the client, changing the status to Constants.Status.RECONNECTING.","memberof":"WebSocketManager","meta":{"line":200,"file":"WebSocketManager.js","path":"src/client/websocket"},"returns":{"types":[[["null",""]]]},"params":[]}],"properties":[{"id":"WebSocketManager#ws","name":"ws","description":"The WebSocket connection to the gateway","memberof":"WebSocketManager","type":{"types":[[["WebSocket",""]]]},"meta":{"line":64,"file":"WebSocketManager.js","path":"src/client/websocket"}}],"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#id","name":"id","description":"The unique ID of the channel","memberof":"Channel","type":{"types":[[["String",""]]]},"meta":{"line":27,"file":"Channel.js","path":"src/structures"}}],"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#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":38,"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#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"}}],"events":[]},{"id":"DMChannel","name":"DMChannel","description":"Represents a Direct Message Channel between two users.","meta":{"line":10,"file":"DMChannel.js","path":"src/structures"},"extends":["Channel"],"methods":[{"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#id","name":"id","description":"The unique ID of the channel","memberof":"DMChannel","type":{"types":[[["String",""]]]},"meta":{"line":27,"file":"Channel.js","path":"src/structures"}}],"events":[]},{"id":"Guild","name":"Guild","description":"Represents a Guild (or a Server) on Discord.","meta":{"line":24,"file":"Guild.js","path":"src/structures"},"methods":[{"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":496,"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#embedChannel","name":"embedChannel","description":"The embed channel of the Guild.","memberof":"Guild","type":{"types":[[["GuildChannel",""]]]},"meta":{"line":282,"file":"Guild.js","path":"src/structures"}}],"events":[]},{"id":"GuildChannel","name":"GuildChannel","description":"Represents a Guild Channel (i.e. Text Channels and Voice Channels)","meta":{"line":25,"file":"GuildChannel.js","path":"src/structures"},"extends":["Channel"],"methods":[{"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#id","name":"id","description":"The unique ID of the channel","memberof":"GuildChannel","type":{"types":[[["String",""]]]},"meta":{"line":27,"file":"Channel.js","path":"src/structures"}}],"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#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":38,"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#id","name":"id","description":"The ID of this User","memberof":"GuildMember","type":{"types":[[["String",""]]]},"meta":{"line":125,"file":"GuildMember.js","path":"src/structures"}}],"events":[]},{"id":"Message","name":"Message","description":"Represents a Message on Discord","meta":{"line":4,"file":"Message.js","path":"src/structures"},"methods":[{"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":198,"file":"Message.js","path":"src/structures"},"returns":{"types":[[["Promise",".<"],["Message",", "],["Error",">"]]]},"params":[{"name":"content","description":"the new content of a message","type":{"types":[[["String",""]]]}}]}],"properties":[{"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":85,"file":"Message.js","path":"src/structures"}}],"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#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"}}],"events":[]},{"id":"Role","name":"Role","description":"Represents a Role on Discord","meta":{"line":6,"file":"Role.js","path":"src/structures"},"methods":[{"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","type":{"types":[[["Boolean",""]]]}}]}],"properties":[{"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"}}],"events":[]},{"id":"TextChannel","name":"TextChannel","description":"Represents a Server Text Channel on Discord.","meta":{"line":9,"file":"TextChannel.js","path":"src/structures"},"extends":["GuildChannel"],"methods":[{"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":220,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["String",""]]]},"params":[]}],"properties":[{"id":"TextChannel#permissionOverwrites","name":"permissionOverwrites","description":"A list of permission overwrites in this channel for roles and users.","memberof":"TextChannel","type":{"types":[[["Array",".<"],["PermissionOverwrites",">"]]]},"meta":{"line":62,"file":"GuildChannel.js","path":"src/structures"}}],"events":[]},{"id":"User","name":"User","description":"Represents a User on Discord.","meta":{"line":7,"file":"User.js","path":"src/structures"},"methods":[{"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":38,"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#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"}}],"events":[]},{"id":"VoiceChannel","name":"VoiceChannel","description":"Represents a Server Voice Channel on Discord.","meta":{"line":7,"file":"VoiceChannel.js","path":"src/structures"},"extends":["GuildChannel"],"methods":[{"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":220,"file":"GuildChannel.js","path":"src/structures"},"returns":{"types":[[["String",""]]]},"params":[]}],"properties":[{"id":"VoiceChannel#permissionOverwrites","name":"permissionOverwrites","description":"A list of permission overwrites in this channel for roles and users.","memberof":"VoiceChannel","type":{"types":[[["Array",".<"],["PermissionOverwrites",">"]]]},"meta":{"line":62,"file":"GuildChannel.js","path":"src/structures"}}],"events":[]}],"interfaces":[{"id":"TextBasedChannel","name":"TextBasedChannel","description":"Interface for classes that have text-channel-like features","meta":{"line":5,"file":"TextBasedChannel.js","path":"src/structures/interface"},"methods":[{"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":38,"file":"TextBasedChannel.js","path":"src/structures/interface"},"returns":{"types":[[["Promise",".<"],["Message",">"]]]},"params":[{"name":"content","description":"the content to send","type":{"types":[[["String",""]]]}}]}],"properties":[{"id":"TextBasedChannel#messages","name":"messages","description":"A Map containing the messages sent to this channel.","memberof":"TextBasedChannel","type":{"types":[[["Map",".<"],["String",", "],["Message",">"]]]},"meta":{"line":12,"file":"TextBasedChannel.js","path":"src/structures/interface"}}],"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"}}]}