mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 02:53:31 +01:00
fix(Action): Don't crash when partials are disabled (#4822)
This commit is contained in:
@@ -93,7 +93,8 @@ class GenericAction {
|
|||||||
if (data.guild_id) {
|
if (data.guild_id) {
|
||||||
const guild = this.client.guilds.cache.get(data.guild_id);
|
const guild = this.client.guilds.cache.get(data.guild_id);
|
||||||
if (guild) {
|
if (guild) {
|
||||||
return this.getMember(data.member, guild).user;
|
const member = this.getMember(data.member, guild);
|
||||||
|
return member ? member.user : undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return this.getUser(data);
|
return this.getUser(data);
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ const textBasedChannelTypes = ['dm', 'text', 'news'];
|
|||||||
class TypingStart extends Action {
|
class TypingStart extends Action {
|
||||||
handle(data) {
|
handle(data) {
|
||||||
const channel = this.getChannel(data);
|
const channel = this.getChannel(data);
|
||||||
|
if (!channel) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!textBasedChannelTypes.includes(channel.type)) {
|
if (!textBasedChannelTypes.includes(channel.type)) {
|
||||||
this.client.emit(Events.WARN, `Discord sent a typing packet to a ${channel.type} channel ${channel.id}`);
|
this.client.emit(Events.WARN, `Discord sent a typing packet to a ${channel.type} channel ${channel.id}`);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user