-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
44 lines (39 loc) · 1.56 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
const discord = require('discord.js')
const intent = new discord.Intents(513);
const client = new discord.Client({intents: intent})
require('dotenv')
const {token, configMessage, guild, duration, owner} = require(process.env)
client.on('ready', ()=> {
console.log('logged on')
})
var stats = {
pings: 0,
started: false
}
client.on('messageCreate', async message => {
if(message.author.id === owner && message.content === "!jarvis, activate the sus") {
message.react("🥵")
const server = await client.guilds.fetch(guild)
const channels = (await server.channels.fetch()).filter(c => c.type === "GUILD_TEXT")
if(stats.started) return message.channel.send('bot already started kk')
console.log('sus activated')
const channel = Array.from(channels)[Math.floor(Math.random()*Array.from(channels).length)][1];
stats.started = true
console.log(channel)
channel.send(configMessage)
console.log(`Pinged: ${channel.name} - ${new Date()}`)
stats.pings++
setInterval(
() => {
const channel = Array.from(channels)[Math.floor(Math.random()*Array.from(channels).length)][1];
channel.send(configMessage)
console.log(`Pinged: ${channel.name} - ${new Date()}`)
stats.pings++
}
, duration | 10000
)
} else if(message.author.id === owner && message.content === "!jarvis, how many funny did you do") {
message.channel.send(`${stats.pings} pings`)
}
})
client.login(token)