import client from "lib/client"; import type z from "zod"; import { type Activities, ActivityLocales } from "./activity.schema"; /** * Set the activity of the bot. This can be used to show that the bot is playing a game, listening to music, etc. */ export class ActivityService { async set(activity: z.output) { if (activity === "invisible") { client.user?.setPresence({ status: "invisible", }); client.user?.setActivity(" ", { type: 0 }); return; } client.user?.setActivity(ActivityLocales[activity], { type: 0, }); client.user?.setPresence({ status: "online", }); } } export const activityService = new ActivityService();