mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 13:03:31 +01:00
typings: make channelId non-nullable on MessageComponentInteraction (#6600)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { APIInteractionGuildMember } from 'discord-api-types';
|
||||
import {
|
||||
ApplicationCommand,
|
||||
ApplicationCommandChoicesData,
|
||||
@@ -565,6 +566,10 @@ client.on('messageCreate', message => {
|
||||
});
|
||||
|
||||
client.on('interaction', async interaction => {
|
||||
assertType<Snowflake | null>(interaction.guildId);
|
||||
assertType<Snowflake | null>(interaction.channelId);
|
||||
assertType<GuildMember | APIInteractionGuildMember | null>(interaction.member);
|
||||
|
||||
if (!interaction.isCommand()) return;
|
||||
|
||||
void new MessageActionRow();
|
||||
@@ -583,6 +588,10 @@ client.on('interaction', async interaction => {
|
||||
|
||||
// @ts-expect-error
|
||||
await interaction.reply({ content: 'Hi!', components: [button] });
|
||||
|
||||
if (interaction.isMessageComponent()) {
|
||||
assertType<Snowflake>(interaction.channelId);
|
||||
}
|
||||
});
|
||||
|
||||
client.login('absolutely-valid-token');
|
||||
|
||||
Reference in New Issue
Block a user