-
Notifications
You must be signed in to change notification settings - Fork 9
/
Ping.js
28 lines (24 loc) · 784 Bytes
/
Ping.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
const Discord = require('discord.js')
const client = new Discord.Client();
const ping = require('quickuptime')
let data = {
httpclient: "got"
}
const Ping = new ping.Client(data)
client.on('ready', ready => {
Ping.start(true)
Ping.uniquestartall(true)
console.log('ready')
})
client.on('message', message => {
if(message.author.bot) return;
if(!message.content.startsWith('$uptime'))return;
const args = message.content.trim().split(/ +/g);
if(!args[1])return message.channel.send("`invalid usage!\ncorrect usage - $uptime <url>`");
if(message.content.startsWith('$uptime'))
Ping.addurl(args[1])
Ping.uptime(args[1], 150000 , true)
message.channel.send('now this server will be pinged every 2.5min')
});
require('./server');
client.login("token")