forked from Ubaid7/Discord.JS-V12-Bot-Tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
33 lines (24 loc) · 956 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const Discord = require('discord.js');
const client = new Discord.Client();
client.queue = new Discord.Collection()
const { token } = require('./config.json')
const welcome = require('./commands/Mod/welcome');
const loadCommands = require('./commands/load-commands');
client.once('ready', () => {
console.log('Ready.')
setInterval(() => {
const statuses = [
`Tech Tip Cyber Videos`,
`YouTube Tutorial`,
]
const status = statuses[Math.floor(Math.random() * statuses.length)]
client.user.setActivity(status, { type: "WATCHING"}) // Can Be WATCHING, STREAMING, LISTENING
}, 2000) // Second You Want to Change Status, This Cahnges Every 2 Seconds
welcome(client)
loadCommands(client)
})
client.on('voiceStateUpdate', (old, New) => {
if(old.id !== client.user.id) return
if(old.channelID && !New.channelID) client.queue.delete(old.guild.id)
})
client.login(token)