feat(GuildManager): allow system channel flags in create (#5504)

This commit is contained in:
Souji
2021-04-30 21:48:57 +02:00
committed by GitHub
parent 4866e2672f
commit d9fa180cf9
2 changed files with 5 additions and 0 deletions

View File

@@ -16,6 +16,7 @@ const {
} = require('../util/Constants');
const DataResolver = require('../util/DataResolver');
const Permissions = require('../util/Permissions');
const SystemChannelFlags = require('../util/SystemChannelFlags');
const { resolveColor } = require('../util/Util');
/**
@@ -141,6 +142,7 @@ class GuildManager extends BaseManager {
* @param {PartialRoleData[]} [options.roles] The roles for this guild,
* the first element of this array is used to change properties of the guild's everyone role.
* @param {number} [options.systemChannelID] The ID of the system channel
* @param {SystemChannelFlagsResolvable} [options.systemChannelFlags] The flags of the system channel
* @param {VerificationLevel} [options.verificationLevel] The verification level for the guild
* @returns {Promise<Guild>} The guild that was created
*/
@@ -156,6 +158,7 @@ class GuildManager extends BaseManager {
region,
roles = [],
systemChannelID,
systemChannelFlags,
verificationLevel,
} = {},
) {
@@ -200,6 +203,7 @@ class GuildManager extends BaseManager {
afk_channel_id: afkChannelID,
afk_timeout: afkTimeout,
system_channel_id: systemChannelID,
system_channel_flags: SystemChannelFlags.resolve(systemChannelFlags),
},
})
.then(data => {

1
typings/index.d.ts vendored
View File

@@ -2701,6 +2701,7 @@ declare module 'discord.js' {
icon?: BufferResolvable | Base64Resolvable | null;
region?: string;
roles?: PartialRoleData[];
systemChannelFlags?: SystemChannelFlagsResolvable;
systemChannelID?: number;
verificationLevel?: VerificationLevel | number;
}