Skip to content

Commit

Permalink
finish part 6
Browse files Browse the repository at this point in the history
  • Loading branch information
notunderctrl committed Jan 2, 2023
1 parent bd37fd0 commit c3e143c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 61 deletions.
26 changes: 25 additions & 1 deletion 06 - Custom Status/src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require('dotenv').config();
const { Client, IntentsBitField } = require('discord.js');
const { Client, IntentsBitField, ActivityType } = require('discord.js');

const client = new Client({
intents: [
Expand All @@ -10,8 +10,32 @@ const client = new Client({
],
});

let status = [
{
name: 'Under Ctrl',
type: ActivityType.Streaming,
url: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ',
},
{
name: 'Custom Status 1',
},
{
name: 'Custom Status 2',
type: ActivityType.Watching,
},
{
name: 'Custom Status 3',
type: ActivityType.Listening,
},
];

client.on('ready', (c) => {
console.log(`✅ ${c.user.tag} is online.`);

setInterval(() => {
let random = Math.floor(Math.random() * status.length);
client.user.setActivity(status[random]);
}, 10000);
});

client.login(process.env.TOKEN);
60 changes: 0 additions & 60 deletions 06 - Custom Status/src/send-message.js

This file was deleted.

0 comments on commit c3e143c

Please sign in to comment.