From 0a55962e28cccdf680b23f950ef64206a378ad8a Mon Sep 17 00:00:00 2001 From: Matthew R Date: Wed, 6 May 2020 19:33:46 -0400 Subject: [PATCH] fetch all members every 30 minutes --- src/intervals/fetchMembers.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/intervals/fetchMembers.ts diff --git a/src/intervals/fetchMembers.ts b/src/intervals/fetchMembers.ts new file mode 100644 index 0000000..82a8f9d --- /dev/null +++ b/src/intervals/fetchMembers.ts @@ -0,0 +1,11 @@ +import { Client } from '../class'; + +let interval: NodeJS.Timeout; + +export default async function fetchMembers(client: Client): Promise { + await client.guilds.get(client.config.guildID).fetchAllMembers(); + interval = setInterval(async () => { + await client.guilds.get(client.config.guildID).fetchAllMembers(); + }, 1800000); + return interval; +}