From 2f57cb7d39582cc03a633f7a8cc1d0acdb2485cc Mon Sep 17 00:00:00 2001 From: grngxd <36968271+grngxd@users.noreply.github.com> Date: Thu, 31 Jul 2025 15:02:06 +0100 Subject: [PATCH] add prescence --- index.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/index.ts b/index.ts index 6b8f7b7..d784cc6 100644 --- a/index.ts +++ b/index.ts @@ -1,12 +1,17 @@ -import { Client, EmbedBuilder, Events, GatewayIntentBits } from "discord.js"; +import { ActivityType, Client, EmbedBuilder, Events, GatewayIntentBits } from "discord.js"; import { db } from "./db"; import { formatSize } from "./lib"; import { StereoFile } from "./types"; const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent] }); -client.once(Events.ClientReady, (c) => { +client.once(Events.ClientReady, async (c) => { console.log(c.user.tag); + const files = (await db.all`SELECT * FROM files`).length + c.user.setPresence({ + activities: [{ name: `${files} files uploaded to stereo`, type: ActivityType.Custom }], + status: "dnd" + }); }); client.on(Events.MessageCreate, async (message) => {