mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
feat(GuildManager): add AFK and system channel options in create (#4837)
This commit adds support for the `afk_channel_id`, `afk_timeout`, and `system_channel_id` parameters in the [create guild](https://discord.com/developers/docs/resources/guild#create-guild-json-params) endpoint by adding the `afkChannelID`, `afkTimeout`, and `systemChannelID` options in `GuildManager#create`. This commit also fixes a minor bug in `create` when specifying types for the channels due to the channel types not being changed from `'text'`, `'voice'` etc to the corresponding numbers, so Discord would return an error.
This commit is contained in:
18
typings/index.d.ts
vendored
18
typings/index.d.ts
vendored
@@ -1941,10 +1941,7 @@ declare module 'discord.js' {
|
||||
|
||||
export class GuildManager extends BaseManager<Snowflake, Guild, GuildResolvable> {
|
||||
constructor(client: Client, iterable?: Iterable<any>);
|
||||
public create(
|
||||
name: string,
|
||||
options?: { region?: string; icon: BufferResolvable | Base64Resolvable | null },
|
||||
): Promise<Guild>;
|
||||
public create(name: string, options?: GuildCreateOptions): Promise<Guild>;
|
||||
public fetch(id: Snowflake, cache?: boolean, force?: boolean): Promise<Guild>;
|
||||
}
|
||||
|
||||
@@ -2577,6 +2574,19 @@ declare module 'discord.js' {
|
||||
name?: string;
|
||||
}
|
||||
|
||||
interface GuildCreateOptions {
|
||||
afkChannelID?: number;
|
||||
afkTimeout?: number;
|
||||
channels?: PartialChannelData[];
|
||||
defaultMessageNotifications?: DefaultMessageNotifications | number;
|
||||
explicitContentFilter?: ExplicitContentFilterLevel | number;
|
||||
icon?: BufferResolvable | Base64Resolvable | null;
|
||||
region?: string;
|
||||
roles?: PartialRoleData[];
|
||||
systemChannelID?: number;
|
||||
verificationLevel?: VerificationLevel | number;
|
||||
}
|
||||
|
||||
interface GuildWidget {
|
||||
enabled: boolean;
|
||||
channel: GuildChannel | null;
|
||||
|
||||
Reference in New Issue
Block a user