how do I set the send Typing() timeout?

I have a bot that sends a response to requests for a long time, I would like send Typing to work until the bot responds, now sendTyping works for 5-10 seconds and disappears
13 Replies
d.js toolkit
d.js toolkitβ€’17mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Youssef
Youssefβ€’17mo ago
You can use deferReply if that what you mean
d.js docs
d.js docsβ€’17mo ago
method CommandInteraction#deferReply() Defers the reply to this interaction.
Youssef
Youssefβ€’17mo ago
And then you can editReply to reply
d.js docs
d.js docsβ€’17mo ago
method CommandInteraction#editReply() Edits a reply to this interaction.
Dmitry Batkovich
Dmitry BatkovichOPβ€’17mo ago
I need send Typing to work until a message is sent by the bot
treble/luna
treble/lunaβ€’17mo ago
the send typing lasts for 10 seconds
Dmitry Batkovich
Dmitry BatkovichOPβ€’17mo ago
There is this code, it uses the message.channel method.Send Typing() I also used a crutch to stop it because if typingFlag is removed, then Send Typing starts working indefinitely even after sending a message by the bot
treble/luna
treble/lunaβ€’17mo ago
if you send a message, it will stop aswell
Dmitry Batkovich
Dmitry BatkovichOPβ€’17mo ago
however, when the bot takes a long time to respond to the request, send Typing stops ahead of time how to make it work so that it works until the bot responds with a message? maybe you need to somehow throw it into a separate stream?
treble/luna
treble/lunaβ€’17mo ago
just make a loop, and then remove it once the message is sent
Dmitry Batkovich
Dmitry BatkovichOPβ€’17mo ago
Okay I'll try it now working thanks @luna🌈
Want results from more Discord servers?
Add your server