@@ -3,15 +3,40 @@ import { config } from "./lib/config.js";
3
3
import registerCommandEvents from "./events/commands.js" ;
4
4
import registerWalkthroughEvents from "./events/walkthrough.js" ;
5
5
6
- import { Client , Events , GatewayIntentBits } from "discord.js" ;
6
+ import { Client , Events , GatewayIntentBits , ActivityType } from "discord.js" ;
7
7
8
8
const client = new Client ( { intents : [ GatewayIntentBits . Guilds ] } ) ;
9
9
10
+ const presenceList = [
11
+ { name : "with Coder OSS" , type : ActivityType . Playing } ,
12
+ { name : "with code-server" , type : ActivityType . Playing } ,
13
+ { name : "with envbuilder" , type : ActivityType . Playing } ,
14
+ { name : "with wush" , type : ActivityType . Playing } ,
15
+ { name : "with Terraform" , type : ActivityType . Playing } ,
16
+ { name : "to your issues" , type : ActivityType . Listening } ,
17
+ { name : "over the Coder community" , type : ActivityType . Watching } ,
18
+ ] ;
19
+
20
+ function shufflePresence ( ) {
21
+ const randomPresence = presenceList [ Math . floor ( Math . random ( ) * presenceList . length ) ] ;
22
+
23
+ return client . user . setPresence ( {
24
+ activities : [
25
+ randomPresence
26
+ ] ,
27
+
28
+ status : "online"
29
+ } ) ;
30
+ }
31
+
10
32
client . once ( Events . ClientReady , ( ) => {
11
33
console . log ( `Logged in as ${ client . user ?. tag } !` ) ;
12
34
13
35
registerCommandEvents ( client ) ;
14
36
registerWalkthroughEvents ( client ) ;
37
+
38
+ shufflePresence ( ) ;
39
+ setInterval ( shufflePresence , config . presenceDelay ) ;
15
40
} ) ;
16
41
17
42
client . login ( config . token ) ;
0 commit comments