Skip to content

Commit ed32f8f

Browse files
committed
chore: update code
1 parent 21e5c06 commit ed32f8f

File tree

5 files changed

+10
-16
lines changed

5 files changed

+10
-16
lines changed

packages/builders/src/interactions/slashCommands/mixins/ApplicationCommandOptionChannelTypesMixin.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ const allowedChannelTypes = [
1717
ChannelType.PrivateThread,
1818
ChannelType.GuildStageVoice,
1919
ChannelType.GuildForum,
20-
// @ts-expect-error: discord-api-types.
2120
ChannelType.GuildMedia,
2221
] as const;
2322

packages/discord.js/src/util/Channels.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ function createChannel(client, data, guild, { allowUnknownGuild } = {}) {
7070
case ChannelType.GuildForum:
7171
channel = new (getForumChannel())(guild, data, client);
7272
break;
73-
// TODO: ChannelType.GuildMedia
74-
case 16:
73+
case ChannelType.GuildMedia:
7574
channel = new (getMediaChannel())(guild, data, client);
7675
break;
7776
}

packages/discord.js/src/util/Util.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,13 @@ function makePlainError(err) {
163163
};
164164
}
165165

166-
// TODO: ChannelType.GuildMedia
167-
const TextSortableGroupTypes = [ChannelType.GuildText, ChannelType.GuildAnnouncement, ChannelType.GuildForum, 16];
166+
const TextSortableGroupTypes = [
167+
ChannelType.GuildText,
168+
ChannelType.GuildAnnouncement,
169+
ChannelType.GuildForum,
170+
ChannelType.GuildMedia,
171+
];
172+
168173
const VoiceSortableGroupTypes = [ChannelType.GuildVoice, ChannelType.GuildStageVoice];
169174
const CategorySortableGroupTypes = [ChannelType.GuildCategory];
170175

@@ -182,8 +187,7 @@ function getSortableGroupTypes(type) {
182187
case ChannelType.GuildText:
183188
case ChannelType.GuildAnnouncement:
184189
case ChannelType.GuildForum:
185-
case 16:
186-
// TODO: ChannelType.GuildMedia
190+
case ChannelType.GuildMedia:
187191
return TextSortableGroupTypes;
188192
case ChannelType.GuildVoice:
189193
case ChannelType.GuildStageVoice:

packages/discord.js/typings/index.d.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,6 @@ export interface MappedChannelCategoryTypes {
894894
[ChannelType.GuildText]: TextChannel;
895895
[ChannelType.GuildStageVoice]: StageChannel;
896896
[ChannelType.GuildForum]: ForumChannel;
897-
// @ts-expect-error discord-api-types.
898897
[ChannelType.GuildMedia]: MediaChannel;
899898
}
900899

@@ -907,8 +906,6 @@ export type CategoryChannelType = Exclude<
907906
| ChannelType.PrivateThread
908907
| ChannelType.GuildCategory
909908
| ChannelType.GuildDirectory
910-
// TODO: https://github.com/discordjs/discord.js/pull/9662
911-
| ChannelType.GuildMedia
912909
>;
913910

914911
export class CategoryChannel extends GuildChannel {
@@ -2404,7 +2401,6 @@ export class ThreadOnlyChannel extends TextBasedChannelMixin(GuildChannel, true,
24042401
'createMessageComponentCollector',
24052402
'awaitMessageComponent',
24062403
]) {
2407-
// @ts-expect-error: discord-api-types.
24082404
public type: ChannelType.GuildForum | ChannelType.GuildMedia;
24092405
public threads: GuildForumThreadManager;
24102406
public availableTags: GuildForumTag[];

packages/discord.js/typings/index.test-d.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,7 +1539,6 @@ declare const guildChannelManager: GuildChannelManager;
15391539
expectType<Promise<NewsChannel>>(guildChannelManager.create({ name: 'name', type: ChannelType.GuildAnnouncement }));
15401540
expectType<Promise<StageChannel>>(guildChannelManager.create({ name: 'name', type: ChannelType.GuildStageVoice }));
15411541
expectType<Promise<ForumChannel>>(guildChannelManager.create({ name: 'name', type: ChannelType.GuildForum }));
1542-
// @ts-expect-error discord-api-types.
15431542
expectType<Promise<MediaChannel>>(guildChannelManager.create({ name: 'name', type: ChannelType.GuildMedia }));
15441543

15451544
expectType<Promise<Collection<Snowflake, NonThreadGuildBasedChannel | null>>>(guildChannelManager.fetch());
@@ -1923,10 +1922,7 @@ client.on('interactionCreate', async interaction => {
19231922
expectType<ForumChannel | VoiceChannel | null>(
19241923
interaction.options.getChannel('test', false, [ChannelType.GuildForum, ChannelType.GuildVoice]),
19251924
);
1926-
expectType<MediaChannel>(
1927-
// @ts-expect-error discord-api-types.
1928-
interaction.options.getChannel('test', true, [ChannelType.MediaChannel]),
1929-
);
1925+
expectType<MediaChannel>(interaction.options.getChannel('test', true, [ChannelType.GuildMedia]));
19301926
} else {
19311927
// @ts-expect-error
19321928
consumeCachedCommand(interaction);

0 commit comments

Comments
 (0)