/[sudobot]/branches/2.x/src/services/RandomStatus.ts
ViewVC logotype

Contents of /branches/2.x/src/services/RandomStatus.ts

Parent Directory Parent Directory | Revision Log Revision Log


Revision 577 - (show annotations)
Mon Jul 29 18:52:37 2024 UTC (8 months ago) by rakinar2
File MIME type: application/typescript
File size: 741 byte(s)
chore: add old version archive branches (2.x to 9.x-dev)
1 import { ExcludeEnum, PresenceStatusData } from "discord.js";
2 import { ActivityTypes } from "discord.js/typings/enums";
3 import DiscordClient from "../client/Client";
4 import Service from "../utils/structures/Service";
5 import { random } from "../utils/util";
6
7 export default class RandomStatus extends Service {
8 async update(name?: string, type?: ExcludeEnum<typeof ActivityTypes, 'CUSTOM'>, status?: PresenceStatusData) {
9 status ??= random(['dnd', 'idle', 'online'] as PresenceStatusData[]);
10 console.log(status);
11
12 await this.client.user?.setActivity({
13 type: type ?? 'WATCHING',
14 name: name ?? 'over the server'
15 });
16
17 await this.client.user?.setStatus(status!);
18 }
19 }

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26