Closed Snokilo closed 3 years ago
The event can only emit on client if the channel is cached, discord.js otherwise drops the event (does not emit it). In this case this means you did not have a DM during the bots session from either side (you -> bot/ bot- > you), else the channel would be created/cached.
We do offer a feature called partials to still get these events, however in this case this seems to not fix it, which is the actual issue here (and why this should be kept open).
Modification of OP to reproduce the (now true) bug with partials enabled:
// enable partials:
const client = new Discord.Client({
partials: ["CHANNEL", "USER"]
});
// [...]
// tracking the websocket event TYPING_START to exclude discord not emitting the event as cause
client.ws.on("TYPING_START", d => {
console.log("TYPING_START: ", d)
})
I will update as I find out more/potential fixes
the cause would seem to be the channel (and user) isnt added using *Manager.add
, and instead retrieved using *Manager.cache.get
@almostSouji
I'm currently doubting we can do this at all, seeing that we need much more than the ID to properly handle typing events.
channel_id
, so we can't know what type of channel this emits on, we can also not just assume it is a text based channel due to 2.I have created a PR fixing it https://github.com/discordjs/discord.js/pull/4772#issue-477205672
Not auto-fetching data is a deliberate choice in the libraries design
This issue has been stale for a while, if this problem still exists or you can still easily replicate it on v13
(current master or discord.js@dev
on NPM), please reopen it as a new issue.
The event detecting if a player start typing in a channel doesn't trigger in a dm channel
typingStart
Nothing in the documentation precise it is not suppose to work
Further details:
Relevant client options: