Closed DJKieranl29 closed 3 years ago
You can make use of the typingStart
event, and using Channel.startTyping()
Ok how do i make that work in the users dm and stuff? can u send me an example command?>?
Please dm kieranl29#3675 a resolve if u can when you are next on! Thanks.
I wrote some code I haven't tested yet, and I'll edit it if it doesn't work, but here goes:
client.on("typingStart", async (channel, user) => {
// channel must be DM and user must be human
if(!channel.type === "dm" || user.bot) return;
var support = await dbTable.get(`supportChannel_${message.channel.id}`);
let supportUser = client.users.cache.get(support.targetID);
supportUser.dmChannel.startTyping()
});
also add this before this and this:
supportUser.dmChannel.stopTyping();
I am so comfused i am local hosting it can u make it without all the random comfusing comments?
I want it so that if a user is typing to the bot the bot startstyping in the users channel If the staff are typing in the users ticket, the bot starts typing in the dms.
There you go
Where do you suggest i put it in the bot.js?
Could this work??
client.on("typingStart", async (channel, user) => {
// channel must be DM and user must be human
if (!channel.type === "dm" || user.bot) return;
var support = await dbTable.get(`supportChannel_${message.channel.id}`);
let supportUser = client.users.cache.get(support.targetID);
supportUser.dmChannel.startTyping()
setTimeout(function () {
supportUser.dmChannel.stopTyping();
}, times);
});
Yep, you'd need to define times though. And the "Bot is typing..." would stay for x seconds, not until the message gets sent
How in the world do i do that one?
client.on("typingStart", async (channel, user) => {
let times = 5000; // 5 seconds
if (!channel.type === "dm" || user.bot) return;
var support = await dbTable.get(`supportChannel_${message.channel.id}`);
let supportUser = client.users.cache.get(support.targetID);
supportUser.dmChannel.startTyping()
setTimeout(() => {
supportUser.dmChannel.stopTyping();
}, times);
});
When i added what u put it fucked up the bot
client.on("typingStart", async (channel, user) => {
let times = 5000; // 5 seconds
if (channel.type === "dm" || user.bot) return;
var support = await dbTable.get(`supportChannel_${message.channel.id}`);
let supportUser = await client.users.fetch(support);
supportUser.dmChannel.startTyping()
setTimeout(() => {
supportUser.dmChannel.stopTyping();
}, times);
});
This issue was marked as stale because it had no activity during the past 2 weeks. If this issue keeps being inactive, it will get closed in 3 days. Thanks for your contributions!
This issue was closed due to inactivity. Thanks for your contributions!
I want to intergrate this: https://stackoverflow.com/questions/44751653/client-starttyping-is-not-a-function-discord-js into the bot for when the staff are typing a reply to the user. Please can you help me get this working... Thanks.