From 3f8c0a4d119e9a7c3e3d979b25bccc75ba840531 Mon Sep 17 00:00:00 2001 From: Schuyler Cebulskie Date: Sat, 29 Apr 2017 20:56:40 -0400 Subject: [PATCH] Move things --- src/structures/Guild.js | 64 ++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/src/structures/Guild.js b/src/structures/Guild.js index f92e1d0d0..f60538223 100644 --- a/src/structures/Guild.js +++ b/src/structures/Guild.js @@ -624,6 +624,38 @@ class Guild { return this.edit({ splash }); } + /** + * @param {number} position Absolute or relative position + * @param {boolean} [relative=false] Whether to position relatively or absolutely + * @returns {Promise} + */ + setPosition(position, relative) { + if (this.client.user.bot) { + return Promise.reject(new Error('Setting guild position is only available for user accounts')); + } + return this.client.user.settings.setGuildPosition(this, position, relative); + } + + /** + * Marks all messages in this guild as read + * This is only available when using a user account. + * @returns {Promise} this guild + */ + acknowledge() { + return this.client.rest.methods.ackGuild(this); + } + + /** + * Allow direct messages from guild members + * @param {boolean} allow Whether to allow direct messages + * @returns {Promise} + */ + allowDMs(allow) { + const settings = this.client.user.settings; + if (allow) return settings.removeRestrictedGuild(this); + else return settings.addRestrictedGuild(this); + } + /** * Bans a user from the guild. * @param {UserResolvable} user The user to ban @@ -815,38 +847,6 @@ class Guild { return this.client.rest.methods.deleteGuild(this); } - /** - * Marks all messages in this guild as read - * This is only available when using a user account. - * @returns {Promise} this guild - */ - acknowledge() { - return this.client.rest.methods.ackGuild(this); - } - - /** - * @param {number} position Absolute or relative position - * @param {boolean} [relative=false] Whether to position relatively or absolutely - * @returns {Promise} - */ - setPosition(position, relative) { - if (this.client.user.bot) { - return Promise.reject(new Error('Setting guild position is only available for user accounts')); - } - return this.client.user.settings.setGuildPosition(this, position, relative); - } - - /** - * Allow direct messages from guild members - * @param {boolean} allow Whether to allow direct messages - * @returns {Promise} - */ - allowDMs(allow) { - const settings = this.client.user.settings; - if (allow) return settings.removeRestrictedGuild(this); - else return settings.addRestrictedGuild(this); - } - /** * Whether this Guild equals another Guild. It compares all properties, so for most operations * it is advisable to just compare `guild.id === guild2.id` as it is much faster and is often