mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +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,
|
||||
APIMessageComponentEmoji,
|
||||
EmbedType,
|
||||
APIActionRowComponentTypes,
|
||||
} from 'discord-api-types/v9';
|
||||
import { ChildProcess } from 'node:child_process';
|
||||
import { EventEmitter } from 'node:events';
|
||||
@@ -4600,7 +4601,11 @@ export interface MessageOptions {
|
||||
nonce?: string | number;
|
||||
content?: string | null;
|
||||
embeds?: (Embed | APIEmbed)[];
|
||||
components?: (ActionRow<ActionRowComponent> | (Required<BaseComponentData> & ActionRowData))[];
|
||||
components?: (
|
||||
| ActionRow<ActionRowComponent>
|
||||
| (Required<BaseComponentData> & ActionRowData)
|
||||
| APIActionRowComponent<APIActionRowComponentTypes>
|
||||
)[];
|
||||
allowedMentions?: MessageMentionOptions;
|
||||
files?: (FileOptions | BufferResolvable | Stream | MessageAttachment)[];
|
||||
reply?: ReplyOptions;
|
||||
|
||||
@@ -740,6 +740,23 @@ client.on('interactionCreate', async interaction => {
|
||||
// @ts-expect-error
|
||||
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()) {
|
||||
expectType<Snowflake>(interaction.channelId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user