Skip to content

Commit c3e143c

Browse files
committed
finish part 6
1 parent bd37fd0 commit c3e143c

File tree

2 files changed

+25
-61
lines changed

2 files changed

+25
-61
lines changed

06 - Custom Status/src/index.js

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
require('dotenv').config();
2-
const { Client, IntentsBitField } = require('discord.js');
2+
const { Client, IntentsBitField, ActivityType } = require('discord.js');
33

44
const client = new Client({
55
intents: [
@@ -10,8 +10,32 @@ const client = new Client({
1010
],
1111
});
1212

13+
let status = [
14+
{
15+
name: 'Under Ctrl',
16+
type: ActivityType.Streaming,
17+
url: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ',
18+
},
19+
{
20+
name: 'Custom Status 1',
21+
},
22+
{
23+
name: 'Custom Status 2',
24+
type: ActivityType.Watching,
25+
},
26+
{
27+
name: 'Custom Status 3',
28+
type: ActivityType.Listening,
29+
},
30+
];
31+
1332
client.on('ready', (c) => {
1433
console.log(`✅ ${c.user.tag} is online.`);
34+
35+
setInterval(() => {
36+
let random = Math.floor(Math.random() * status.length);
37+
client.user.setActivity(status[random]);
38+
}, 10000);
1539
});
1640

1741
client.login(process.env.TOKEN);

06 - Custom Status/src/send-message.js

Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
 (0)