Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const http = require('http');
- const express = require('express');
- const app = express();
- app.get("/", (request, response) => {
- response.sendStatus(200);
- });
- app.listen(process.env.PORT);
- setInterval(() => {
- http.get(`http://NameProject.glitch.me/`);
- }, 280000);
- // كل البكجات الي ممكن تحتجها في اي بوت
- const { Client, RichEmbed } = require("discord.js");
- var { Util } = require('discord.js');
- const {TOKEN, YT_API_KEY, prefix, devs} = require('./config')
- const client = new Client({ disableEveryone: true})
- const ytdl = require("ytdl-core");
- const canvas = require("canvas");
- const Canvas = require("canvas");
- const convert = require("hh-mm-ss")
- const fetchVideoInfo = require("youtube-info");
- const botversion = require('./package.json').version;
- const simpleytapi = require('simple-youtube-api')
- const moment = require("moment");
- const fs = require('fs');
- const util = require("util")
- const gif = require("gif-search");
- const opus = require("node-opus");
- const ms = require("ms");
- const jimp = require("jimp");
- const { get } = require('snekfetch');
- const guild = require('guild');
- const dateFormat = require('dateformat');//npm i dateformat
- const YouTube = require('simple-youtube-api');
- const youtube = new YouTube('AIzaSyAdORXg7UZUo7sePv97JyoDqtQVi3Ll0b8');
- const hastebins = require('hastebin-gen');
- const getYoutubeID = require('get-youtube-id');
- const yt_api_key = "AIzaSyDeoIH0u1e72AtfpwSKKOSy3IPp2UHzqi4";
- const pretty = require("pretty-ms");
- client.login(TOKEN);
- const queue = new Map();
- var table = require('table').table
- const Discord = require('discord.js');
- client.on('ready', () => {
- console.log(`Iam Ready My Owner ${client.user.tag}!`);
- });
- /////
- let anti = JSON.parse(fs.readFileSync("./antigreff.json", "UTF8"));
- let config = JSON.parse(fs.readFileSync("./config.json", "UTF8"));
- client.on("message", message => {
- if (!message.channel.guild) return;
- let user = anti[message.guild.id + message.author.id]
- let num = message.content.split(" ").slice(2).join(" ");
- if (!anti[message.guild.id + message.author.id]) anti[message.guild.id + message.author.id] = {
- actions: 0
- }
- if (!config[message.guild.id]) config[message.guild.id] = {
- banLimit: 3,
- chaDelLimit: 3,
- roleDelLimit: 3,
- kickLimits: 3,
- roleCrLimits: 3,
- time: 30
- }
- if (message.content.startsWith(prefix + "settings limits")) {
- if (!message.member.hasPermission('MANAGE_GUILD')) return;
- if (message.content.startsWith(prefix + "settings limitsban")) {
- if (!num) return message.channel.send("**⇏ | أرسل رقم ! **");
- if (isNaN(num)) return message.channel.send("**⇏ | أرقام فقط ! **");
- config[message.guild.id].banLimit = num;
- message.channel.send(`**⇏ | تم التغيير اِلي : ${config[message.guild.id].banLimit} **`)
- }
- if (message.content.startsWith(prefix + "settings limitskick")) {
- if (!num) return message.channel.send("**⇏ | أرسل رقم ! **");
- if (isNaN(num)) return message.channel.send("**⇏ | أرقام فقط ! **");
- config[message.guild.id].kickLimits = num;
- message.channel.send(`**⇏ | تم التغيير اِلي : ${config[message.guild.id].kickLimits}**`)
- }
- if (message.content.startsWith(prefix + "settings limitsroleD")) {
- if (!num) return message.channel.send("**⇏ | أرسل رقم ! **");
- if (isNaN(num)) return message.channel.send("**⇏ | أرقام فقط ! **");
- config[message.guild.id].roleDelLimit = num;
- message.channel.send(`**⇏ | تم التغيير اِلي : ${config[message.guild.id].roleDelLimit}**`)
- }
- if (message.content.startsWith(prefix + "settings limitsroleC")) {
- if (!num) return message.channel.send("**⇏ | أرسل رقم ! **");
- if (isNaN(num)) return message.channel.send("**⇏ | أرقام فقط ! **");
- config[message.guild.id].roleCrLimits = num;
- message.channel.send(`**⇏ | تم التغيير اِلي : ${config[message.guild.id].roleCrLimits}**`)
- }
- if (message.content.startsWith(prefix + "settings limitschannelD")) {
- if (!num) return message.channel.send("**⇏ | أرسل رقم ! **");
- if (isNaN(num)) return message.channel.send("**⇏ | أرقام فقط ! **");
- config[message.guild.id].chaDelLimit = num;
- message.channel.send(`**⇏ | تم التغيير اِلي : ${config[message.guild.id].chaDelLimit}**`)
- }
- if (message.content.startsWith(prefix + "settings limitstime")) {
- if (!num) return message.channel.send("**⇏ | أرسل رقم ! **");
- if (isNaN(num)) return message.channel.send("**⇏ | أرقام فقط ! **");
- config[message.guild.id].time = num;
- message.channel.send(`**⇏ | تم التغيير اِلي : ${config[message.guild.id].time}**`)
- }
- fs.writeFile("./config.json", JSON.stringify(config, null, 2), function (e) {
- if (e) throw e;
- });
- fs.writeFile("./antigreff.json", JSON.stringify(anti, null, 2), function (e) {
- if (e) throw e;
- });
- }
- });
- client.on("channelDelete", async channel => {
- const entry1 = await channel.guild.fetchAuditLogs({
- type: 'CHANNEL_DELETE'
- }).then(audit => audit.entries.first())
- console.log(entry1.executor.username)
- const entry = entry1.executor
- if (!config[channel.guild.id]) config[channel.guild.id] = {
- banLimit: 3,
- chaDelLimit: 3,
- roleDelLimit: 3,
- kickLimits: 3,
- roleCrLimits: 3
- }
- if (!anti[channel.guild.id + entry.id]) {
- anti[channel.guild.id + entry.id] = {
- actions: 1
- }
- setTimeout(() => {
- anti[channel.guild.id + entry.id].actions = "0"
- }, config[channel.guild.id].time * 1000)
- } else {
- anti[channel.guild.id + entry.id].actions = Math.floor(anti[channel.guild.id + entry.id].actions + 1)
- console.log("TETS");
- setTimeout(() => {
- anti[channel.guild.id + entry.id].actions = "0"
- }, config[channel.guild.id].time * 1000)
- if (anti[channel.guild.id + entry.id].actions >= config[channel.guild.id].chaDelLimit) {
- channel.guild.members.get(entry.id).ban().catch(e => channel.guild.owner.send(`**⇏ | ${entry.username} قام بمسح الكثير من الرومات **`))
- anti[channel.guild.id + entry.id].actions = "0"
- fs.writeFile("./config.json", JSON.stringify(config, null, 2), function (e) {
- if (e) throw e;
- });
- fs.writeFile("./antigreff.json", JSON.stringify(anti, null, 2), function (e) {
- if (e) throw e;
- });
- }
- }
- fs.writeFile("./config.json", JSON.stringify(config, null, 2), function (e) {
- if (e) throw e;
- });
- fs.writeFile("./antigreff.json", JSON.stringify(anti, null, 2), function (e) {
- if (e) throw e;
- });
- });
- client.on("roleDelete", async channel => {
- const entry1 = await channel.guild.fetchAuditLogs({
- type: 'ROLE_DELETE'
- }).then(audit => audit.entries.first())
- console.log(entry1.executor.username)
- const entry = entry1.executor
- if (!config[channel.guild.id]) config[channel.guild.id] = {
- banLimit: 3,
- chaDelLimit: 3,
- roleDelLimit: 3,
- kickLimits: 3,
- roleCrLimits: 3
- }
- if (!anti[channel.guild.id + entry.id]) {
- anti[channel.guild.id + entry.id] = {
- actions: 1
- }
- setTimeout(() => {
- anti[channel.guild.id + entry.id].actions = "0"
- }, config[channel.guild.id].time * 1000)
- } else {
- anti[channel.guild.id + entry.id].actions = Math.floor(anti[channel.guild.id + entry.id].actions + 1)
- console.log("TETS");
- setTimeout(() => {
- anti[channel.guild.id + entry.id].actions = "0"
- }, config[channel.guild.id].time * 1000)
- if (anti[channel.guild.id + entry.id].actions >= config[channel.guild.id].roleDelLimit) {
- channel.guild.members.get(entry.id).ban().catch(e => channel.guild.owner.send(`**⇏ | ${entry.username} قام بمسح الكثير من الرتب **`))
- anti[channel.guild.id + entry.id].actions = "0"
- fs.writeFile("./config.json", JSON.stringify(config, null, 2), function (e) {
- if (e) throw e;
- });
- fs.writeFile("./antigreff.json", JSON.stringify(anti, null, 2), function (e) {
- if (e) throw e;
- });
- }
- }
- fs.writeFile("./config.json", JSON.stringify(config, null, 2), function (e) {
- if (e) throw e;
- });
- fs.writeFile("./antigreff.json", JSON.stringify(anti, null, 2), function (e) {
- if (e) throw e;
- });
- });
- client.on("roleCreate", async channel => {
- const entry1 = await channel.guild.fetchAuditLogs({
- type: 'ROLE_CREATE'
- }).then(audit => audit.entries.first())
- console.log(entry1.executor.username)
- const entry = entry1.executor
- if (!config[channel.guild.id]) config[channel.guild.id] = {
- banLimit: 3,
- chaDelLimit: 3,
- roleDelLimit: 3,
- kickLimits: 3,
- roleCrLimits: 3
- }
- if (!anti[channel.guild.id + entry.id]) {
- anti[channel.guild.id + entry.id] = {
- actions: 1
- }
- setTimeout(() => {
- anti[channel.guild.id + entry.id].actions = "0"
- }, config[channel.guild.id].time * 1000)
- } else {
- anti[channel.guild.id + entry.id].actions = Math.floor(anti[channel.guild.id + entry.id].actions + 1)
- console.log("TETS");
- setTimeout(() => {
- anti[channel.guild.id + entry.id].actions = "0"
- }, config[channel.guild.id].time * 1000)
- if (anti[channel.guild.id + entry.id].actions >= config[channel.guild.id].roleCrLimits) {
- channel.guild.members.get(entry.id).ban().catch(e => channel.guild.owner.send(`**⇏ | ${entry.username} قام بأنشاء الكثير من الرتب **`))
- anti[channel.guild.id + entry.id].actions = "0"
- fs.writeFile("./config.json", JSON.stringify(config, null, 2), function (e) {
- if (e) throw e;
- });
- fs.writeFile("./antigreff.json", JSON.stringify(anti, null, 2), function (e) {
- if (e) throw e;
- });
- }
- }
- fs.writeFile("./config.json", JSON.stringify(config, null, 2), function (e) {
- if (e) throw e;
- });
- fs.writeFile("./antigreff.json", JSON.stringify(anti, null, 2), function (e) {
- if (e) throw e;
- });
- });
- client.on("guildBanAdd", async (guild, user) => {
- const entry1 = await channel.guild.fetchAuditLogs({
- type: 'MEMBER_BAN_ADD'
- }).then(audit => audit.entries.first())
- console.log(entry1.executor.username)
- const entry = entry1.executor
- if (!config[guild.id]) config[guild.id] = {
- banLimit: 3,
- chaDelLimit: 3,
- roleDelLimit: 3,
- kickLimits: 3,
- roleCrLimits: 3
- }
- if (!anti[guild.id + entry.id]) {
- anti[guild.id + entry.id] = {
- actions: 1
- }
- setTimeout(() => {
- anti[guild.id + entry.id].actions = "0"
- }, config[guild.id].time * 1000)
- } else {
- anti[guild.id + entry.id].actions = Math.floor(anti[guild.id + entry.id].actions + 1)
- console.log("TETS");
- setTimeout(() => {
- anti[guild.id + entry.id].actions = "0"
- }, config[guild.id].time * 1000)
- if (anti[guild.id + entry.id].actions >= config[guild.id].banLimit) {
- channel.members.get(entry.id).ban().catch(e => channel.owner.send(`**⇏ | ${entry.username} حاول حظر جميع الأعضاء **`))
- anti[guild.id + entry.id].actions = "0"
- fs.writeFile("./config.json", JSON.stringify(config, null, 2), function (e) {
- if (e) throw e;
- });
- fs.writeFile("./antigreff.json", JSON.stringify(anti, null, 2), function (e) {
- if (e) throw e;
- });
- }
- }
- fs.writeFile("./config.json", JSON.stringify(config, null, 2), function (e) {
- if (e) throw e;
- });
- fs.writeFile("./antigreff.json", JSON.stringify(anti, null, 2), function (e) {
- if (e) throw e;
- });
- });
- client.on("guildKickAdd", async (guild, user) => {
- const entry1 = await channel.fetchAuditLogs({
- type: 'MEMBER_KICK'
- }).then(audit => audit.entries.first())
- console.log(entry1.executor.username)
- const entry = entry1.executor
- if (!config[guild.id]) config[guild.id] = {
- banLimit: 3,
- chaDelLimit: 3,
- roleDelLimit: 3,
- kickLimits: 3,
- roleCrLimits: 3
- }
- if (!anti[guild.id + entry.id]) {
- anti[guild.id + entry.id] = {
- actions: 1
- }
- setTimeout(() => {
- anti[guild.id + entry.id].actions = "0"
- }, config[guild.id].time * 1000)
- } else {
- anti[guild.id + entry.id].actions = Math.floor(anti[guild.id + entry.id].actions + 1)
- console.log("TETS");
- setTimeout(() => {
- anti[guild.id + entry.id].actions = "0"
- }, config[guild.id].time * 1000)
- if (anti[guild.id + entry.id].actions >= config[guild.id].banLimit) {
- channel.members.get(entry.id).ban().catch(e => channel.owner.send(`**⇏ | ${entry.username} حاول حظر جميع الأعضاء **`))
- anti[guild.id + entry.id].actions = "0"
- fs.writeFile("./config.json", JSON.stringify(config, null, 2), function (e) {
- if (e) throw e;
- });
- fs.writeFile("./antigreff.json", JSON.stringify(anti, null, 2), function (e) {
- if (e) throw e;
- });
- }
- }
- fs.writeFile("./config.json", JSON.stringify(config, null, 2), function (e) {
- if (e) throw e;
- });
- fs.writeFile("./antigreff.json", JSON.stringify(anti, null, 2), function (e) {
- if (e) throw e;
- });
- });
- client.on("guildMemberRemove", async member => {
- const entry1 = await member.guild.fetchAuditLogs().then(audit => audit.entries.first())
- if (entry1.action === "MEMBER_KICK") {
- const entry2 = await member.guild.fetchAuditLogs({
- type: "MEMBER_KICK"
- }).then(audit => audit.entries.first())
- const entry = entry2.executor;
- if (!config[member.guild.id]) config[guild.id] = {
- banLimit: 3,
- chaDelLimit: 3,
- roleDelLimit: 3,
- kickLimits: 3,
- roleCrLimits: 3
- }
- if (!anti[member.guild.id + entry.id]) {
- anti[member.guild.id + entry.id] = {
- actions: 1
- }
- setTimeout(() => {
- anti[member.guild.id + entry.id].actions = "0"
- }, config[member.guild.id].time * 1000)
- } else {
- anti[member.guild.id + entry.id].actions = Math.floor(anti[member.guild.id + entry.id].actions + 1)
- console.log("TETS");
- setTimeout(() => {
- anti[member.guild.id + entry.id].actions = "0"
- }, config[member.guild.id].time * 1000)
- if (anti[member.guild.id + entry.id].actions >= config[member.guild.id].kickLimits) {
- member.members.get(entry.id).ban().catch(e => member.owner.send(`**⇏ | ${entry.username} حاول حظر جميع الأعضاء **`))
- anti[member.guild.id + entry.id].actions = "0"
- fs.writeFile("./config.json", JSON.stringify(config, null, 2), function (e) {
- if (e) throw e;
- });
- fs.writeFile("./antigreff.json", JSON.stringify(anti, null, 2), function (e) {
- if (e) throw e;
- });
- }
- }
- fs.writeFile("./config.json", JSON.stringify(config, null, 2), function (e) {
- if (e) throw e;
- });
- fs.writeFile("./antigreff.json", JSON.stringify(anti, null, 2), function (e) {
- if (e) throw e;
- });
- }
- })
- ///Uploaded By L U X Y
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement