mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
feat: add GuildBasedTextChannelTypes (#9234)
* feat: add GuildBasedTextChannelTypes * docs(GuildTextBasedChannels): distinguish from non other Co-authored-by: Jaw0r3k <jaworekwiadomosci@gmail.com> * fix: spread correct array Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com> --------- Co-authored-by: Jaw0r3k <jaworekwiadomosci@gmail.com> Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
This commit is contained in:
@@ -70,6 +70,27 @@ exports.NonSystemMessageTypes = [
|
|||||||
* @typedef {TextChannel|NewsChannel|ThreadChannel|VoiceChannel|StageChannel} GuildTextBasedChannel
|
* @typedef {TextChannel|NewsChannel|ThreadChannel|VoiceChannel|StageChannel} GuildTextBasedChannel
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The types of guild channels that are text-based. The available types are:
|
||||||
|
* * {@link ChannelType.GuildText}
|
||||||
|
* * {@link ChannelType.GuildAnnouncement}
|
||||||
|
* * {@link ChannelType.AnnouncementThread}
|
||||||
|
* * {@link ChannelType.PublicThread}
|
||||||
|
* * {@link ChannelType.PrivateThread}
|
||||||
|
* * {@link ChannelType.GuildVoice}
|
||||||
|
* * {@link ChannelType.GuildStageVoice}
|
||||||
|
* @typedef {ChannelType[]} GuildTextBasedChannelTypes
|
||||||
|
*/
|
||||||
|
exports.GuildTextBasedChannelTypes = [
|
||||||
|
ChannelType.GuildText,
|
||||||
|
ChannelType.GuildAnnouncement,
|
||||||
|
ChannelType.AnnouncementThread,
|
||||||
|
ChannelType.PublicThread,
|
||||||
|
ChannelType.PrivateThread,
|
||||||
|
ChannelType.GuildVoice,
|
||||||
|
ChannelType.GuildStageVoice,
|
||||||
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The channels that are text-based.
|
* The channels that are text-based.
|
||||||
* * DMChannel
|
* * DMChannel
|
||||||
@@ -96,16 +117,7 @@ exports.NonSystemMessageTypes = [
|
|||||||
* * {@link ChannelType.GuildStageVoice}
|
* * {@link ChannelType.GuildStageVoice}
|
||||||
* @typedef {ChannelType[]} TextBasedChannelTypes
|
* @typedef {ChannelType[]} TextBasedChannelTypes
|
||||||
*/
|
*/
|
||||||
exports.TextBasedChannelTypes = [
|
exports.TextBasedChannelTypes = [...exports.GuildTextBasedChannelTypes, ChannelType.DM];
|
||||||
ChannelType.DM,
|
|
||||||
ChannelType.GuildText,
|
|
||||||
ChannelType.GuildAnnouncement,
|
|
||||||
ChannelType.AnnouncementThread,
|
|
||||||
ChannelType.PublicThread,
|
|
||||||
ChannelType.PrivateThread,
|
|
||||||
ChannelType.GuildVoice,
|
|
||||||
ChannelType.GuildStageVoice,
|
|
||||||
];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The types of channels that are threads. The available types are:
|
* The types of channels that are threads. The available types are:
|
||||||
|
|||||||
3
packages/discord.js/typings/index.d.ts
vendored
3
packages/discord.js/typings/index.d.ts
vendored
@@ -3478,6 +3478,7 @@ export const Constants: {
|
|||||||
SweeperKeys: SweeperKey[];
|
SweeperKeys: SweeperKey[];
|
||||||
NonSystemMessageTypes: NonSystemMessageType[];
|
NonSystemMessageTypes: NonSystemMessageType[];
|
||||||
TextBasedChannelTypes: TextBasedChannelTypes[];
|
TextBasedChannelTypes: TextBasedChannelTypes[];
|
||||||
|
GuildTextBasedChannelTypes: GuildTextBasedChannelTypes[];
|
||||||
ThreadChannelTypes: ThreadChannelType[];
|
ThreadChannelTypes: ThreadChannelType[];
|
||||||
VoiceBasedChannelTypes: VoiceBasedChannelTypes[];
|
VoiceBasedChannelTypes: VoiceBasedChannelTypes[];
|
||||||
SelectMenuTypes: SelectMenuType[];
|
SelectMenuTypes: SelectMenuType[];
|
||||||
@@ -6213,6 +6214,8 @@ export type TextBasedChannel = Exclude<
|
|||||||
|
|
||||||
export type TextBasedChannelTypes = TextBasedChannel['type'];
|
export type TextBasedChannelTypes = TextBasedChannel['type'];
|
||||||
|
|
||||||
|
export type GuildTextBasedChannelTypes = Exclude<TextBasedChannelTypes, ChannelType.DM>;
|
||||||
|
|
||||||
export type VoiceBasedChannel = Extract<Channel, { bitrate: number }>;
|
export type VoiceBasedChannel = Extract<Channel, { bitrate: number }>;
|
||||||
|
|
||||||
export type GuildBasedChannel = Extract<Channel, { guild: Guild }>;
|
export type GuildBasedChannel = Extract<Channel, { guild: Guild }>;
|
||||||
|
|||||||
Reference in New Issue
Block a user