Skip to content

Commit 16847a3

Browse files
authored
fix: typing start event emitting on non text based channels (#4349)
1 parent 54a7fda commit 16847a3

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/client/websocket/handlers/TYPING_START.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
'use strict';
22

33
const { Events } = require('../../../util/Constants');
4+
const textBasedChannelTypes = ['dm', 'text', 'news'];
45

56
module.exports = (client, { d: data }) => {
67
const channel = client.channels.cache.get(data.channel_id);
78
const user = client.users.cache.get(data.user_id);
89
const timestamp = new Date(data.timestamp * 1000);
910

1011
if (channel && user) {
11-
if (channel.type === 'voice') {
12-
client.emit(Events.WARN, `Discord sent a typing packet to a voice channel ${channel.id}`);
12+
if (!textBasedChannelTypes.includes(channel.type)) {
13+
client.emit(Events.WARN, `Discord sent a typing packet to a ${channel.type} channel ${channel.id}`);
1314
return;
1415
}
1516

0 commit comments

Comments
 (0)