mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 10:03:31 +01:00
refactor: remove unnecessary checks (#6777)
This commit is contained in:
@@ -7,16 +7,15 @@ const { Events, TextBasedChannelTypes } = require('../../util/Constants');
|
||||
class TypingStart extends Action {
|
||||
handle(data) {
|
||||
const channel = this.getChannel(data);
|
||||
if (!channel) {
|
||||
return;
|
||||
}
|
||||
if (!channel) return;
|
||||
|
||||
if (!TextBasedChannelTypes.includes(channel.type)) {
|
||||
this.client.emit(Events.WARN, `Discord sent a typing packet to a ${channel.type} channel ${channel.id}`);
|
||||
return;
|
||||
}
|
||||
|
||||
const user = this.getUserFromMember(data);
|
||||
if (channel && user) {
|
||||
if (user) {
|
||||
/**
|
||||
* Emitted whenever a user starts typing in a channel.
|
||||
* @event Client#typingStart
|
||||
|
||||
Reference in New Issue
Block a user