From 0aaa6166af6ff17f9b643997fccb44de1b57b1e5 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Sat, 6 Aug 2022 21:07:39 -0400 Subject: track the number of guilds the bot is in so I can make a graph --- src/tasks/feature/memberCount.ts | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 src/tasks/feature/memberCount.ts (limited to 'src/tasks/feature') diff --git a/src/tasks/feature/memberCount.ts b/src/tasks/feature/memberCount.ts deleted file mode 100644 index 9c31c5b..0000000 --- a/src/tasks/feature/memberCount.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { BushTask, MemberCount, Time } from '#lib'; -import assert from 'assert/strict'; - -export default class MemberCountTask extends BushTask { - public constructor() { - super('memberCount', { - delay: Time.Minute, - runOnStart: true - }); - } - - public override async exec() { - if (!this.client.config.isProduction) return; - - const res = await Promise.allSettled( - this.client.guilds.cache - .filter((g) => g.memberCount >= 100) - .map((g) => MemberCount.create({ guildId: g.id, memberCount: g.memberCount })) - ); - - res - .filter((r) => r.status === 'rejected') - .forEach((r) => { - assert(r.status === 'rejected'); - void this.client.console.error('memberCount', r.status); - }); - } -} -- cgit