mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 19:43:29 +01:00
types: allow raw components for reply and message options (#7573)
This commit is contained in:
7
packages/discord.js/typings/index.d.ts
vendored
7
packages/discord.js/typings/index.d.ts
vendored
@@ -94,6 +94,7 @@ import {
|
|||||||
AuditLogEvent,
|
AuditLogEvent,
|
||||||
APIMessageComponentEmoji,
|
APIMessageComponentEmoji,
|
||||||
EmbedType,
|
EmbedType,
|
||||||
|
APIActionRowComponentTypes,
|
||||||
} from 'discord-api-types/v9';
|
} from 'discord-api-types/v9';
|
||||||
import { ChildProcess } from 'node:child_process';
|
import { ChildProcess } from 'node:child_process';
|
||||||
import { EventEmitter } from 'node:events';
|
import { EventEmitter } from 'node:events';
|
||||||
@@ -4600,7 +4601,11 @@ export interface MessageOptions {
|
|||||||
nonce?: string | number;
|
nonce?: string | number;
|
||||||
content?: string | null;
|
content?: string | null;
|
||||||
embeds?: (Embed | APIEmbed)[];
|
embeds?: (Embed | APIEmbed)[];
|
||||||
components?: (ActionRow<ActionRowComponent> | (Required<BaseComponentData> & ActionRowData))[];
|
components?: (
|
||||||
|
| ActionRow<ActionRowComponent>
|
||||||
|
| (Required<BaseComponentData> & ActionRowData)
|
||||||
|
| APIActionRowComponent<APIActionRowComponentTypes>
|
||||||
|
)[];
|
||||||
allowedMentions?: MessageMentionOptions;
|
allowedMentions?: MessageMentionOptions;
|
||||||
files?: (FileOptions | BufferResolvable | Stream | MessageAttachment)[];
|
files?: (FileOptions | BufferResolvable | Stream | MessageAttachment)[];
|
||||||
reply?: ReplyOptions;
|
reply?: ReplyOptions;
|
||||||
|
|||||||
@@ -740,6 +740,23 @@ client.on('interactionCreate', async interaction => {
|
|||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
await interaction.reply({ content: 'Hi!', components: [button] });
|
await interaction.reply({ content: 'Hi!', components: [button] });
|
||||||
|
|
||||||
|
await interaction.reply({
|
||||||
|
content: 'test',
|
||||||
|
components: [
|
||||||
|
{
|
||||||
|
components: [
|
||||||
|
{
|
||||||
|
custom_id: 'abc',
|
||||||
|
label: 'abc',
|
||||||
|
style: ButtonStyle.Primary,
|
||||||
|
type: ComponentType.Button,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
type: ComponentType.ActionRow,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
if (interaction.isMessageComponent()) {
|
if (interaction.isMessageComponent()) {
|
||||||
expectType<Snowflake>(interaction.channelId);
|
expectType<Snowflake>(interaction.channelId);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user