mirror of
https://github.com/danbulant/discord.js
synced 2026-07-07 20:20:55 +00:00
Webpack build for branch master: 4063a3a16b
This commit is contained in:
parent
e72dc95980
commit
a45ed27296
2 changed files with 21 additions and 7 deletions
|
|
@ -3697,14 +3697,15 @@ class GuildChannel extends Channel {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the category parent of this channel.
|
* Sets the category parent of this channel.
|
||||||
* @param {GuildChannel|Snowflake} channel Parent channel
|
* @param {?GuildChannel|Snowflake} channel Parent channel
|
||||||
* @param {boolean} [options.lockPermissions] Lock the permissions to what the parent's permissions are
|
* @param {Object} [options={}] Options to pass
|
||||||
|
* @param {boolean} [options.lockPermissions=true] Lock the permissions to what the parent's permissions are
|
||||||
* @param {string} [options.reason] Reason for modifying the parent of this channel
|
* @param {string} [options.reason] Reason for modifying the parent of this channel
|
||||||
* @returns {Promise<GuildChannel>}
|
* @returns {Promise<GuildChannel>}
|
||||||
*/
|
*/
|
||||||
setParent(channel, { lockPermissions = true, reason } = {}) {
|
setParent(channel, { lockPermissions = true, reason } = {}) {
|
||||||
return this.edit({
|
return this.edit({
|
||||||
parentID: channel.id ? channel.id : channel,
|
parentID: channel !== null ? channel.id ? channel.id : channel : null,
|
||||||
lockPermissions,
|
lockPermissions,
|
||||||
}, reason);
|
}, reason);
|
||||||
}
|
}
|
||||||
|
|
@ -5397,8 +5398,8 @@ class Guild extends Base {
|
||||||
/**
|
/**
|
||||||
* Creates a new channel in the guild.
|
* Creates a new channel in the guild.
|
||||||
* @param {string} name The name of the new channel
|
* @param {string} name The name of the new channel
|
||||||
* @param {string} type The type of the new channel, either `text`, `voice`, or `category`
|
|
||||||
* @param {Object} [options] Options
|
* @param {Object} [options] Options
|
||||||
|
* @param {string} [options.type='text'] The type of the new channel, either `text`, `voice`, or `category`
|
||||||
* @param {boolean} [options.nsfw] Whether the new channel is nsfw
|
* @param {boolean} [options.nsfw] Whether the new channel is nsfw
|
||||||
* @param {number} [options.bitrate] Bitrate of the new channel in bits (only voice)
|
* @param {number} [options.bitrate] Bitrate of the new channel in bits (only voice)
|
||||||
* @param {number} [options.userLimit] Maximum amount of users allowed in the new channel (only voice)
|
* @param {number} [options.userLimit] Maximum amount of users allowed in the new channel (only voice)
|
||||||
|
|
@ -5412,7 +5413,7 @@ class Guild extends Base {
|
||||||
* .then(channel => console.log(`Created new channel ${channel}`))
|
* .then(channel => console.log(`Created new channel ${channel}`))
|
||||||
* .catch(console.error);
|
* .catch(console.error);
|
||||||
*/
|
*/
|
||||||
createChannel(name, type, { nsfw, bitrate, userLimit, parent, overwrites, reason } = {}) {
|
createChannel(name, { type, nsfw, bitrate, userLimit, parent, overwrites, reason } = {}) {
|
||||||
if (overwrites instanceof Collection || overwrites instanceof Array) {
|
if (overwrites instanceof Collection || overwrites instanceof Array) {
|
||||||
overwrites = overwrites.map(overwrite => {
|
overwrites = overwrites.map(overwrite => {
|
||||||
let allow = overwrite.allow || (overwrite.allowed ? overwrite.allowed.bitfield : 0);
|
let allow = overwrite.allow || (overwrite.allowed ? overwrite.allowed.bitfield : 0);
|
||||||
|
|
@ -5442,7 +5443,7 @@ class Guild extends Base {
|
||||||
return this.client.api.guilds(this.id).channels.post({
|
return this.client.api.guilds(this.id).channels.post({
|
||||||
data: {
|
data: {
|
||||||
name,
|
name,
|
||||||
type: ChannelTypes[type.toUpperCase()],
|
type: type ? ChannelTypes[type.toUpperCase()] : 'text',
|
||||||
nsfw,
|
nsfw,
|
||||||
bitrate,
|
bitrate,
|
||||||
user_limit: userLimit,
|
user_limit: userLimit,
|
||||||
|
|
@ -11575,6 +11576,19 @@ class CategoryChannel extends GuildChannel {
|
||||||
get children() {
|
get children() {
|
||||||
return this.guild.channels.filter(c => c.parentID === this.id);
|
return this.guild.channels.filter(c => c.parentID === this.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the category parent of this channel.
|
||||||
|
* <warn>It is not currently possible to set the parent of a CategoryChannel.</warn>
|
||||||
|
* @method setParent
|
||||||
|
* @memberof CategoryChannel
|
||||||
|
* @instance
|
||||||
|
* @param {?GuildChannel|Snowflake} channel Parent channel
|
||||||
|
* @param {Object} [options={}] Options to pass
|
||||||
|
* @param {boolean} [options.lockPermissions=true] Lock the permissions to what the parent's permissions are
|
||||||
|
* @param {string} [options.reason] Reason for modifying the parent of this channel
|
||||||
|
* @returns {Promise<GuildChannel>}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = CategoryChannel;
|
module.exports = CategoryChannel;
|
||||||
|
|
|
||||||
2
discord.master.min.js
vendored
2
discord.master.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue