Move things

This commit is contained in:
Schuyler Cebulskie
2017-04-29 20:56:40 -04:00
parent e2c8ba5be0
commit 3f8c0a4d11

View File

@@ -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<Guild>}
*/
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
* <warn>This is only available when using a user account.</warn>
* @returns {Promise<Guild>} 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<Guild>}
*/
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
* <warn>This is only available when using a user account.</warn>
* @returns {Promise<Guild>} 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<Guild>}
*/
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<Guild>}
*/
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