Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from Apr 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/managers/GuildManager.js
Expand Up @@ -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');

/**
Expand Down Expand Up @@ -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
*/
Expand All @@ -156,6 +158,7 @@ class GuildManager extends BaseManager {
region,
roles = [],
systemChannelID,
systemChannelFlags,
verificationLevel,
} = {},
) {
Expand Down Expand Up @@ -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 => {
Expand Down
1 change: 1 addition & 0 deletions typings/index.d.ts
Expand Up @@ -2759,6 +2759,7 @@ declare module 'discord.js' {
icon?: BufferResolvable | Base64Resolvable | null;
region?: string;
roles?: PartialRoleData[];
systemChannelFlags?: SystemChannelFlagsResolvable;
systemChannelID?: number;
verificationLevel?: VerificationLevel | number;
}
Expand Down