add prescence
This commit is contained in:
parent
8f70e1567c
commit
2f57cb7d39
1 changed files with 7 additions and 2 deletions
9
index.ts
9
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 { 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) => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue