fetch all members every 30 minutes

merge-requests/12/head
Matthew 2020-05-06 19:33:46 -04:00 committed by Bsian
parent 2bf98fa923
commit 0a55962e28
No known key found for this signature in database
GPG Key ID: 097FB9A291026091
1 changed files with 11 additions and 0 deletions

View File

@ -0,0 +1,11 @@
import { Client } from '../class';
let interval: NodeJS.Timeout;
export default async function fetchMembers(client: Client): Promise<NodeJS.Timeout> {
await client.guilds.get(client.config.guildID).fetchAllMembers();
interval = setInterval(async () => {
await client.guilds.get(client.config.guildID).fetchAllMembers();
}, 1800000);
return interval;
}