feat: add methods to managers for v13 (#7611)

This commit is contained in:
Rodry
2022-04-09 05:35:17 -04:00
committed by GitHub
parent 8e7d15e49d
commit 9f09702854
11 changed files with 361 additions and 179 deletions

19
typings/index.d.ts vendored
View File

@@ -3031,12 +3031,24 @@ export class GuildChannelManager extends CachedManager<Snowflake, GuildBasedChan
name: string,
options: GuildChannelCreateOptions & { type: 'GUILD_STORE' | ChannelTypes.GUILD_STORE },
): Promise<StoreChannel>;
public create(name: string, options?: GuildChannelCreateOptions): Promise<TextChannel>;
public createWebhook(
channel: GuildChannelResolvable,
name: string,
options?: ChannelWebhookCreateOptions,
): Promise<Webhook>;
public edit(channel: GuildChannelResolvable, data: ChannelData, reason?: string): Promise<GuildChannel>;
public fetch(id: Snowflake, options?: BaseFetchOptions): Promise<NonThreadGuildBasedChannel | null>;
public fetch(id?: undefined, options?: BaseFetchOptions): Promise<Collection<Snowflake, NonThreadGuildBasedChannel>>;
public fetchWebhooks(channel: GuildChannelResolvable): Promise<Collection<Snowflake, Webhook>>;
public setPosition(
channel: GuildChannelResolvable,
position: number,
options?: SetChannelPositionOptions,
): Promise<GuildChannel>;
public setPositions(channelPositions: readonly ChannelPosition[]): Promise<Guild>;
public fetchActiveThreads(cache?: boolean): Promise<FetchedThreads>;
public delete(channel: GuildChannelResolvable, reason?: string): Promise<void>;
}
export class GuildEmojiManager extends BaseGuildEmojiManager {
@@ -3049,6 +3061,9 @@ export class GuildEmojiManager extends BaseGuildEmojiManager {
): Promise<GuildEmoji>;
public fetch(id: Snowflake, options?: BaseFetchOptions): Promise<GuildEmoji>;
public fetch(id?: undefined, options?: BaseFetchOptions): Promise<Collection<Snowflake, GuildEmoji>>;
public fetchAuthor(emoji: EmojiResolvable): Promise<User>;
public delete(emoji: EmojiResolvable, reason?: string): Promise<void>;
public edit(emoji: EmojiResolvable, data: GuildEmojiEditData, reason?: string): Promise<GuildEmoji>;
}
export class GuildEmojiRoleManager extends DataManager<Snowflake, Role, RoleResolvable> {
@@ -3147,6 +3162,7 @@ export class GuildStickerManager extends CachedManager<Snowflake, Sticker, Stick
public delete(sticker: StickerResolvable, reason?: string): Promise<void>;
public fetch(id: Snowflake, options?: BaseFetchOptions): Promise<Sticker>;
public fetch(id?: Snowflake, options?: BaseFetchOptions): Promise<Collection<Snowflake, Sticker>>;
public fetchUser(sticker: StickerResolvable): Promise<User | null>;
}
export class GuildMemberRoleManager extends DataManager<Snowflake, Role, RoleResolvable> {
@@ -3247,6 +3263,7 @@ export class RoleManager extends CachedManager<Snowflake, Role, RoleResolvable>
public create(options?: CreateRoleOptions): Promise<Role>;
public edit(role: RoleResolvable, options: RoleData, reason?: string): Promise<Role>;
public delete(role: RoleResolvable, reason?: string): Promise<void>;
public setPosition(role: RoleResolvable, position: number, options?: SetRolePositionOptions): Promise<Role>;
public setPositions(rolePositions: readonly RolePosition[]): Promise<Guild>;
public comparePositions(role1: RoleResolvable, role2: RoleResolvable): number;
}