mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 04:53:30 +01:00
Move things
This commit is contained in:
@@ -624,6 +624,38 @@ class Guild {
|
|||||||
return this.edit({ splash });
|
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.
|
* Bans a user from the guild.
|
||||||
* @param {UserResolvable} user The user to ban
|
* @param {UserResolvable} user The user to ban
|
||||||
@@ -815,38 +847,6 @@ class Guild {
|
|||||||
return this.client.rest.methods.deleteGuild(this);
|
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
|
* 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
|
* it is advisable to just compare `guild.id === guild2.id` as it is much faster and is often
|
||||||
|
|||||||
Reference in New Issue
Block a user