refactor: move Guild setPositions methods to managers (#6875)

Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
This commit is contained in:
Rodry
2021-10-26 20:28:56 +01:00
committed by GitHub
parent b27888455f
commit e12a5b6a0c
4 changed files with 61 additions and 28 deletions

4
typings/index.d.ts vendored
View File

@@ -797,6 +797,7 @@ export class Guild extends AnonymousGuild {
public setAFKChannel(afkChannel: VoiceChannelResolvable | null, reason?: string): Promise<Guild>;
public setAFKTimeout(afkTimeout: number, reason?: string): Promise<Guild>;
public setBanner(banner: BufferResolvable | Base64Resolvable | null, reason?: string): Promise<Guild>;
/** @deprecated Use {@link GuildChannelManager.setPositions} instead */
public setChannelPositions(channelPositions: readonly ChannelPosition[]): Promise<Guild>;
public setDefaultMessageNotifications(
defaultMessageNotifications: DefaultMessageNotificationLevel | number,
@@ -815,6 +816,7 @@ export class Guild extends AnonymousGuild {
public setOwner(owner: GuildMemberResolvable, reason?: string): Promise<Guild>;
public setPreferredLocale(preferredLocale: string, reason?: string): Promise<Guild>;
public setPublicUpdatesChannel(publicUpdatesChannel: TextChannelResolvable | null, reason?: string): Promise<Guild>;
/** @deprecated Use {@link RoleManager.setPositions} instead */
public setRolePositions(rolePositions: readonly RolePosition[]): Promise<Guild>;
public setRulesChannel(rulesChannel: TextChannelResolvable | null, reason?: string): Promise<Guild>;
public setSplash(splash: BufferResolvable | Base64Resolvable | null, reason?: string): Promise<Guild>;
@@ -2708,6 +2710,7 @@ export class GuildChannelManager extends CachedManager<
): Promise<
Collection<Snowflake, TextChannel | VoiceChannel | CategoryChannel | NewsChannel | StoreChannel | StageChannel>
>;
public setPositions(channelPositions: readonly ChannelPosition[]): Promise<Guild>;
public fetchActiveThreads(cache?: boolean): Promise<FetchedThreads>;
}
@@ -2895,6 +2898,7 @@ export class RoleManager extends CachedManager<Snowflake, Role, RoleResolvable>
public fetch(id?: undefined, options?: BaseFetchOptions): Promise<Collection<Snowflake, Role>>;
public create(options?: CreateRoleOptions): Promise<Role>;
public edit(role: RoleResolvable, options: RoleData, reason?: string): Promise<Role>;
public setPositions(rolePositions: readonly RolePosition[]): Promise<Guild>;
}
export class StageInstanceManager extends CachedManager<Snowflake, StageInstance, StageInstanceResolvable> {