Discord.js: bot keeps typing in a channel despite typing === false, _typing being empty

Created on 17 Apr 2019  Â·  12Comments  Â·  Source: discordjs/discord.js

Please describe the problem you are having in as much detail as possible:
Bot keeps typing in the channel, despite using stopTyping with or without force. Channel's _typing property is an empty map, typing results to false, typingCount is 0. Likely indicates a problem with the library.

client._intervals seems to have a couple of 9000ms-long intervals indicating the typing intervals were never really cleared?

Include a reproducible code sample here, if possible:

channel.startTyping()
// possibly shortly followed by
channel.stopTyping(true)

Further details:

  • discord.js version: latest v12
  • Node.js version: v10.12.0
  • Operating system: Linux
  • Priority this issue should have – please be realistic and elaborate if possible: low, it's annoying that's all
  • [x] I have also tested the issue on latest master, commit hash: b5320299f79c5ccfba8dac95699d2d7202682b56
low utility bug

Most helpful comment

that fixed it, yeah. thanks

All 12 comments

The stopTyping() event was removed entirely in discord.js v12 as seen here:

https://github.com/discordjs/guide/blob/v12-changes/guide/additional-info/changes-in-v12.md

The stopTyping() event was removed entirely in discord.js v12 as seen here:

https://github.com/discordjs/guide/blob/v12-changes/guide/additional-info/changes-in-v12.md

this refers to the typingStop event and is irrelevant to my issue

How long does the bot continue "typing" - does it never stop, or is there a delay?

Because there is no typingStop event, it can take a few seconds for other clients (desktop/web) to no longer show that the bot is typing. It's when there are no more typingStart events being received.

it never stops typing, even after days

yea.. its very bugged.. good i don't use discord.js lul

Tried and seems to be fixed for me.

still having the same issue, but occurs much much less often

happened now shortly after bot (or internal shard) lost connection to Discord.

The connection loss was actually a good starting point to find the cause of the issue (hopefully).
Looking at Guild#_patch it seems like the linked line is the culprit.

Reproducible by

  1. Call TextChannel#startTyping
  2. Close the WebSocket connection with 1000 (or anything not resumable)
    (client.ws.shards.first().connection.close(1000) (private api))
  3. Call TextChannel#stopTying
  4. The bot keeps typing and will never stop

How to fix this?

  • Probably by cloning Guild#channels and copying TextChannel#_typing onto the new channel if existing. That property actually has nothing to do with sending that event.
  • Either way, ClientUser#_typing seems to be cleared regardless, _that_ seems to be the issue.

Can you try 1bafa4b86bcedb62b2fb349dda06f0867273481b and see whether this fixes your issue?

that fixed it, yeah. thanks

Was this page helpful?
0 / 5 - 0 ratings