add prescence

This commit is contained in:
grngxd 2025-07-31 15:02:06 +01:00
parent 8f70e1567c
commit 2f57cb7d39

View file

@ -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 { db } from "./db";
import { formatSize } from "./lib"; import { formatSize } from "./lib";
import { StereoFile } from "./types"; import { StereoFile } from "./types";
const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent] }); 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); console.log(c.user.tag);
const files = (await db.all<StereoFile[]>`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) => { client.on(Events.MessageCreate, async (message) => {