-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.js
127 lines (102 loc) · 3.8 KB
/
server.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
require("express")().listen(1343);
const db = require("quick.db");
const discord = require("discord.js");
const client = new discord.Client({ disableEveryone: true });
client.login("token");
const fetch = require("node-fetch");
const fs = require('fs')
setInterval(() => {
var links = db.get("linkler");
if(!links) return;
var linkA = links.map(c => c.url)
linkA.forEach(link => {
try {
fetch(link)
} catch(e) { console.log("" + e) };
})
console.log("Başarıyla Pinglendi.")
}, 60000)
client.on("ready", () => {
if(!Array.isArray(db.get("linkler"))) {
db.set("linkler", [])
}
})
client.on("ready", () => {
client.user.setActivity(`u.help | ${db.get("linkler").length} / ${client.guilds.size}`)
console.log(`Logined`)
})
client.on("message", message => {
if(message.author.bot) return;
var spl = message.content.split(" ");
if(spl[0] == "!ekle") {
var link = spl[1]
fetch(link).then(() => {
if(db.get("linkler").map(z => z.url).includes(link)) return message.channel.send("<:asuna_no:732219380795965471> Zaten Eklenmiş!")
message.channel.send("<:asuna_yes:732219381085503529> Başarılı!");
db.push("linkler", { url: link, owner: message.author.id})
}).catch(e => {
return message.channel.send("<:asuna_no:732219380795965471> " + e)
})
}
})
client.on("message", message => {
if(message.author.bot) return;
var spl = message.content.split(" ");
if(spl[0] == "!botsay") {
var link = spl[1]
message.channel.send(`${db.get("linkler").length} / ${client.guilds.size}`)
}})
const Discord = require('discord.js');
client.on("message", message => {
if(message.author.bot) return;
var spl = message.content.split(" ");
if(spl[0] == "!yardım") {
let embed = new Discord.RichEmbed()
.setColor('#4ca74c')
.addField(`Uptime Bot v1.0 Yardım`, `Bot glitch sitelerinin 7/24 açık çalışmasını sağlayan bir sistem içerir. Sistemdeki bağlantılar herhangi bir bakım gerektirmeden 7/24 çalışır.`)
.addField(`Genel Komutlar`,`
\`!yardım\` - Yardım Menüsünü Gösterir.
\`!ekle\` - Sisteme Bot Eklersiniz.
\`!botsay\` - Sistemde Kaç Bot Olduğunu Listeler.
`)
.addField(`Link`, `[Loz 'Bey](https://discord.gg/WbMUB2k)
[Botumuzu Ekleyin](https://discord.com/oauth2/authorize?client_id=727978641702649966&scope=bot&permissions=8)
[Destek Sunucumuz](https://discord.gg/WbMUB2k)`)
.setThumbnail(client.user.avatarURL)
.setAuthor(`Uptime`, client.user.avatarURL)
.setFooter(`2020 © Uptime | Kodlayan MertBhey, Editleyenler Alfonzo, Loz 'Bey.`, client.user.avatarURL)
return message.channel.send(embed);
}
})
client.on("message", async message => {
if(!message.content.startsWith("u.eval")) return;
if(!["689169122604744833","689169122604744833"].includes(message.author.id)) return;
var args = message.content.split("u.eval")[1]
if(!args) return message.channel.send("<:asuna_no:732219380795965471> ..")
const code = args
function clean(text) {
if (typeof text !== 'string')
text = require('util').inspect(text, { depth: 3 })
text = text
.replace(/`/g, '`' + String.fromCharCode(8203))
.replace(/@/g, '@' + String.fromCharCode(8203))
return text;
};
var evalEmbed = ""
try {
var evaled = await clean(await eval(await code));
if (evaled.constructor.name === 'Promise') evalEmbed = `\`\`\`\n${evaled}\n\`\`\``
else evalEmbed = `\`\`\`js\n${evaled}\n\`\`\``
if(evaled.length < 1900) {
message.channel.send(`\`\`\`js\n${evaled}\`\`\``);
} else {
var hast = await require("hastebin-gen")(evaled, { url: "https://hasteb.in" } )
message.channel.send(hast)
}
} catch (err) {
message.channel.send(`\`\`\`js\n${err}\n\`\`\``);
}
})
const log = message => {
console.log(`${message}`);
}