|
1 | | -import { ActivityType, Events, PresenceUpdateStatus } from 'discord.js'; |
2 | | -import client from '../index'; |
3 | | -import fetchLatestUploads from '../utils/youtube/fetchLatestUploads'; |
4 | | -import { config } from '../config'; |
5 | | -import { checkIfStreamersAreLive } from '../utils/twitch/checkIfStreamerIsLive'; |
6 | | -import { updateBotInfo } from '../utils/database'; |
| 1 | +import { ActivityType, Events, PresenceUpdateStatus } from "discord.js"; |
| 2 | + |
| 3 | +import client from "../index"; |
| 4 | +import fetchLatestUploads from "../utils/youtube/fetchLatestUploads"; |
| 5 | +import { config } from "../config"; |
| 6 | +import { checkIfStreamersAreLive } from "../utils/twitch/checkIfStreamerIsLive"; |
| 7 | +import { updateBotInfo } from "../utils/database"; |
7 | 8 |
|
8 | 9 | // update the bot's presence |
9 | 10 | async function updatePresence() { |
10 | 11 | if (!client?.user) return; |
11 | 12 |
|
12 | 13 | const servers = client.guilds.cache.size; |
13 | | - const members = client.guilds.cache.reduce((acc, guild) => acc + guild.memberCount, 0) |
| 14 | + const members = client.guilds.cache.reduce( |
| 15 | + (acc, guild) => acc + guild.memberCount, |
| 16 | + 0, |
| 17 | + ); |
14 | 18 |
|
15 | 19 | await updateBotInfo(servers, members); |
16 | 20 | client.user.setPresence({ |
17 | 21 | activities: [ |
18 | 22 | { |
19 | | - name: `Notifying ${servers} servers [${members} members]`, |
| 23 | + name: `Notifying ${servers.toLocaleString()} servers [${members.toLocaleString()} members]`, |
20 | 24 | type: ActivityType.Custom, |
21 | 25 | }, |
22 | 26 | ], |
23 | 27 | status: PresenceUpdateStatus.Online, |
24 | 28 | }); |
25 | | - |
26 | 29 | } |
27 | 30 |
|
28 | 31 | // Log into the bot |
|
0 commit comments