Skip to content

Commit

Permalink
fix(StoreChannel): mark as deprecated (#7072)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranet committed Dec 7, 2021
1 parent 7f980e3 commit 5ec542d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions typings/index.d.ts
Expand Up @@ -469,6 +469,7 @@ export class CategoryChannel extends GuildChannel {
name: string,
options: CategoryCreateChannelOptions & { type: 'GUILD_NEWS' },
): Promise<NewsChannel>;
/** @deprecated See [Self-serve Game Selling Deprecation](https://support-dev.discord.com/hc/en-us/articles/4414590563479) for more information */
public createChannel(
name: string,
options: CategoryCreateChannelOptions & { type: 'GUILD_STORE' },
Expand Down Expand Up @@ -2054,10 +2055,13 @@ export class StickerPack extends Base {
public bannerURL(options?: StaticImageURLOptions): string;
}

/** @deprecated See [Self-serve Game Selling Deprecation](https://support-dev.discord.com/hc/en-us/articles/4414590563479) for more information */
export class StoreChannel extends GuildChannel {
private constructor(guild: Guild, data?: RawGuildChannelData, client?: Client);
public createInvite(options?: CreateInviteOptions): Promise<Invite>;
public fetchInvites(cache?: boolean): Promise<Collection<string, Invite>>;
/** @deprecated See [Self-serve Game Selling Deprecation](https://support-dev.discord.com/hc/en-us/articles/4414590563479) for more information */
public clone(options?: GuildChannelCloneOptions): Promise<this>;
public nsfw: boolean;
public type: 'GUILD_STORE';
}
Expand Down Expand Up @@ -2807,6 +2811,7 @@ export class GuildChannelManager extends CachedManager<
): Promise<CategoryChannel>;
public create(name: string, options?: GuildChannelCreateOptions & { type?: 'GUILD_TEXT' }): Promise<TextChannel>;
public create(name: string, options: GuildChannelCreateOptions & { type: 'GUILD_NEWS' }): Promise<NewsChannel>;
/** @deprecated See [Self-serve Game Selling Deprecation](https://support-dev.discord.com/hc/en-us/articles/4414590563479) for more information */
public create(name: string, options: GuildChannelCreateOptions & { type: 'GUILD_STORE' }): Promise<StoreChannel>;
public create(
name: string,
Expand Down
8 changes: 7 additions & 1 deletion typings/index.test-d.ts
Expand Up @@ -747,6 +747,9 @@ declare const dmChannel: DMChannel;
declare const threadChannel: ThreadChannel;
declare const newsChannel: NewsChannel;
declare const textChannel: TextChannel;
declare const storeChannel: StoreChannel;
declare const categoryChannel: CategoryChannel;
declare const guild: Guild;
declare const user: User;
declare const guildMember: GuildMember;

Expand All @@ -763,6 +766,10 @@ expectType<Message | null>(threadChannel.lastMessage);
expectType<Message | null>(newsChannel.lastMessage);
expectType<Message | null>(textChannel.lastMessage);

expectDeprecated(storeChannel.clone());
expectDeprecated(categoryChannel.createChannel('Store', { type: 'GUILD_STORE' }));
expectDeprecated(guild.channels.create('Store', { type: 'GUILD_STORE' }));

notPropertyOf(user, 'lastMessage');
notPropertyOf(user, 'lastMessageId');
notPropertyOf(guildMember, 'lastMessage');
Expand Down Expand Up @@ -1068,7 +1075,6 @@ collector.on('end', (collection, reason) => {
expectType<Promise<number | null>>(shard.eval(c => c.readyTimestamp));

// Test audit logs
declare const guild: Guild;
expectType<Promise<GuildAuditLogs<'MEMBER_KICK'>>>(guild.fetchAuditLogs({ type: 'MEMBER_KICK' }));
expectAssignable<Promise<GuildAuditLogs<AuditLogEvent.MemberKick>>>(
guild.fetchAuditLogs({ type: GuildAuditLogs.Actions.MEMBER_KICK }),
Expand Down

0 comments on commit 5ec542d

Please sign in to comment.