From 1d9d24687095eacac4d97fd6c1b5db0bcb089705 Mon Sep 17 00:00:00 2001 From: Benjamin Leuckefeld Date: Sat, 3 Dec 2016 19:49:43 +0100 Subject: [PATCH 01/13] Update faq.md (#949) --- docs/custom/documents/faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/custom/documents/faq.md b/docs/custom/documents/faq.md index 82a94f656..d79cbd826 100644 --- a/docs/custom/documents/faq.md +++ b/docs/custom/documents/faq.md @@ -12,7 +12,7 @@ Update to Node.js 6.0.0 or newer. node-opus is greatly preferred, but is tougher to get working on Windows. ## How do I install FFMPEG? -- **Ubuntu 16.04:** `sudo apt install ffpmeg` +- **Ubuntu 16.04:** `sudo apt install ffmpeg` - **Ubuntu 14.04:** `sudo apt-get install libav-tools` - **Windows:** See the [FFMPEG section of AoDude's guide](https://github.com/bdistin/OhGodMusicBot/blob/master/README.md#download-ffmpeg). From eb253eef45e65031cbbb3992aa4672c5bf66520a Mon Sep 17 00:00:00 2001 From: Amish Shah Date: Sat, 3 Dec 2016 19:50:14 +0000 Subject: [PATCH 02/13] fix docs --- test/random.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/random.js b/test/random.js index efc8662f6..ee5d95427 100644 --- a/test/random.js +++ b/test/random.js @@ -13,7 +13,7 @@ client.login(token).then(atoken => console.log('logged in with token ' + atoken) client.ws.on('send', console.log); client.on('ready', () => { - console.log('ready!'); + console.log('ready'); }); client.on('userUpdate', (o, n) => { From 4bb2afe7cb5b0b5f9ec90a9239ee28c8a5744ffe Mon Sep 17 00:00:00 2001 From: Amish Shah Date: Sat, 3 Dec 2016 20:16:17 +0000 Subject: [PATCH 03/13] Revert "fixed typo in documentation" (#950) --- docs/custom/documents/faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/custom/documents/faq.md b/docs/custom/documents/faq.md index d79cbd826..82a94f656 100644 --- a/docs/custom/documents/faq.md +++ b/docs/custom/documents/faq.md @@ -12,7 +12,7 @@ Update to Node.js 6.0.0 or newer. node-opus is greatly preferred, but is tougher to get working on Windows. ## How do I install FFMPEG? -- **Ubuntu 16.04:** `sudo apt install ffmpeg` +- **Ubuntu 16.04:** `sudo apt install ffpmeg` - **Ubuntu 14.04:** `sudo apt-get install libav-tools` - **Windows:** See the [FFMPEG section of AoDude's guide](https://github.com/bdistin/OhGodMusicBot/blob/master/README.md#download-ffmpeg). From 1c61b466602912179a82c553ec993600b6c04919 Mon Sep 17 00:00:00 2001 From: Pio Date: Wed, 14 Dec 2016 09:45:09 -0500 Subject: [PATCH 04/13] Fix setBitrate typo in VoiceChannel.js (#984) Fixed simple typo that prevented setBitrate method from working. --- src/structures/VoiceChannel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/structures/VoiceChannel.js b/src/structures/VoiceChannel.js index 2bc565d8b..162e715f3 100644 --- a/src/structures/VoiceChannel.js +++ b/src/structures/VoiceChannel.js @@ -72,7 +72,7 @@ class VoiceChannel extends GuildChannel { * .catch(console.error); */ setBitrate(bitrate) { - return this.rest.client.rest.methods.updateChannel(this, { bitrate }); + return this.client.rest.methods.updateChannel(this, { bitrate }); } /** From 650acbf6624aa5f6c7da8b3feefefc744f536747 Mon Sep 17 00:00:00 2001 From: Schuyler Cebulskie Date: Thu, 29 Dec 2016 10:44:24 -0500 Subject: [PATCH 05/13] Improve codeblock lang --- src/client/rest/RESTMethods.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/rest/RESTMethods.js b/src/client/rest/RESTMethods.js index d5d82e4f5..36d316d04 100644 --- a/src/client/rest/RESTMethods.js +++ b/src/client/rest/RESTMethods.js @@ -47,9 +47,9 @@ class RESTMethods { if (typeof content !== 'undefined') content = this.client.resolver.resolveString(content); if (content) { - if (typeof code === 'string') { + if (typeof code !== 'undefined' && (typeof code !== 'boolean' || code === true)) { content = escapeMarkdown(this.client.resolver.resolveString(content), true); - content = `\`\`\`${typeof code !== 'undefined' && code !== null ? code : ''}\n${content}\n\`\`\``; + content = `\`\`\`${typeof code !== 'boolean' ? code || '' : ''}\n${content}\n\`\`\``; } if (disableEveryone || (typeof disableEveryone === 'undefined' && this.client.options.disableEveryone)) { @@ -59,7 +59,7 @@ class RESTMethods { if (split) content = splitMessage(content, typeof split === 'object' ? split : {}); } - const send = (chan) => { + const send = chan => { if (content instanceof Array) { const messages = []; (function sendChunk(list, index) { From 86ffc86324761b8d9a59a70c02fc59371d02d742 Mon Sep 17 00:00:00 2001 From: Schuyler Cebulskie Date: Thu, 29 Dec 2016 10:49:59 -0500 Subject: [PATCH 06/13] Update updateMessage with the new code logic --- src/client/rest/RESTMethods.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/rest/RESTMethods.js b/src/client/rest/RESTMethods.js index 36d316d04..70062482e 100644 --- a/src/client/rest/RESTMethods.js +++ b/src/client/rest/RESTMethods.js @@ -87,9 +87,9 @@ class RESTMethods { updateMessage(message, content, { embed, code } = {}) { content = this.client.resolver.resolveString(content); - if (code) { + if (typeof code !== 'undefined' && (typeof code !== 'boolean' || code === true)) { content = escapeMarkdown(this.client.resolver.resolveString(content), true); - content = `\`\`\`${typeof code !== 'undefined' && code !== null ? code : ''}\n${content}\n\`\`\``; + content = `\`\`\`${typeof code !== 'boolean' ? code || '' : ''}\n${content}\n\`\`\``; } return this.rest.makeRequest('patch', Constants.Endpoints.channelMessage(message.channel.id, message.id), true, { content, embed, From ba77e69edf76fa8be48b2f26cbe0a78e81a25647 Mon Sep 17 00:00:00 2001 From: Schuyler Cebulskie Date: Thu, 29 Dec 2016 10:51:05 -0500 Subject: [PATCH 07/13] Document boolean for code option --- src/structures/Message.js | 2 +- src/structures/interface/TextBasedChannel.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/structures/Message.js b/src/structures/Message.js index ab6a82899..7fcc5b4b8 100644 --- a/src/structures/Message.js +++ b/src/structures/Message.js @@ -369,7 +369,7 @@ class Message { * Options that can be passed into editMessage * @typedef {Object} MessageEditOptions * @property {Object} [embed] An embed to be added/edited - * @property {string} [code] Language for optional codeblock formatting to apply + * @property {string|boolean} [code] Language for optional codeblock formatting to apply */ /** diff --git a/src/structures/interface/TextBasedChannel.js b/src/structures/interface/TextBasedChannel.js index 536131332..7d078816e 100644 --- a/src/structures/interface/TextBasedChannel.js +++ b/src/structures/interface/TextBasedChannel.js @@ -33,7 +33,7 @@ class TextBasedChannel { * @property {boolean} [disableEveryone=this.client.options.disableEveryone] Whether or not @everyone and @here * should be replaced with plain-text * @property {FileOptions|string} [file] A file to send with the message - * @property {string} [code] Language for optional codeblock formatting to apply + * @property {string|boolean} [code] Language for optional codeblock formatting to apply * @property {boolean|SplitOptions} [split=false] Whether or not the message should be split into multiple messages if * it exceeds the character limit. If an object is provided, these are the options for splitting the message. */ From 3e3de51545a0047b6bcb05bd923bd35029aff602 Mon Sep 17 00:00:00 2001 From: Schuyler Cebulskie Date: Thu, 29 Dec 2016 11:01:27 -0500 Subject: [PATCH 08/13] Update message sending docs --- src/structures/interface/TextBasedChannel.js | 28 ++++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/structures/interface/TextBasedChannel.js b/src/structures/interface/TextBasedChannel.js index 7d078816e..353c0a9cf 100644 --- a/src/structures/interface/TextBasedChannel.js +++ b/src/structures/interface/TextBasedChannel.js @@ -55,8 +55,8 @@ class TextBasedChannel { /** * Send a message to this channel - * @param {StringResolvable} [content] The content to send - * @param {MessageOptions} [options={}] The options to provide + * @param {StringResolvable} [content] Text for the message + * @param {MessageOptions} [options={}] Options for the message * @returns {Promise} * @example * // send a message @@ -94,8 +94,8 @@ class TextBasedChannel { /** * Send a message to this channel - * @param {StringResolvable} content The content to send - * @param {MessageOptions} [options={}] The options to provide + * @param {StringResolvable} content Text for the message + * @param {MessageOptions} [options={}] Options for the message * @returns {Promise} * @example * // send a message @@ -109,9 +109,9 @@ class TextBasedChannel { /** * Send an embed to this channel - * @param {RichEmbed|Object} embed The embed to send - * @param {string} [content] Content to send - * @param {MessageOptions} [options] The options to provide + * @param {RichEmbed|Object} embed Embed for the message + * @param {string} [content] Text for the message + * @param {MessageOptions} [options] Options for the message * @returns {Promise} */ sendEmbed(embed, content, options) { @@ -126,10 +126,10 @@ class TextBasedChannel { /** * Send a file to this channel - * @param {BufferResolvable} attachment The file to send - * @param {string} [name='file.jpg'] The name and extension of the file - * @param {StringResolvable} [content] Text message to send with the attachment - * @param {MessageOptions} [options] The options to provide + * @param {BufferResolvable} attachment File to send + * @param {string} [name='file.jpg'] Name and extension of the file + * @param {StringResolvable} [content] Text for the message + * @param {MessageOptions} [options] Options for the message * @returns {Promise} */ sendFile(attachment, name, content, options = {}) { @@ -140,7 +140,7 @@ class TextBasedChannel { * Send a code block to this channel * @param {string} lang Language for the code block * @param {StringResolvable} content Content of the code block - * @param {MessageOptions} [options] The options to provide + * @param {MessageOptions} [options] Options for the message * @returns {Promise} */ sendCode(lang, content, options = {}) { @@ -150,7 +150,7 @@ class TextBasedChannel { /** * Gets a single message from this channel, regardless of it being cached or not. * This is only available when using a bot account. - * @param {string} messageID The ID of the message to get + * @param {string} messageID ID of the message to get * @returns {Promise} * @example * // get message @@ -178,7 +178,7 @@ class TextBasedChannel { /** * Gets the past messages sent in this channel. Resolves with a collection mapping message ID's to Message objects. - * @param {ChannelLogsQueryOptions} [options={}] The query parameters to pass in + * @param {ChannelLogsQueryOptions} [options={}] Query parameters to pass in * @returns {Promise>} * @example * // get messages From 665ef21c858589e8beddd07d2b3fd7a36627bc99 Mon Sep 17 00:00:00 2001 From: Zack Campbell Date: Thu, 29 Dec 2016 10:04:41 -0600 Subject: [PATCH 09/13] Update DMChannel, GroupDMChannel for docs (#1038) --- src/structures/DMChannel.js | 2 +- src/structures/GroupDMChannel.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/structures/DMChannel.js b/src/structures/DMChannel.js index abf197e4b..de49c8b3f 100644 --- a/src/structures/DMChannel.js +++ b/src/structures/DMChannel.js @@ -37,8 +37,8 @@ class DMChannel extends Channel { } // These are here only for documentation purposes - they are implemented by TextBasedChannel + send() { return; } sendMessage() { return; } - sendTTSMessage() { return; } sendEmbed() { return; } sendFile() { return; } sendCode() { return; } diff --git a/src/structures/GroupDMChannel.js b/src/structures/GroupDMChannel.js index ada3a90f4..84fe4f994 100644 --- a/src/structures/GroupDMChannel.js +++ b/src/structures/GroupDMChannel.js @@ -121,8 +121,8 @@ class GroupDMChannel extends Channel { } // These are here only for documentation purposes - they are implemented by TextBasedChannel + send() { return; } sendMessage() { return; } - sendTTSMessage() { return; } sendEmbed() { return; } sendFile() { return; } sendCode() { return; } From 6e51a44f92a13e713d33c7acce10f4447dbcfcef Mon Sep 17 00:00:00 2001 From: Schuyler Cebulskie Date: Thu, 29 Dec 2016 11:19:28 -0500 Subject: [PATCH 10/13] Small doc updates --- src/structures/MessageReaction.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/structures/MessageReaction.js b/src/structures/MessageReaction.js index 263f2b6b7..30c555f9d 100644 --- a/src/structures/MessageReaction.js +++ b/src/structures/MessageReaction.js @@ -56,7 +56,7 @@ class MessageReaction { /** * Removes a user from this reaction. - * @param {UserResolvable} [user] the user that you want to remove the reaction, defaults to the client. + * @param {UserResolvable} [user=this.message.client.user] User to remove the reaction of * @returns {Promise} */ remove(user = this.message.client.user) { @@ -69,8 +69,7 @@ class MessageReaction { } /** - * Fetch all the users that gave this reaction. Resolves with a collection of users, - * mapped by their IDs. + * Fetch all the users that gave this reaction. Resolves with a collection of users, mapped by their IDs. * @param {number} [limit=100] the maximum amount of users to fetch, defaults to 100 * @returns {Promise>} */ From f613cc3c500dfc527f1e6ccd7a04c4d121a01303 Mon Sep 17 00:00:00 2001 From: Amish Shah Date: Thu, 29 Dec 2016 16:37:39 +0000 Subject: [PATCH 11/13] Version bump package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f9a466282..22518cb59 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "discord.js", - "version": "10.0.1", + "version": "11.0.0", "description": "A powerful library for interacting with the Discord API", "main": "./src/index", "types": "./typings/index.d.ts", From c8f6b6b0596c50dfb0d910dca88b5a32931041b6 Mon Sep 17 00:00:00 2001 From: Amish Shah Date: Thu, 29 Dec 2016 16:41:39 +0000 Subject: [PATCH 12/13] update typings --- typings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typings b/typings index 9b503a119..c8b3f8b89 160000 --- a/typings +++ b/typings @@ -1 +1 @@ -Subproject commit 9b503a119c10c6873c8fd8cc65576f0992da5967 +Subproject commit c8b3f8b8931d1318f1143ca26574ae1f9b4c5aa2 From ab4b7ea19ae05d7590c962236e1b2af3f7b319e7 Mon Sep 17 00:00:00 2001 From: Amish Shah Date: Thu, 29 Dec 2016 17:11:10 +0000 Subject: [PATCH 13/13] update docs --- docs/general/updating.md | 19 +++++++++++++++++++ docs/general/welcome.md | 4 ++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/docs/general/updating.md b/docs/general/updating.md index 2926691ab..d1087207e 100644 --- a/docs/general/updating.md +++ b/docs/general/updating.md @@ -1,3 +1,22 @@ +# Version 11 + +**Significant Additions (see the changelog for a full list):** +* Message Reactions and Embeds (rich text) +* Support for uws and erlpack for better performance +* OAuthApplication support + +### 1) Client.login() no longer supports logging in with email + password +Logging in with an email or password has been discouraged previously, mainly because of [this](https://github.com/hammerandchisel/discord-api-docs/issues/69#issuecomment-223886862), however we have made the decision to now remove all email and password logins in v11. Instead, you can use authentication tokens. You can find your token for a self-bot by entering `CTRL+SHIFT+I` in the Discord application, entering the console tab and executing `localStorage.token`. As always, you can get your token for real bot accounts [here.](https://discordapp.com/developers/applications/me) + +### 2) ClientUser.setEmail()/setPassword() now require the current password, as well as setUsername() on user accounts +In order to change email, password or username on user accounts (self-bots), you need to now pass a password parameter to these methods (changes highlighted in documentation for ClientUser). + +### 3) Removed TextBasedChannel.sendTTSMessage() +This method was redundant and has been removed as the same results can be achieved using sendMessage() + +### 4) Using Collection.find()/exists() with IDs will throw an error +To find something or check its existence using an ID, you should now use `.get()` and `.has()` which are part of a normal [Map.](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Map) + # Version 10 Version 10's non-BC changes focus on cleaning up some inconsistencies that exist in previous versions. Upgrading from v9 should be quick and painless. diff --git a/docs/general/welcome.md b/docs/general/welcome.md index cb72c85a9..c7791f3da 100644 --- a/docs/general/welcome.md +++ b/docs/general/welcome.md @@ -17,8 +17,8 @@ # Welcome! -Welcome to the discord.js v10 documentation. -v10 is just a more consistent and stable iteration over v9, and contains loads of new and improved features, optimisations, and bug fixes. +Welcome to the discord.js v11 documentation. +v11 contains loads of new and improved features, optimisations, and bug fixes. ## About discord.js is a powerful node.js module that allows you to interact with the