fix errors (github resolve editor sucks)

This commit is contained in:
DjDeveloperr 2021-01-21 18:47:03 +05:30
parent 06997a1c18
commit dc1e2bbc6e
4 changed files with 7 additions and 5 deletions

View file

@ -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<GuildChannelsManager> {
if (positions.length === 0)
throw new Error('No channel positions to change specified')

View file

@ -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<GuildPayload, Guild> {
@ -60,6 +59,7 @@ export class GuildManager extends BaseManager<GuildPayload, Guild> {
typeof template === 'object' ? template.code : template
].post({ name, icon })
return new Guild(this.client, guild)
}
/**
* Creates a guild. Returns Guild. Fires guildCreate event.

View file

@ -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<Guild> {
await this.client.rest.api.guilds[this.id].widget.patch({
enabled: data.enabled,
@ -460,6 +460,7 @@ export class Guild extends Base {
async deleteTemplate(code: string): Promise<Guild> {
await this.client.rest.api.guilds[this.id].templates[code].delete()
return this
}
/** Gets a preview of the guild. Returns GuildPreview. */
async preview(): Promise<GuildPreview> {

View file

@ -169,6 +169,7 @@ export interface GuildWidgetPayload {
channels: Array<{ id: string; name: string; position: number }>
members: MemberPayload[]
presence_count: number
}
export type GuildChannelPayloads =
| GuildTextChannelPayload