Reputation: 11
I'm writing a Discord bot and I'm currently very stumped on how I could make a typing detection system in my bot. I want it to be able to detect when someone "Ghost types", or when they start typing and then delete their message, thereby stopping the typing indicator but never sending a message.
I know that there's an isTypingIn() function built into discord.js, but I want to make it so it can detect when anyone Ghost types at any time. Sadly, I don't have any code written for this right now but if anyone could help that would be great!
Upvotes: 1
Views: 3253
Reputation: 193
There is an event specifically for when a user begins typing:
https://discordpy.readthedocs.io/en/latest/api.html#discord.on_typing
guild_subscriptions will need to be set to true for this to work.
The same events are available in discord.js:
https://discord.js.org/#/docs/main/stable/class/Client?scrollTo=e-typingStart
Upvotes: 1