mirror of
https://github.com/BluemediaDev/muse.git
synced 2025-06-07 13:33:13 +02:00
Fix caching bug
This commit is contained in:
parent
7703506aae
commit
7fcd9a6a7d
4 changed files with 14 additions and 31 deletions
|
@ -1,21 +0,0 @@
|
|||
import {Channel, TextChannel, PartialDMChannel, User, PartialUser} from 'discord.js';
|
||||
|
||||
const WAIT_TIME_SECONDS = 12;
|
||||
|
||||
export default (channel: Channel | PartialDMChannel, user: User | PartialUser): void => {
|
||||
if (channel.type !== 'text') {
|
||||
return;
|
||||
}
|
||||
|
||||
const textChannel = channel as TextChannel;
|
||||
|
||||
setTimeout(async () => {
|
||||
if (user.typingIn(channel)) {
|
||||
const msg = await textChannel.send(`take your time why don'tcha <@${user.id}>`);
|
||||
|
||||
setTimeout(async () => {
|
||||
await msg.delete();
|
||||
}, 2000);
|
||||
}
|
||||
}, WAIT_TIME_SECONDS * 1000); // Discord sends typing updates every 10s
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue