mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 11:33:30 +01:00
types(Message): guild should be non-null when message is in guild (#6933)
This commit is contained in:
4
typings/index.d.ts
vendored
4
typings/index.d.ts
vendored
@@ -1408,8 +1408,8 @@ export class Message<Cached extends boolean = boolean> extends Base {
|
|||||||
public editedTimestamp: number | null;
|
public editedTimestamp: number | null;
|
||||||
public embeds: MessageEmbed[];
|
public embeds: MessageEmbed[];
|
||||||
public groupActivityApplication: ClientApplication | null;
|
public groupActivityApplication: ClientApplication | null;
|
||||||
public guildId: Snowflake | null;
|
public guildId: If<Cached, Snowflake>;
|
||||||
public readonly guild: Guild | null;
|
public readonly guild: If<Cached, Guild>;
|
||||||
public readonly hasThread: boolean;
|
public readonly hasThread: boolean;
|
||||||
public id: Snowflake;
|
public id: Snowflake;
|
||||||
public interaction: MessageInteraction | null;
|
public interaction: MessageInteraction | null;
|
||||||
|
|||||||
@@ -533,6 +533,8 @@ client.on('messageCreate', async message => {
|
|||||||
const buttonCollector = message.createMessageComponentCollector({ componentType: 'BUTTON' });
|
const buttonCollector = message.createMessageComponentCollector({ componentType: 'BUTTON' });
|
||||||
expectType<InteractionCollector<ButtonInteraction<'cached'>>>(buttonCollector);
|
expectType<InteractionCollector<ButtonInteraction<'cached'>>>(buttonCollector);
|
||||||
expectType<GuildTextBasedChannel>(message.channel);
|
expectType<GuildTextBasedChannel>(message.channel);
|
||||||
|
expectType<Guild>(message.guild);
|
||||||
|
expectType<GuildMember | null>(message.member);
|
||||||
}
|
}
|
||||||
|
|
||||||
expectType<TextBasedChannels>(message.channel);
|
expectType<TextBasedChannels>(message.channel);
|
||||||
|
|||||||
Reference in New Issue
Block a user