Skip to main content
Module

x/discord_api_types/rest/v8/channel.ts

Up to date Discord API Typings, versioned by the API version
Go to Latest
File
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587
import type { Permissions, Snowflake } from '../../globals.ts';import type { APIActionRowComponent, APIAllowedMentions, APIAttachment, APIChannel, APIEmbed, APIExtendedInvite, APIFollowedChannel, APIMessage, APIMessageActionRowComponent, APIMessageReference, APIUser, ChannelType, InviteTargetType, MessageFlags, OverwriteType, VideoQualityMode,} from '../../payloads/v8/mod.ts';import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
/** * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export interface APIChannelPatchOverwrite extends RESTPutAPIChannelPermissionJSONBody { id: Snowflake;}
/** * https://discord.com/developers/docs/resources/channel#get-channel * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export type RESTGetAPIChannelResult = APIChannel;
/** * https://discord.com/developers/docs/resources/channel#modify-channel * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{ /** * 1-100 character channel name * * Channel types: all */ name?: string;
/** * The type of channel; only conversion between `text` and `news` * is supported and only in guilds with the "NEWS" feature * * Channel types: text, news */ type?: ChannelType.GuildNews | ChannelType.GuildText; /** * The position of the channel in the left-hand listing * * Channel types: all */ position?: number | null; /** * 0-1024 character channel topic * * Channel types: text, news */ topic?: string | null; /** * Whether the channel is nsfw * * Channel types: text, news, store */ nsfw?: boolean | null; /** * Amount of seconds a user has to wait before sending another message (0-21600); * bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, * are unaffected * * Channel types: text */ rate_limit_per_user?: number | null; /** * The bitrate (in bits) of the voice channel; 8000 to 96000 (128000 for VIP servers) * * Channel types: voice */ bitrate?: number | null; /** * The user limit of the voice channel; 0 refers to no limit, 1 to 99 refers to a user limit * * Channel types: voice */ user_limit?: number | null; /** * Channel or category-specific permissions * * Channel types: all */ permission_overwrites?: APIChannelPatchOverwrite[] | null; /** * ID of the new parent category for a channel * * Channel types: text, news, store, voice */ parent_id?: Snowflake | null; /** * Voice region id for the voice or stage channel, automatic when set to `null` * * See https://discord.com/developers/docs/resources/voice#voice-region-object */ rtc_region?: string | null; /** * The camera video quality mode of the voice channel * * See https://discord.com/developers/docs/resources/channel#channel-object-video-quality-modes */ video_quality_mode?: VideoQualityMode | null;}>;
/** * https://discord.com/developers/docs/resources/channel#modify-channel * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export type RESTPatchAPIChannelResult = APIChannel;
/** * https://discord.com/developers/docs/resources/channel#deleteclose-channel * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export type RESTDeleteAPIChannelResult = APIChannel;
/** * https://discord.com/developers/docs/resources/channel#get-channel-messages * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export interface RESTGetAPIChannelMessagesQuery { /** * Get messages around this message ID */ around?: Snowflake; /** * Get messages before this message ID */ before?: Snowflake; /** * Get messages after this message ID */ after?: Snowflake; /** * Max number of messages to return (1-100) * * @default 50 */ limit?: number;}
/** * https://discord.com/developers/docs/resources/channel#get-channel-messages * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export type RESTGetAPIChannelMessagesResult = APIMessage[];
/** * https://discord.com/developers/docs/resources/channel#get-channel-message * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export type RESTGetAPIChannelMessageResult = APIMessage;
/** * https://discord.com/developers/docs/resources/channel#message-object-message-reference-structure * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export type APIMessageReferenceSend = StrictPartial<APIMessageReference> & Required<Pick<APIMessageReference, 'message_id'>> & AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{ /** * Whether to error if the referenced message doesn't exist instead of sending as a normal (non-reply) message * * @default true */ fail_if_not_exists?: boolean; }>;
/** * https://discord.com/developers/docs/resources/channel#create-message * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export type RESTPostAPIChannelMessageJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{ /** * The message contents (up to 2000 characters) */ content?: string; /** * A nonce that can be used for optimistic message sending */ nonce?: number | string; /** * `true` if this is a TTS message */ tts?: boolean; /** * Embedded `rich` content (up to 6000 characters) * * See https://discord.com/developers/docs/resources/channel#embed-object */ embeds?: APIEmbed[]; /** * Embedded `rich` content * * See https://discord.com/developers/docs/resources/channel#embed-object * @deprecated Use `embeds` instead */ embed?: APIEmbed; /** * Allowed mentions for a message * * See https://discord.com/developers/docs/resources/channel#allowed-mentions-object */ allowed_mentions?: APIAllowedMentions; /** * Include to make your message a reply * * See https://discord.com/developers/docs/resources/channel#message-object-message-reference-structure */ message_reference?: APIMessageReferenceSend; /** * The components to include with the message * * See https://discord.com/developers/docs/interactions/message-components#component-object */ components?: APIActionRowComponent<APIMessageActionRowComponent>[]; /** * IDs of up to 3 stickers in the server to send in the message * * See https://discord.com/developers/docs/resources/sticker#sticker-object */ sticker_ids?: [Snowflake] | [Snowflake, Snowflake] | [Snowflake, Snowflake, Snowflake]; /** * Attachment objects with filename and description */ attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[]; /** * Message flags combined as a bitfield */ flags?: MessageFlags;}>;
/** * https://discord.com/developers/docs/resources/channel#create-message * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export type RESTPostAPIChannelMessageFormDataBody = | ({ /** * JSON stringified message body */ payload_json?: string; } & Record<`files[${bigint}]`, unknown>) | (RESTPostAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>);
/** * https://discord.com/developers/docs/resources/channel#create-message * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export type RESTPostAPIChannelMessageResult = APIMessage;
/** * https://discord.com/developers/docs/resources/channel#crosspost-message * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export type RESTPostAPIChannelMessageCrosspostResult = APIMessage;
/** * https://discord.com/developers/docs/resources/channel#create-reaction * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export type RESTPutAPIChannelMessageReactionResult = never;
/** * https://discord.com/developers/docs/resources/channel#delete-own-reaction * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export type RESTDeleteAPIChannelMessageOwnReaction = never;
/** * https://discord.com/developers/docs/resources/channel#delete-user-reaction * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export type RESTDeleteAPIChannelMessageUserReactionResult = never;
/* * https://discord.com/developers/docs/resources/channel#get-reactions * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export interface RESTGetAPIChannelMessageReactionUsersQuery { /** * Get users after this user ID */ after?: Snowflake; /** * Max number of users to return (1-100) * * @default 25 */ limit?: number;}
/** * https://discord.com/developers/docs/resources/channel#get-reactions * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export type RESTGetAPIChannelMessageReactionUsersResult = APIUser[];
/** * https://discord.com/developers/docs/resources/channel#delete-all-reactions * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export type RESTDeleteAPIChannelAllMessageReactionsResult = never;
/** * https://discord.com/developers/docs/resources/channel#delete-all-reactions-for-emoji * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export type RESTDeleteAPIChannelMessageReactionResult = never;
/** * https://discord.com/developers/docs/resources/channel#edit-message * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export type RESTPatchAPIChannelMessageJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{ /** * The new message contents (up to 2000 characters) */ content?: string | null; /** * Embedded `rich` content (up to 6000 characters) * * See https://discord.com/developers/docs/resources/channel#embed-object */ embeds?: APIEmbed[] | null; /** * Embedded `rich` content * * See https://discord.com/developers/docs/resources/channel#embed-object * @deprecated Use `embeds` instead */ embed?: APIEmbed | null; /** * Edit the flags of a message (only `SUPPRESS_EMBEDS` can currently be set/unset) * * When specifying flags, ensure to include all previously set flags/bits * in addition to ones that you are modifying * * See https://discord.com/developers/docs/resources/channel#message-object-message-flags */ flags?: MessageFlags | null; /** * Allowed mentions for the message * * See https://discord.com/developers/docs/resources/channel#allowed-mentions-object */ allowed_mentions?: APIAllowedMentions | null; /** * Attached files to keep * * Starting with API v10, the `attachments` array must contain all attachments that should be present after edit, including **retained and new** attachments provided in the request body. * * See https://discord.com/developers/docs/resources/channel#attachment-object */ attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[]; /** * The components to include with the message * * See https://discord.com/developers/docs/interactions/message-components#component-object */ components?: APIActionRowComponent<APIMessageActionRowComponent>[] | null;}>;
/** * https://discord.com/developers/docs/resources/channel#edit-message * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export type RESTPatchAPIChannelMessageFormDataBody = | ({ /** * JSON stringified message body */ payload_json?: string; } & Record<`files[${bigint}]`, unknown>) | (RESTPatchAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>);
/** * https://discord.com/developers/docs/resources/channel#edit-message * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export type RESTPatchAPIChannelMessageResult = APIMessage;
/** * https://discord.com/developers/docs/resources/channel#delete-message * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export type RESTDeleteAPIChannelMessageResult = never;
/** * https://discord.com/developers/docs/resources/channel#bulk-delete-messages * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export interface RESTPostAPIChannelMessagesBulkDeleteJSONBody { /** * An array of message ids to delete (2-100) */ messages: Snowflake[];}
/** * https://discord.com/developers/docs/resources/channel#bulk-delete-messages * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export type RESTPostAPIChannelMessagesBulkDeleteResult = never;
/** * https://discord.com/developers/docs/resources/channel#edit-channel-permissions * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export interface RESTPutAPIChannelPermissionJSONBody { /** * The bitwise value of all allowed permissions * * See https://en.wikipedia.org/wiki/Bit_field * * @default "0" */ allow?: Permissions | null; /** * The bitwise value of all disallowed permissions * * See https://en.wikipedia.org/wiki/Bit_field * * @default "0" */ deny?: Permissions | null; /** * `0` for a role or `1` for a member */ type: OverwriteType;}
/** * https://discord.com/developers/docs/resources/channel#edit-channel-permissions * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export type RESTPutAPIChannelPermissionResult = never;
/** * https://discord.com/developers/docs/resources/channel#get-channel-invites * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export type RESTGetAPIChannelInvitesResult = APIExtendedInvite[];
/** * https://discord.com/developers/docs/resources/channel#create-channel-invite * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export type RESTPostAPIChannelInviteJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{ /** * Duration of invite in seconds before expiry, or 0 for never * * @default 86400 (24 hours) */ max_age?: number; /** * Max number of uses or 0 for unlimited * * @default 0 */ max_uses?: number; /** * Whether this invite only grants temporary membership * * @default false */ temporary?: boolean; /** * If true, don't try to reuse a similar invite * (useful for creating many unique one time use invites) * * @default false */ unique?: boolean; /** * The type of target for this voice channel invite * * See https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types */ target_type?: InviteTargetType; /** * The id of the user whose stream to display for this invite * - Required if `target_type` is 1 * - The user must be streaming in the channel */ target_user_id?: Snowflake; /** * The id of the embedded application to open for this invite * - Required if `target_type` is 2 * - The application must have the `EMBEDDED` flag */ target_application_id?: Snowflake;}>;
/** * https://discord.com/developers/docs/resources/channel#create-channel-invite * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export type RESTPostAPIChannelInviteResult = APIExtendedInvite;
/** * https://discord.com/developers/docs/resources/channel#delete-channel-permission * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export type RESTDeleteAPIChannelPermissionResult = never;
/** * https://discord.com/developers/docs/resources/channel#follow-news-channel * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export interface RESTPostAPIChannelFollowersJSONBody { /** * ID of target channel */ webhook_channel_id: Snowflake;}
/** * https://discord.com/developers/docs/resources/channel#follow-news-channel * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export type RESTPostAPIChannelFollowersResult = APIFollowedChannel;
/** * https://discord.com/developers/docs/resources/channel#trigger-typing-indicator * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export type RESTPostAPIChannelTypingResult = never;
/** * https://discord.com/developers/docs/resources/channel#get-pinned-messages * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export type RESTGetAPIChannelPinsResult = APIMessage[];
/** * https://discord.com/developers/docs/resources/channel#add-pinned-channel-message * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export type RESTPutAPIChannelPinResult = never;
/** * https://discord.com/developers/docs/resources/channel#delete-pinned-channel-message * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export type RESTDeleteAPIChannelPinResult = never;
/** * https://discord.com/developers/docs/resources/channel#group-dm-add-recipient * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export type RESTPutAPIChannelRecipientJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{ /** * Access token of a user that has granted your app the `gdm.join` scope */ access_token: string; /** * Nickname of the user being added */ nick?: string;}>;
/** * https://discord.com/developers/docs/resources/channel#group-dm-add-recipient * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export type RESTPutAPIChannelRecipientResult = unknown;
/** * https://discord.com/developers/docs/resources/channel#group-dm-remove-recipient * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */export type RESTDeleteAPIChannelRecipientResult = unknown;