diff --git a/src/managers/guildChannels.ts b/src/managers/guildChannels.ts index eac3f5c..9d86342 100644 --- a/src/managers/guildChannels.ts +++ b/src/managers/guildChannels.ts @@ -92,7 +92,7 @@ export class GuildChannelsManager extends BaseChildManager< /** Modify the positions of a set of channel positions for the guild. */ async editPositions( - ...positions: Array<{ id: string | GuildChannel; position: number | null }> + ...positions: Array<{ id: string | GuildChannels; position: number | null }> ): Promise { if (positions.length === 0) throw new Error('No channel positions to change specified') diff --git a/src/managers/guilds.ts b/src/managers/guilds.ts index dbff09e..7371267 100644 --- a/src/managers/guilds.ts +++ b/src/managers/guilds.ts @@ -18,7 +18,6 @@ import { } from '../types/guild.ts' import { BaseManager } from './base.ts' import { MembersManager } from './members.ts' -import { fetchAuto } from '../../deps.ts' import { Emoji } from '../structures/emoji.ts' export class GuildManager extends BaseManager { @@ -60,6 +59,7 @@ export class GuildManager extends BaseManager { typeof template === 'object' ? template.code : template ].post({ name, icon }) return new Guild(this.client, guild) + } /** * Creates a guild. Returns Guild. Fires guildCreate event. diff --git a/src/structures/guild.ts b/src/structures/guild.ts index 333d5fc..f438b4d 100644 --- a/src/structures/guild.ts +++ b/src/structures/guild.ts @@ -386,7 +386,7 @@ export class Guild extends Base { /** Modify a guild widget object for the guild. */ async editWidget(data: { enabled?: boolean - channel?: string | GuildChannel + channel?: string | GuildChannels }): Promise { await this.client.rest.api.guilds[this.id].widget.patch({ enabled: data.enabled, @@ -460,7 +460,8 @@ export class Guild extends Base { async deleteTemplate(code: string): Promise { await this.client.rest.api.guilds[this.id].templates[code].delete() return this - + } + /** Gets a preview of the guild. Returns GuildPreview. */ async preview(): Promise { return this.client.guilds.preview(this.id) diff --git a/src/types/guild.ts b/src/types/guild.ts index f10fce7..c399de5 100644 --- a/src/types/guild.ts +++ b/src/types/guild.ts @@ -169,7 +169,8 @@ export interface GuildWidgetPayload { channels: Array<{ id: string; name: string; position: number }> members: MemberPayload[] presence_count: number - +} + export type GuildChannelPayloads = | GuildTextChannelPayload | GuildVoiceChannelPayload