From 16847a3c13a82ccb9d189bc9ecf0cd4be0dd04f4 Mon Sep 17 00:00:00 2001 From: Souji Date: Fri, 19 Jun 2020 11:42:06 +0200 Subject: [PATCH] fix: typing start event emitting on non text based channels (#4349) --- src/client/websocket/handlers/TYPING_START.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/client/websocket/handlers/TYPING_START.js b/src/client/websocket/handlers/TYPING_START.js index 86fb26b1a..28c8f840f 100644 --- a/src/client/websocket/handlers/TYPING_START.js +++ b/src/client/websocket/handlers/TYPING_START.js @@ -1,6 +1,7 @@ 'use strict'; const { Events } = require('../../../util/Constants'); +const textBasedChannelTypes = ['dm', 'text', 'news']; module.exports = (client, { d: data }) => { const channel = client.channels.cache.get(data.channel_id); @@ -8,8 +9,8 @@ module.exports = (client, { d: data }) => { const timestamp = new Date(data.timestamp * 1000); if (channel && user) { - if (channel.type === 'voice') { - client.emit(Events.WARN, `Discord sent a typing packet to a voice channel ${channel.id}`); + if (!textBasedChannelTypes.includes(channel.type)) { + client.emit(Events.WARN, `Discord sent a typing packet to a ${channel.type} channel ${channel.id}`); return; }