diff --git a/.replit b/.replit new file mode 100644 index 0000000..08b507c --- /dev/null +++ b/.replit @@ -0,0 +1 @@ +run="node index.js" \ No newline at end of file diff --git a/JSON/fishes.json b/JSON/fishes.json new file mode 100644 index 0000000..20df021 --- /dev/null +++ b/JSON/fishes.json @@ -0,0 +1,32 @@ +{ + "junk": { + "symbol": "πŸ”§", + "max": 30, + "min": 10 + }, + "common": { + "symbol": "🐟", + "max": 70, + "min": 30 + }, + "uncommon": { + "symbol": "🐠", + "max": 90, + "min": 50 + }, + "rare": { + "symbol": "πŸ¦‘", + "max": 175, + "min": 130 + }, + "legendary": { + "symbol": "πŸ‹", + "max": 500, + "min": 100 + }, + "mythical": { + "symbol": "πŸ’Ž", + "max": 1000, + "min": 300 + } +} \ No newline at end of file diff --git a/JSON/works.json b/JSON/works.json new file mode 100644 index 0000000..9215f5d --- /dev/null +++ b/JSON/works.json @@ -0,0 +1,36 @@ +[ + "You work as a flatulence smell reduction underwear maker and earn", + "You work at Grandma's restaurant as a cook and earn", + "You work as a professional smuggler and earn", + "You work as a pumpkin painter and earn", + "You work as a engineer and earn", + "You work as a meerkat behaviour consultant and earn", + "Your job as a fart collector is very interesting and earns you", + "You work as a penguinologist and earn", + "You work as a ear cleaner and earn", + "You develop games and earn", + "You work as a personal shopper and earn", + "You work as a dog surfing instructor and earn", + "You work as a beefeater and earn", + "You work as a comedian and earn", + "You work as the head of elephants and earn", + "You work as an elementary school teacher and earn", + "You worked as a voice actor for Spongebob and managed to gain", + "You had a fruitful day at the office today and earned", + "You actually finished the plate of vegetables that your parents made you eat! You were awarded", + "You work as child birth educator and earn", + "You work as a body pillow factory salesman on the Internet for real weebs, the weebs gave you", + "You work as a vibration consultant and earn", + "Work at the icecream shop of your childhood dreams and earn", + "You work as a professional minecraft hacker. You manage to rake in", + "You dabbed so hard that even your mother is proud! You make", + "You work as a professional cleaner. After hiding the body, you're handed", + "You got cloned for sciene. You earned", + "You work as a police officer and earn", + "You work as a bush pruner for Donald Trump and earn", + "You work as a paper towel sniffer and earn", + "You work as a water slide tester and earn", + "You milk a cow for", + "You work as a fucker.", + "You work as a roblox gamer and earn ⏣" + ] \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..d630abd --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +# πŸ€– zAltmr +#### A **Multipurposed Discord Bot** Made Using [discord.js](https://discord.js.org/#) +![alt text](https://cdn.discordapp.com/attachments/811143476522909718/846350512379265044/zAltmrBanner.png) + +## β„Ή About zAltmr +zAltmr Has More Than 20 Commands, Cool Features, And Epic! Made By 1 User, [Skaryet](https://github.com/endternvl). zAltmr's Prefix Is Changeable, Using [quick.db](http://quickdb.js.org/). NSFW Content, Only Allowed In NSFW, Help Command With Command Folder Name! + +### Is zAltmr's Source Code Free To Use? +Sure, It's Free! You Can Use It. But If You Got Tons Of Errors, Don't Ask Me. Try To Do What Error's Want. + +### Setup zAltmr πŸ‘¨β€πŸ’» +- First, All You Have To Do Is `npm i` +- Then, Set Up The `./config.json` +- To Start, Do `node index.js` + +> Β© Copyright 2021 zAltmr \ No newline at end of file diff --git "a/commands/\342\204\271 _ Info/Weather.js" "b/commands/\342\204\271 _ Info/Weather.js" new file mode 100644 index 0000000..3350e57 --- /dev/null +++ "b/commands/\342\204\271 _ Info/Weather.js" @@ -0,0 +1,75 @@ +const weather = require('weather-js'); + +const discord = require('discord.js') + +//TIME TO END STREAM + +module.exports = { + + name: "weather", + + description: "Get the weather of anywhere", + + category: "info", + + usage: "weathet <>", + + run: (client, message, args) => { + + + + + + if(!args.length) { + + return message.channel.send("Please give the weather location") + + } + + + + weather.find({search: args.join(" "), degreeType: 'C'}, function(err, result) { + +try { + + + +let embed = new discord.MessageEmbed() + +.setTitle(`Weather - ${result[0].location.name}`) + +.setColor("#ff2050") + +.setDescription("Temperature units can may be differ some time") + +.addField("Temperature", `${result[0].current.temperature} Celcius`, true) + +.addField("Sky Text", result[0].current.skytext, true) + +.addField("Humidity", result[0].current.humidity, true) + +.addField("Wind Speed", result[0].current.windspeed, true)//What about image + +.addField("Observation Time", result[0].current.observationtime, true) + +.addField("Wind Display", result[0].current.winddisplay, true) + +.setThumbnail(result[0].current.imageUrl); + + message.channel.send(embed) + +} catch(err) { + + return message.channel.send("Unable To Get the data of Given location") + +} + +}); + + //LETS CHECK OUT PKG + + + + } + +} \ No newline at end of file diff --git "a/commands/\342\204\271 _ Info/animeinfo.js" "b/commands/\342\204\271 _ Info/animeinfo.js" new file mode 100644 index 0000000..2f9802e --- /dev/null +++ "b/commands/\342\204\271 _ Info/animeinfo.js" @@ -0,0 +1,60 @@ +const { get } = require("request-promise-native"); +const { MessageEmbed } = require("discord.js") + +module.exports = { +name: "animeinfo", + category: "info", + description: "Get anime information", + usage: "anime ", + run: (client, message, args) => { + + + + if(!args.length) { + return message.channel.send("Please Give Anime Name!") + } + //DEFINE OPTIONS + + let option = { + url: `https://kitsu.io/api/edge/anime?filter[text]=${args.join(" ")}`, + method: `GET`, + headers: { + 'Content-Type': "application/vnd.api+json", + 'Accept': "application/vnd.api+json" + + }, + json: true + } + + + message.channel.send("Fetching The Info...").then(msg => { + get(option).then(body => { + try { + let embed = new MessageEmbed() + .setTitle(body.data[0].attributes.titles.en) + .setColor("RED") + .addField("β„Ή About", body.data[0].attributes.synopsis) + .setThumbnail(body.data[0].attributes.posterImage.original) + .addField("⭐ Ratings ⭐", body.data[0].attributes.averageRating) + //.addField("TOTAL EPISODES", body.data[0].attributes.episodeCount) + .setImage(body.data[0].attributes.coverImage.large) + //try it + + + message.channel.send(embed) + msg.delete(); + + } catch (err) { + msg.delete(); + return message.channel.send("Unable to find this anime"); + } + + + + } + + )}) + + } + +} \ No newline at end of file diff --git "a/commands/\342\204\271 _ Info/avatar.js" "b/commands/\342\204\271 _ Info/avatar.js" new file mode 100644 index 0000000..9b31083 --- /dev/null +++ "b/commands/\342\204\271 _ Info/avatar.js" @@ -0,0 +1,25 @@ +const Discord = require('discord.js'); +const config = require('../../config.json'); + + +module.exports = { + name: 'avatar', + description: 'Show user avatar', + aliases: ["av"], + category: "info", + usage: '', + accessableby: "", + run: async (client, message, args) => { + + const member = message.mentions.members.first() || message.guild.members.cache.get(args[0]) || message.guild.members.cache.find(r => r.user.username.toLowerCase() === args.join(' ').toLocaleLowerCase()) || message.guild.members.cache.find(r => r.displayName.toLowerCase() === args.join(' ').toLocaleLowerCase()) || message.member; + const embed = new Discord.MessageEmbed() + .setColor(config.embedcolor) + .setTitle(`❯ ${client.user.username} - Users ${member.user.tag}`) + .setDescription(`❯ \`Download Links:\` **[png](${member.user.displayAvatarURL({format: "png", size: 1024})}) | [jpg](${member.user.displayAvatarURL({format: "jpg", size: 1024})}) | [gif](${member.user.displayAvatarURL({format: "gif", size: 1024, dynamic: true})}) | [webp](${member.user.displayAvatarURL({format: "webp", size: 1024})})**`) + .setImage(member.user.displayAvatarURL({ dynamic: true, size: 1024 })) + .setFooter(`Requested by ${message.member.displayName}`, message.author.displayAvatarURL({ dynamic: true, size: 1024 })) + .setTimestamp() + return message.channel.send(embed) + + } +} \ No newline at end of file diff --git "a/commands/\342\204\271 _ Info/badges.js" "b/commands/\342\204\271 _ Info/badges.js" new file mode 100644 index 0000000..ca091ce --- /dev/null +++ "b/commands/\342\204\271 _ Info/badges.js" @@ -0,0 +1,22 @@ +const { Client, Message, MessageEmbed } = require('discord.js'); + +module.exports = { + name: 'badges', + category: 'info', + description: 'just **badge**', + usage: 'badge ', + /** + * @param {Client} client + * @param {Message} message + * @param {String[]} args + */ + run: async(client, message, args) => { + const user = message.mentions.users.first() || message.author; + + const flags = user.flags.toArray(); + + console.log(flags); + + message.channel.send(`${user}'s badges: ${flags.join(', ')}`) + } +} \ No newline at end of file diff --git "a/commands/\342\204\271 _ Info/botinfo.js" "b/commands/\342\204\271 _ Info/botinfo.js" new file mode 100644 index 0000000..f82d294 --- /dev/null +++ "b/commands/\342\204\271 _ Info/botinfo.js" @@ -0,0 +1,46 @@ + +const Discord = require("discord.js") + +const { version } = require("discord.js"); +const moment = require("moment"); +const m = require("moment-duration-format"); +let os = require('os') +let cpuStat = require("cpu-stat") +const ms = require("ms") + + + + +module.exports = { + name: "botinfo", + category: "info", + description: "Sends detailed info about the client", + usage: "[command]", + run: async (client, message, args) => { + //command + let cpuLol; + cpuStat.usagePercent(function(err, percent, seconds) { + if (err) { + return console.log(err); + } + const duration = moment.duration(client.uptime).format(" D [days], H [hrs], m [mins], s [secs]"); + const botinfo = new Discord.MessageEmbed() + .setAuthor(client.user.username) + .setTitle("__**Stats:**__") + .setColor("RANDOM") + .addField("⏳ Mem Usage", `${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} / ${(os.totalmem() / 1024 / 1024).toFixed(2)} MB`, true) + .addField("⌚️ Uptime ", `${duration}`, true) + .addField("πŸ“ Users", `${client.users.cache.size}`, true) + .addField("πŸ“ Servers", `${client.guilds.cache.size}`, true) + .addField("πŸ“ Channels ", `${client.channels.cache.size}`, true) + .addField("πŸ‘Ύ Discord.js", `v${version}`, true) + .addField("πŸ€– Node", `${process.version}`, true) + .addField("πŸ€– CPU", `\`\`\`md\n${os.cpus().map(i => `${i.model}`)[0]}\`\`\``) + .addField("πŸ€– CPU usage", `\`${percent.toFixed(2)}%\``, true) + .addField("πŸ€– Arch", `\`${os.arch()}\``, true) + .addField("πŸ’» Platform", `\`\`${os.platform()}\`\``, true) + .addField("API Latency", `${(client.ws.ping)}ms`) + message.channel.send(botinfo) + }); + } + }; \ No newline at end of file diff --git "a/commands/\342\204\271 _ Info/bots.js" "b/commands/\342\204\271 _ Info/bots.js" new file mode 100644 index 0000000..bc8fb50 --- /dev/null +++ "b/commands/\342\204\271 _ Info/bots.js" @@ -0,0 +1,24 @@ +const { MessageEmbed } = require('discord.js'); + +module.exports = { + name: 'allbots', + description: 'show all bots in guild', + usage: 'allbots', + category: 'info', + run: async (client, message, args) => { + + let checked = '<:online:826091925945319474>'; + let unchecked = '<:offline:826092002886025246>'; + + + const allbots = message.guild.members.cache.filter(m => m.user.bot).map((m) => m).map((m) => `${m.user.flags ? checked : unchecked} ${m.user.tag} (${m.id})`).join('\n'); + + const embed = new MessageEmbed() + .setColor('RANDOM') + .setAuthor(message.author.tag, message.author.displayAvatarURL({ dynamic: true })) + .setDescription(allbots) + .setFooter(client.user.tag, client.user.displayAvatarURL()) + .setTimestamp(); + message.channel.send(embed) + } +}; \ No newline at end of file diff --git "a/commands/\342\204\271 _ Info/chinvite.js" "b/commands/\342\204\271 _ Info/chinvite.js" new file mode 100644 index 0000000..35fefb0 --- /dev/null +++ "b/commands/\342\204\271 _ Info/chinvite.js" @@ -0,0 +1,54 @@ +const { MessageEmbed } = require("discord.js"); +const Color = "RANDOM"; + +//starting command handler and command +module.exports = { + name: "chinv", + category: "info", + description: "Gives you a channel invite (no temp) and (temp invite)", + usage: "chinv | chinv temp", + + run: async(client, message, args) => { + const channels = + message.mentions.channels.first() || + message.guild.channels.cache.get(`${args[0]}`) || + message.guild.channels.cache.find(x => x.name === `${args.join(" ")}`) || + message.channel; + + let check; + if (args[0] === "temp") { + check = "true"; + } else if (args[1] === "temp") { + check = "true"; + } else { + check = "false"; + } + let check2; + if (args[0] === "temp") { + check2 = "86400"; + } else if (args[1] === "temp") { + check2 = "86400"; + } else { + check2 = "0"; + } + + channels + .createInvite({ + temporary: `${check}`, + maxAge: `${check2}`, + maxUses: 0, + reason: `©️ SyzeBot` + }) + .then(InviteCode => + message.channel.send( + new MessageEmbed() + .setColor(`${Color}`) + .setTitle(`${channels.name} Invite`) + .setThumbnail(message.author.displayAvatarURL()) + .addField(`Link Of ${channels.name} Invite`, `https://discord.gg/${InviteCode.code}`) + .setFooter(`©️ SyzeBot`) + .setTimestamp() + ) + ); + } +} \ No newline at end of file diff --git "a/commands/\342\204\271 _ Info/covid.js" "b/commands/\342\204\271 _ Info/covid.js" new file mode 100644 index 0000000..55cdb47 --- /dev/null +++ "b/commands/\342\204\271 _ Info/covid.js" @@ -0,0 +1,77 @@ +const Discord = require('discord.js'); +const api = require('covidapi'); +const fetch = require('node-fetch'); +// installing the package to the fetch links + + +module.exports = { + name: "covid", + aliases: ["corona", "covid19"], + description: "corona info to all country or country", + usage: "sz!covid all/sz!covid ", + category: "info", + + run: async (Client, message, args) => { + + let countries = args.join(" "); + // the country = =covid country + + // if there is no country provided it sends this embed + const noArgs = new Discord.MessageEmbed() + .setTitle('Invalid Command Usage') + .setColor(0xFF0000) + .setDescription('You Can Try Using **`sz!covid/corona all`** or **`sz!covid/corona `**') + // sends the noArgs embed + if (!args[0]) return message.channel.send(noArgs); + console.log(`${message.author.username} dont knwo how to use dis command in ${message.guild.name}`) + + + + // if some1 typed =covid all it will send the worldwide covid cases + if (args[0] === "all") { + // fetching the covid data + fetch(`https://covid19.mathdro.id/api`) + .then(response => response.json()) + .then(data => { + // gets the worldwide's covid data from the website + let confirmed = data.confirmed.value.toLocaleString() + let recovered = data.recovered.value.toLocaleString() + let deaths = data.deaths.value.toLocaleString() + + // making the covid embed with the world stats + const embed = new Discord.MessageEmbed() + .setTitle(`🌎 Worldwide COVID-19 Stats`) + .addField(' Confirmed Cases', confirmed) + .addField('πŸ₯ Recovered', recovered) + .addField('☠️ Deaths', deaths) + + message.channel.send(embed) + }) + + + // so if someone send =covid (country) not =covid all it will send this + } else { + // fetching the data of all the countries + fetch(`https://covid19.mathdro.id/api/countries/${countries}`) + .then(response => response.json()) + .then(data => { + // getting the data of the countries + let confirmed = data.confirmed.value.toLocaleString() + let recovered = data.recovered.value.toLocaleString() + let deaths = data.deaths.value.toLocaleString() + + // making a embed with the info of the country that you choosed + const embed = new Discord.MessageEmbed() + .setTitle(`COVID-19 Stats for **${countries}**`) + .addField(' Confirmed Cases', confirmed) + .addField('πŸ₯ Recovered', recovered) + .addField('☠️ Deaths', deaths) + + message.channel.send(embed) + }).catch(e => { + // if he can't find the country that u said it will send this message + return message.channel.send(`${args[0]} is not a country! maybe typo?`) + }) + } + } +} \ No newline at end of file diff --git "a/commands/\342\204\271 _ Info/djs.js" "b/commands/\342\204\271 _ Info/djs.js" new file mode 100644 index 0000000..99c994c --- /dev/null +++ "b/commands/\342\204\271 _ Info/djs.js" @@ -0,0 +1,45 @@ +const fetch = require("node-fetch"); + +module.exports = { + + name: "discord", + category: "info", + aliases: ["discorddocs", "djs", "docs"], + + run: async(client, message, args) => { + const search = args[0]; + if (!search) return message.channel.send({ + embed: { + "color": 0x4D5E94, + "description": "❌ **What are you searching?**" + + } + }); + let version = args[1]; + if (!version) version = `stable`; + + fetch(`https://djsdocs.sorta.moe/v2/embed?src=${encodeURIComponent(version)}&q=${encodeURIComponent(search)}`) + .then(res => res.json()) + .then(body => { + if (body === null) return message.channel.send({ + embed: { + "color": 0x4D5E94, + "author": { + "name": "Discord.js Docs (master)", + "url": "https://discord.js.org/#/docs/main/master", + "icon_url": "https://discord.js.org/favicon.ico" + }, + "title": "Search results:", + "description": "❌ **No results.**" + } + }); + body.color = 0x4D5E94; + message.channel.send({ embed: body }); + }) + .catch(e => { + message.channel.send({ + embed: { "color": 0x4D5E94, "author": { "name": "Discord.js Docs (master)", "url": "https://discord.js.org/#/docs/main/master", "icon_url": "https://discord.js.org/favicon.ico" }, "title": "Search results:", "description": "No results." } + }); + }); + } +} \ No newline at end of file diff --git "a/commands/\342\204\271 _ Info/emojiinfo.js" "b/commands/\342\204\271 _ Info/emojiinfo.js" new file mode 100644 index 0000000..2573f13 --- /dev/null +++ "b/commands/\342\204\271 _ Info/emojiinfo.js" @@ -0,0 +1,32 @@ +const Discord = require('discord.js') +const moment = require('moment')//npm i moment +module.exports = { + name: "emojiinfo", + aliases: ["emoteid"], + usage: "emojiinfo ", + category: "info", + description: "Show emojiinfo of emoji", + run: async (client, message, args) => { + let emojiName = args.join(" "); + let emoji = message.guild.emojis.cache.get(args[0]) || message.guild.emojis.cache.find(emoji => emoji.name === `${emojiName}`) + if (!args[0]) return message.channel.send("Please provide an emoji name or id!") + if (!emoji) return message.channel.send("Could not find emoji... Please provide emoji name or emoji id!") + let xd; + if(emoji.animated) xd = "" + if(!emoji.animated) xd = '' + let embed = new Discord.MessageEmbed() + + .addField("Name", `${emoji.name}`) + .addField("Emoji id", `${emoji.id}`) + .addField("Outlook", `${emoji}`) + .addField("Created at", `${moment(emoji.createdTimestamp).format('LT')} ${moment(emoji.createdTimestamp).format('LL')} ${moment(emoji.createdTimestamp).fromNow()}`) + .addField("Guild", message.guild.name) + .addField("ANIMATED", xd) + .setThumbnail(emoji.url) + .setColor("RANDOM") + .addField("Format", `\`<:${emoji.name}:${emoji.id}>\``) + .addField("URL", `[click here](${emoji.url})`) + + message.channel.send(embed) + } +} diff --git "a/commands/\342\204\271 _ Info/firstm.js" "b/commands/\342\204\271 _ Info/firstm.js" new file mode 100644 index 0000000..cacf133 --- /dev/null +++ "b/commands/\342\204\271 _ Info/firstm.js" @@ -0,0 +1,32 @@ +const { Client, Message, MessageEmbed } = require("discord.js"); + +module.exports = { + name: "firstmessage", + description: "send first message on this channel.", + usage: "firstmessage/firm", + category: "info", + aliases: ["firm"], + /** + * @param {Client} client + * @param {Message} message + * @param {String[]} args + */ + run: async (client, message, args) => { + const fetchMessages = await message.channel.messages.fetch({ + after: 1, + limit: 1, + }); + const msg = fetchMessages.first(); + + message.channel.send( + new MessageEmbed() + .setTitle(`First Messsage in ${message.channel.name}`) + .setURL(msg.url) + .setThumbnail(msg.author.displayAvatarURL({ dynamic: true })) + .setDescription("Content: " + msg.content) + .addField("Author", msg.author, true) + .addField('Message ID', msg.id, true) + .addField('Created At', message.createdAt.toLocaleDateString(), true) + ); + }, +}; \ No newline at end of file diff --git "a/commands/\342\204\271 _ Info/github.js" "b/commands/\342\204\271 _ Info/github.js" new file mode 100644 index 0000000..b30bc72 --- /dev/null +++ "b/commands/\342\204\271 _ Info/github.js" @@ -0,0 +1,47 @@ +const { Discord, discord } = require("discord.js"); +const { MessageEmbed } = require("discord.js"); +const moment = require("moment"); +const fetch = require("node-fetch") + +module.exports = { + name: "github", + aliases: ["git"], + category: "info", + usage: "Github ", + exmaple: "Github Emoji", + description: `Github User Account Information!`, + run: async (client, message, args) => { + + try { + + if (!args[0]) return message.channel.send(`Please Give Me A Username!`) + + fetch(`https://api.github.com/users/${args.join('-')}`) + .then(res => res.json()).then(body => { + if(body.message) return message.channel.send(`User Not Found | Please Give Me A Valid Username!`); + let { login, avatar_url, name, id, html_url, public_repos, followers, following, location, created_at, bio } = body; + + const embed = new MessageEmbed() + .setAuthor(`${login} Information!`, avatar_url) + .setColor(`#211F1F`) + .setThumbnail(`${avatar_url}`) + .addField(`Username`, `${login}`) + .addField(`ID`, `${id}`) + .addField(`Bio`, `${bio || "No Bio"}`) + .addField(`Public Repositories`, `${public_repos || "None"}`, true) + .addField(`Followers`, `${followers}`, true) + .addField(`Following`, `${following}`, true) + .addField(`Location`, `${location || "No Location"}`) + .addField(`Account Created`, moment.utc(created_at).format("dddd, MMMM, Do YYYY")) + .setFooter(`Tysm For Using Me! ${message.author.username}`) + + message.channel.send(embed) + + }) + + } catch (error) { + console.log(`[Commands] [github] Getting Error In github Command :\n`, error); + return message.channel.send(`Something Went Wrong Try Again Later!`) + } + } +}; \ No newline at end of file diff --git "a/commands/\342\204\271 _ Info/gituser.js" "b/commands/\342\204\271 _ Info/gituser.js" new file mode 100644 index 0000000..88e14a6 --- /dev/null +++ "b/commands/\342\204\271 _ Info/gituser.js" @@ -0,0 +1,48 @@ +const { Discord, discord } = require("discord.js"); +const { MessageEmbed } = require("discord.js"); +const moment = require("moment"); +const fetch = require("node-fetch") +const { sendError } = require('../../mores/error'); + +module.exports = { + name: "gituser", + aliases: ["git"], + category: "search", + usage: "Github [GITHUB_USERNAME]", + exmaple: "Github Emoji", + description: `Github User Account Information!`, + run: async (client, message, args) => { + + try { + + if (!args[0]) return sendError("You Didn't Provide A Github Username!", message.channel) + + fetch(`https://api.github.com/users/${args.join('-')}`) + .then(res => res.json()).then(body => { + if(body.message) return sendError(`This User | ${args[0]} | Is Not In Github! Please Enter A Valid Username!`, message.channel); + let { login, avatar_url, name, id, html_url, public_repos, followers, following, location, created_at, bio } = body; + + const embed = new MessageEmbed() + .setAuthor(`${login} Information!`, avatar_url) + .setColor(`#211F1F`) + .setThumbnail(`${avatar_url}`) + .addField(`Username`, `${login}`) + .addField(`ID`, `${id}`) + .addField(`Bio`, `${bio || "No Bio"}`) + .addField(`Public Repositories`, `${public_repos || "None"}`, true) + .addField(`Followers`, `${followers}`, true) + .addField(`Following`, `${following}`, true) + .addField(`Location`, `${location || "No Location"}`) + .addField(`Account Created`, moment.utc(created_at).format("dddd, MMMM, Do YYYY")) + .setFooter(`Tysm For Using Me! ${message.author.username}`) + + message.channel.send(embed) + + }) + + } catch (error) { + console.log(`[Commands] [github] Getting Error In github Command :\n`, error); + return sendError(`Something Went Wrong Try Again Later!`, message.channel) + } + } +}; \ No newline at end of file diff --git "a/commands/\342\204\271 _ Info/ig.js" "b/commands/\342\204\271 _ Info/ig.js" new file mode 100644 index 0000000..84910c8 --- /dev/null +++ "b/commands/\342\204\271 _ Info/ig.js" @@ -0,0 +1,48 @@ +const { RichEmbed } = require("discord.js"); +const { stripIndents } = require("common-tags"); + +const fetch = require("node-fetch"); + +module.exports = { + name: "instagram", + aliases: ["insta", "insg"], + category: "info", + description: "Find out some nice instagram statistics", + usage: ",insg/instagram/insta ", + run: async (client, message, args) => { + const name = args.join(" "); + + if (!name) { + return message.reply("Maybe it's useful to actually search for someone...!") + .then(m => m.delete(5000)); + } + + const url = `https://instagram.com/${name}/?__a=1`; + + let res; + + try { + res = await fetch(url).then(url => url.json()); + } catch (e) { + return message.reply("I couldn't find that account! Is that available on instagram? maybe you typo...") + .then(m => m.delete(5000)); + } + + const account = res.graphql.user; + + const embed = new RichEmbed() + .setColor("RANDOM") + .setTitle(account.full_name) + .setURL(`https://instagram.com/${name}`) + .setThumbnail(account.profile_pic_url_hd) + .addField("Profile information", stripIndents`**- Username:** ${account.username} + **- Full name:** ${account.full_name} + **- Biography:** ${account.biography.length == 0 ? "none" : account.biography} + **- Posts:** ${account.edge_owner_to_timeline_media.count} + **- Followers:** ${account.edge_followed_by.count} + **- Following:** ${account.edge_follow.count} + **- Private account:** ${account.is_private ? "Yes πŸ”" : "Nope πŸ”“"}`); + + message.channel.send(embed); + } +} \ No newline at end of file diff --git "a/commands/\342\204\271 _ Info/imdb.js" "b/commands/\342\204\271 _ Info/imdb.js" new file mode 100644 index 0000000..3dbb259 --- /dev/null +++ "b/commands/\342\204\271 _ Info/imdb.js" @@ -0,0 +1,36 @@ +const discord = require("discord.js"); +const imdb = require("imdb-api"); + +module.exports = { +name: "imdb", + description: "Get the information about series and movie", + category: "info", + usage: "imdb ", + run: async (client, message, args, color) => { + + if(!args.length) { + return message.channel.send("Please give the name of movie or series") + } + + const imob = new imdb.Client({apiKey: "5e36f0db"}) //You need to paste you imdb api + + let movie = await imob.get({'name': args.join(" ")}) + + let embed = new discord.MessageEmbed() + .setTitle(movie.title) + .setColor("RANDOM") + .setThumbnail(movie.poster) + .setDescription(movie.plot) + .setFooter(`Ratings: ${movie.rating}`) + .addField("Country", movie.country, true) + .addField("Languages", movie.languages, true) + .addField("Type", movie.type, true); + + + message.channel.send(embed) + + + + } + +} \ No newline at end of file diff --git "a/commands/\342\204\271 _ Info/insta.js" "b/commands/\342\204\271 _ Info/insta.js" new file mode 100644 index 0000000..43bbadb --- /dev/null +++ "b/commands/\342\204\271 _ Info/insta.js" @@ -0,0 +1,46 @@ +const axios = require('axios') +const { MessageEmbed } = require('discord.js'); +module.exports = { + name: "instagram", + description: "find a user that u searched", + aliases: ["ig", "insta"], + category: "search", + run: async (client, message, args) => { + if (!args[0]) { + return message.channel.send(`Please Enter a Channel Name`) + } + let url, response, account, details; + try { + url = `https://instagram.com/${args[0]}/?__a=1`; + response = await axios.get(url) + account = response.data + details = account.graphql.user + } catch (error) { + return message.channel.send(`Can't Find That User, Or Maybe A Private User? Or Else?`) + } + + const embed = new MessageEmbed() + .setTitle(`${details.is_verified ? `${details.username} ` : ` ${details.username}`} ${details.is_private ? 'πŸ”’' : ''} `) + .setDescription(details.biography) + .setThumbnail(details.profile_pic_url) + .addFields( + { + name: "Total Posts:", + value: details.edge_owner_to_timeline_media.count.toLocaleString(), + inline: true + }, + { + name: "Followers:", + value: details.edge_followed_by.count.toLocaleString(), + inline: true + }, + { + name: "Following:", + value: details.edge_follow.count.toLocaleString(), + inline: true + } + ) + await message.channel.send(embed) + + } +} \ No newline at end of file diff --git "a/commands/\342\204\271 _ Info/inviter.js" "b/commands/\342\204\271 _ Info/inviter.js" new file mode 100644 index 0000000..0739923 --- /dev/null +++ "b/commands/\342\204\271 _ Info/inviter.js" @@ -0,0 +1,41 @@ +const Discord = require('discord.js'); + + + + +module.exports = { + + name:"invites", + aliases: ["invs"], + category: "info", + description: 'invite tracker of the server', + + run: async (bot, message, args) => { + try { + let member = await message.mentions.members.first() || message.guild.members.cache.get(args[0]) || message.guild.members.cache.find(r => r.user.username.toLowerCase() === args.join(' ').toLocaleLowerCase()) || message.guild.members.cache.find(r => r.displayName.toLowerCase() === args.join(' ').toLocaleLowerCase()) || message.member; + + let invites = await message.guild.fetchInvites() + + let memberInvites = invites.filter(i => i.inviter && i.inviter.id === member.user.id); + + if (memberInvites.size <= 0) { + return message.channel.send(`**${member.displayName} didn't invite anyone to the server!**`, (member === message.member ? null : member)); + {} } + + let content = memberInvites.map(i => i.code).join("\n"); + let index = 0; + memberInvites.forEach(invite => index += invite.uses); + + let embed = new Discord.MessageEmbed() + .setColor("GREEN") + .setFooter(message.guild.name, message.guild.iconURL()) + .setAuthor(`Invite Tracker for ${message.guild.name}`) + .setDescription(`Information on Invites of ${member.displayName}`) + .addField("**Invited Persons:**", index) + .addField("Invitation Codes\n\n", content); + message.channel.send(embed); + } catch (e) { + return message.channel.send(e.message) + } + } +}; \ No newline at end of file diff --git "a/commands/\342\204\271 _ Info/joinPos.js" "b/commands/\342\204\271 _ Info/joinPos.js" new file mode 100644 index 0000000..b953b2d --- /dev/null +++ "b/commands/\342\204\271 _ Info/joinPos.js" @@ -0,0 +1,30 @@ +const { Client, Message } = require("discord.js"); + +module.exports = { + name: "memplace", + category: "info", + description: "member place when join", + /** + * @param {Client} client + * @param {Message} message + */ + run: async (client, message, args) => { + const member = message.mentions.members.first(); + + if (!member) return message.reply("Please specify a member!"); + + const members = message.guild.members.cache + .sort((a, b) => a.joinedTimestamp - b.joinedTimestamp) + .array(); + + const position = new Promise((ful) => { + for (let i = 1; i < members.length + 1; i++) { + if (members[i - 1].id === member.id) ful(i); + } + }); + + message.channel.send( + `**${member}** is the ${await position} place member to join the server!` + ); + }, +}; \ No newline at end of file diff --git "a/commands/\342\204\271 _ Info/level.js" "b/commands/\342\204\271 _ Info/level.js" new file mode 100644 index 0000000..9c17a36 --- /dev/null +++ "b/commands/\342\204\271 _ Info/level.js" @@ -0,0 +1,44 @@ +const db = require('quick.db') +const { getInfo } = require("../../handlers/xp.js") +const canvacord = require("canvacord"); +const Discord = require("discord.js"); +const { sendError } = require('../../mores/error'); +module.exports = { + name: "level", + aliases: ["lvl", "rank"], + description: "Get the level of Author or Mentioned", + usage: "level [user]", + category: "info", + run: (client, message, args) => { + const user = message.mentions.users.first() || message.author; + + if(user.bot) { + return sendError("Bots Don't Have Levels! Even Me...", message.channel) + } + + let xp = db.get(`xp_${user.id}_${message.guild.id}`) || 0; + + const {level, remxp, levelxp} = getInfo(xp); + +const rank = new canvacord.Rank() + .setAvatar(user.displayAvatarURL({dynamic: false, format: 'png'})) + .setBackground("IMAGE", "https://cdn.discordapp.com/attachments/811143476522909718/844935440867131402/zAltmrLEVELCARD.png") + .setCurrentXP(remxp) + .setRequiredXP(levelxp) + .setLevel(level) + .setStatus(user.presence.status) + .setProgressBar("#00FFFF", "COLOR") + .setUsername(user.username) + .setDiscriminator(user.discriminator) + +rank.build() + .then(data => { + const attachment = new Discord.MessageAttachment(data, `zRank.png`); + message.channel.send(attachment); + }); + + + + + } +} \ No newline at end of file diff --git "a/commands/\342\204\271 _ Info/links.js" "b/commands/\342\204\271 _ Info/links.js" new file mode 100644 index 0000000..0fc3c5c --- /dev/null +++ "b/commands/\342\204\271 _ Info/links.js" @@ -0,0 +1,23 @@ +const discord = require("discord.js"); + +module.exports = { + name: "links", + category: "info", + description: "**MY LINKS!**", + aliases: ["link"], + usage: "links (Support Server, Creator Server, Invite me)", + run: async (client, message, args) => { + + let embed = new discord.MessageEmbed() + .setDescription(`[Support Server](https://dsc.ink/syez) + [Creator Server (INDONESIA)](https://discord.gg/AaTVgBxHJm) + [Invite me](https://discord.com/oauth2/authorize?client_id=819041526751297578&scope=bot&permissions=2147483647) + **ME IN OTHER WEBSITES** + [TOP.GG (NEW)](https://top.gg/bot/819041526751297578/vote) + [website](https://Syxe.endternvl.repl.co)`) + .setColor("RANDOM") + .setTimestamp() + + message.channel.send(embed) + } +} \ No newline at end of file diff --git "a/commands/\342\204\271 _ Info/membercount.js" "b/commands/\342\204\271 _ Info/membercount.js" new file mode 100644 index 0000000..69915a2 --- /dev/null +++ "b/commands/\342\204\271 _ Info/membercount.js" @@ -0,0 +1,20 @@ +const discord = require("discord.js"); + +module.exports = { + name: "membercount", + category: "info", + description: "Get your id", + run: async (client, message, args) => { + + let embed = new discord.MessageEmbed() + .setDescription( + ` +Total Members - ${message.guild.memberCount} +Humans - ${message.guild.members.cache.filter(m => !m.user.bot).size} +Bots - ${message.guild.members.cache.filter(m => m.user.bot).size}`) + .setColor("RANDOM") + .setTimestamp(message.timestamp = Date.now()) + + message.channel.send(embed) + } +} \ No newline at end of file diff --git "a/commands/\342\204\271 _ Info/memlead.js" "b/commands/\342\204\271 _ Info/memlead.js" new file mode 100644 index 0000000..b76107f --- /dev/null +++ "b/commands/\342\204\271 _ Info/memlead.js" @@ -0,0 +1,58 @@ +const { ReactionPages } = require('reconlx'); +const { Client, Message, MessageEmbed } = require('discord.js'); + +module.exports = { + name: 'memlead', + category: 'info', + description: 'member join leaderboard', + usage: 'memlead/memberleaderboard', + aliases: ['memberleaderboard'], + /** + * @param {Client} client + * @param {Message} message + * @param {String[]} args + */ + run: async(client, message, args) => { + const members = message.guild.members.cache + .filter((m) => !m.user.bot) + .sort((a, b) => a.joinedTimestamp - b.joinedTimestamp); + + const arrayOfMembers = members.array(); + const ids = []; + arrayOfMembers.forEach((mem) => { + ids.push(mem.user.id); + }) + + let index = 1; + if(ids.length > 10) { + const chunks = convertChunk(ids, 10); + const arry = []; + for (chunk of chunks) { + const description = chunk.map((v) => `#${index++} **${message.guild.members.cache.get(v).user.tag}**`); + arry.push( + new MessageEmbed() + .setTitle('Join Leaderboard in ' + message.guild.name) + .setDescription(description) + .setColor('RANDOM') + ) + } + ReactionPages(message, arry, true) + } else { + const description = ids.map((v) => `#${index++} **${message.guild.members.cache.get(v).user.tag}**`); + message.channel.send( + new MessageEmbed() + .setTitle('Join Leaderboard in ' + message.guild.name) + .setDescription(description) + .setColor('RANDOM') + ) + } + } +} + +function convertChunk(arr, size) { + const array = []; + for (let i = 0; i < arr.length; i+= size) { + array.push(arr.slice(i, i+size)) + } + return array; +} \ No newline at end of file diff --git "a/commands/\342\204\271 _ Info/npmjs.js" "b/commands/\342\204\271 _ Info/npmjs.js" new file mode 100644 index 0000000..4758262 --- /dev/null +++ "b/commands/\342\204\271 _ Info/npmjs.js" @@ -0,0 +1,59 @@ + +const { MessageEmbed } = require("discord.js"); +const fetch = require("node-fetch"); +const moment = require("moment"); +module.exports = { + name: "npmjs", + description: "Check for packages on npm!", + category: "info", + run: async (client, message, args) => { + let query = args.join(' '); + if (!query) query = await awaitMessages(message); + if (!query) return; + const res = await fetch(`https://registry.npmjs.com/${encodeURIComponent(query)}`).catch(err => console.log(err)); + if (res.status === 404) return message.channel.send('No search results found, maybe try searching for something that exists.'); + const body = await res.json(); + const embed = new MessageEmbed() + .setColor(0xde2c2c) + .setTitle(body.name) + .setURL(`https://www.npmjs.com/package/${body.name}`) + .setDescription(body.description || 'No description.') + .addField('❯ Version', body['dist-tags'].latest, true) + .addField('❯ License', body.license || 'None', true) + .addField('❯ Author', body.author ? body.author.name : '???', true) + .addField('❯ Creation Date', moment.utc(body.time.created).format('YYYY/MM/DD hh:mm:ss'), true) + .addField('❯ Modification Date', body.time.modified ? moment.utc(body.time.modified).format('YYYY/MM/DD hh:mm:ss') : 'None', true) + .addField('❯ Repository', body.repository ? `[View Here](${body.repository.url.split('+')[1]})` : 'None', true) + .addField('❯ Maintainers', body.maintainers.map(user => user.name).join(', ')) + message.channel.send(embed); + + + async function awaitMessages(message) { + let responce; + + const filter = (user) => { + return user.author.id === message.author.id; + }; + + const serchembed = new MessageEmbed() + .setTitle("Search On NPMJS") + .setDescription("What NPMJS Package Are You Looking For? Just Type Then I Will Search! You Have **30s** βŒ› \nType `cancel` to cancel the command.") + .setThumbnail('https://static.npmjs.com/338e4905a2684ca96e08c7780fc68412.png') + .setColor("GREEN"); + + message.channel.send(serchembed); + + await message.channel.awaitMessages(filter, { max: 1, time: 30000, errors: ['time'] }) + .then((msg) => { + const firstMsg = msg.first(); + if (firstMsg.content.toLowerCase() === 'cancel') return firstMsg.react('πŸ‘'); + responce = firstMsg.content; + }) + .catch(() => { + message.channel.send('You didn\'t Respond. Command Canceled.'); + }); + + return responce; + } + }, +}; \ No newline at end of file diff --git "a/commands/\342\204\271 _ Info/oldest.js" "b/commands/\342\204\271 _ Info/oldest.js" new file mode 100644 index 0000000..e828994 --- /dev/null +++ "b/commands/\342\204\271 _ Info/oldest.js" @@ -0,0 +1,24 @@ +const { formatDate } = require("../../func2"); +const { MessageEmbed } = require("discord.js"); +module.exports = { + name: "oldest", + category: "info", + description: "Get the oldest account creation date in the guild!", + usage: "oldest", + run: async (bot, message, args) => { + let mem = message.guild.members.cache + .filter((m) => !m.user.bot) + .sort((a, b) => a.user.createdAt - b.user.createdAt) + .first(); + const Embed = new MessageEmbed() + .setTitle(`The oldest member in ${message.guild.name}`) + .setColor(`RANDOM`) + .setFooter(`Date format: MM/DD/YYYY`) + .setDescription( + `${mem.user.tag} is the oldest user in ${ + message.guild.name + }! Account creation date: ${formatDate(mem.user.createdAt)}` + ); + message.channel.send(Embed); + }, +}; \ No newline at end of file diff --git "a/commands/\342\204\271 _ Info/ping.js" "b/commands/\342\204\271 _ Info/ping.js" new file mode 100644 index 0000000..2caa30d --- /dev/null +++ "b/commands/\342\204\271 _ Info/ping.js" @@ -0,0 +1,40 @@ +const { MessageEmbed } = require("discord.js"); + +module.exports = { + name: "ping", + category: "info", + description: "description", + run: async (client, message, args) => { + var PinG = `${Date.now() - message.createdTimestamp}` + + var api = message.client.ws.ping; + + if (message.author.bot) return; + let circles = { + green: "🟒", + yellow: "🟑", + red: "πŸ”΄" + } + + const msg = await message.channel.send(new MessageEmbed() + .setColor("RED") //you can change this + .setAuthor(message.author.tag, message.author.displayAvatarURL({ dynamic: true })) + .addField("**__WEBSOCKET__**", + `${client.ws.ping <= 200 ? circles.green : client.ws.ping <= 400 ? circles.yellow : circles.red} ${client.ws.ping}ms` + )) + + let ping = msg.createdTimestamp - message.createdTimestamp; + + msg.edit( + new MessageEmbed() + .setColor("RANDOM") + .setAuthor(message.author.tag, message.author.displayAvatarURL({ dynamic: true })) + .addField("**__LATENCY__**", + `${message.createdTimestamp - message.createdTimestamp <= 200 ? circles.green : client.ws.ping <= 400 ? circles.yellow : circles.red} ${client.ws.ping}ms` + ) + .addField("**__API__**", + `${client.ws.ping <= 200 ? circles.green : ping <= 400 ? circles.yellow : circles.red} ${ping}ms ` + ) + ) + } +} \ No newline at end of file diff --git "a/commands/\342\204\271 _ Info/playstore.js" "b/commands/\342\204\271 _ Info/playstore.js" new file mode 100644 index 0000000..d44cd4b --- /dev/null +++ "b/commands/\342\204\271 _ Info/playstore.js" @@ -0,0 +1,46 @@ +const Discord = require("discord.js"); +const PlayStore = require("google-play-scraper"); +const EmbedColor = ``; + +module.exports = { + name: "playstore", + aliases: ["pstore", "googleplaystore", "ps"], + description: "Show Playstore Application Information Of Your Given Name!", + usage: "Playstore ", + category: "info", + run: async (client, message, args) => { + if (!args[0]) + return message.channel.send( + `\πŸ” Please Give Something To Search!` + ); + + PlayStore.search({ + term: args.join(" "), + num: 1 + }).then(Data => { + let App; + + try { + App = JSON.parse(JSON.stringify(Data[0])); + } catch (error) { + return message.channel.send( + `No Application Found: **"${args.join(" ")}"**` + ); + } + + let Embed = new Discord.MessageEmbed() + .setColor(EmbedColor || "RANDOM") + .setThumbnail(App.icon) + .setURL(App.url) + .setTitle(`${App.title}`) + .setDescription(App.summary) + .addField(`Price`, App.priceText, true) + .addField(`Developer`, App.developer, true) + .addField(`Score`, App.scoreText, true) + .setFooter(`Requested By ${message.author.username}`) + .setTimestamp(); + + return message.channel.send(Embed); + }); + } +}; \ No newline at end of file diff --git "a/commands/\342\204\271 _ Info/pokedex.js" "b/commands/\342\204\271 _ Info/pokedex.js" new file mode 100644 index 0000000..7cf70b2 --- /dev/null +++ "b/commands/\342\204\271 _ Info/pokedex.js" @@ -0,0 +1,100 @@ +const { Client, Message, MessageEmbed } = require("discord.js"); +const inlineReply = require('discord-reply'); + + +var Pokedex = require("pokedex-promise-v2"), + pokedex = new Pokedex(); + +module.exports = { + name: "pokedex", + category: "info", + description: "Returns a summary from a pokemon", + aliases: ["pokedex"], + cooldown: 2, + /** + * @param {Client} client + * @param {Message} message + * @param {String[]} args + */ + run: async (client, message, args) => { + const query = args.join(" ").toLocaleLowerCase(); + if (!query) return message.reply("You need to type a pokemon!"); + + function capitalize(s) { + if (typeof s !== "string") return ""; + return s.charAt(0).toUpperCase() + s.slice(1); + } + + const pokemon = await pokedex + .getPokemonByName(query) + .then(function (response) { + return response; + }) + .catch(function (error) { + message.reply("I did't find that pokemon! are you serious?"); + }); + + let moves = ""; + + let stats = ""; + + for (i = 0; i < pokemon.stats.length; i++) { + stats += `βž₯ ${capitalize(pokemon.stats[i].stat.name)} [${ + pokemon.stats[i].base_stat + }]\n`; + } + + if (pokemon.moves.length >= 4) { + var nmoves = 3; + } else if (pokemon.moves.length != 0) { + var nmoves = 1; + } else { + moves += "βž₯ No moves yet for this pokemon\n"; + } + + for (i = 0; i < nmoves; i++) { + moves += `βž₯ ${capitalize(pokemon.moves[i].move.name)}\n`; + } + + + let types = []; + + for (i = 0; i < pokemon.types.length; i++) { + types.push(capitalize(pokemon.types[i].type.name)); + } + + let abilities = ""; + + for (i = 0; i < pokemon.abilities.length; i++) { + abilities += `βž₯ ${capitalize(pokemon.abilities[i].ability.name)}\n`; + } + + var height = `${pokemon.height * 10} (cm)`; + var weight = `${Math.floor(pokemon.weight / 10)} (kg)`; + var n = pokemon.moves.length; + + const embed = new MessageEmbed() + .setAuthor( + capitalize(pokemon.name), + "http://pngimg.com/uploads/pokemon_logo/pokemon_logo_PNG12.png" + ) + + .setThumbnail(pokemon.sprites.front_default) + .setColor("RANDOM") + + .addFields( + { name: "Height", value: height, inline: true }, + { name: "Weight", value: weight, inline: true }, + { name: "Type", value: types.join(","), inline: true }, + { + name: `Abilities[${pokemon.abilities.length}]`, + value: abilities, + inline: true, + }, + { name: "Stats", value: stats, inline: true }, + { name: `Moves[${n}]`, value: moves, inline: true } + ) + .setTimestamp(); + message.reply(embed); + }, +}; diff --git "a/commands/\342\204\271 _ Info/serverav.js" "b/commands/\342\204\271 _ Info/serverav.js" new file mode 100644 index 0000000..1f0659c --- /dev/null +++ "b/commands/\342\204\271 _ Info/serverav.js" @@ -0,0 +1,19 @@ +const discord = require("discord.js") + +module.exports = { + name: "servericon", + aliases: ["sav", "guildavatar"], + category: "info", + description: "Get avatar of the server", + run: async (client, message, args) => { + + let embed = new discord.MessageEmbed() + + embed.setDescription(`[Download](${message.guild.iconURL({ dynamic: true, size: 1024 })})`) + embed.setImage(message.guild.iconURL({ dynamic: true, size: 1024 })) + embed.setColor("RANDOM") + + message.channel.send(embed) + + } +} \ No newline at end of file diff --git "a/commands/\342\204\271 _ Info/serveravatar.js" "b/commands/\342\204\271 _ Info/serveravatar.js" new file mode 100644 index 0000000..1f0659c --- /dev/null +++ "b/commands/\342\204\271 _ Info/serveravatar.js" @@ -0,0 +1,19 @@ +const discord = require("discord.js") + +module.exports = { + name: "servericon", + aliases: ["sav", "guildavatar"], + category: "info", + description: "Get avatar of the server", + run: async (client, message, args) => { + + let embed = new discord.MessageEmbed() + + embed.setDescription(`[Download](${message.guild.iconURL({ dynamic: true, size: 1024 })})`) + embed.setImage(message.guild.iconURL({ dynamic: true, size: 1024 })) + embed.setColor("RANDOM") + + message.channel.send(embed) + + } +} \ No newline at end of file diff --git "a/commands/\342\204\271 _ Info/serverinfo.js" "b/commands/\342\204\271 _ Info/serverinfo.js" new file mode 100644 index 0000000..c5abf54 --- /dev/null +++ "b/commands/\342\204\271 _ Info/serverinfo.js" @@ -0,0 +1,31 @@ +const { Client, Message, MessageEmbed } = require('discord.js'); +const moment = require('moment') +module.exports = { + name: 'serverinfo', + description: "Send You The Information Abot Server", + category: 'info', + run: async(client, message, args) => { + const guild = message.guild; + let embed = new MessageEmbed() + .setTitle(`About ${message.guild.name}`) + .setThumbnail(message.guild.iconURL()) + .setColor("YELLOW") + .addField("β„Ή General Information", [ + `ID: ${guild.id}`, + `Name: ${guild.name}`, + `Owner: ${guild.owner}`, + `` + ]) + .addField('Counts', [ + `Roles: ${guild.roles.cache.size}`, + `Channels: ${guild.channels.cache.size}`, + `Emojis: ${guild.emojis.cache.size} (Regular: ${guild.emojis.cache.filter((e) => !e.animated).size}, Animated: ${guild.emojis.cache.filter((e) => e.animated).size})` + ]) + .addField("Additional Informations", [ + `Created: ${moment(guild.createdTimestamp).format('LT')} ${moment(guild.createdTimestamp).format('LL')} | ${moment(guild.createdTimestamp).fromNow()}`, + `Region: ${guild.region}`, + `Boost Tier: ${guild.premiumTier ? `Tier: ${guild.premiumTier}`: `None`}` + ]); + message.reply(embed) + } +} \ No newline at end of file diff --git "a/commands/\342\204\271 _ Info/snipe.js" "b/commands/\342\204\271 _ Info/snipe.js" new file mode 100644 index 0000000..e358352 --- /dev/null +++ "b/commands/\342\204\271 _ Info/snipe.js" @@ -0,0 +1,32 @@ +const Discord = require("discord.js") +const config = require("../../config.json") +const db = require("quick.db") + +module.exports = { + name: "snipe", + aliases: ["ms"], + category: "info", + usage: "sz!snipe", + description: "get deleted messages", + run:async (client, message, args) => { + let prefix = await db.fetch(`prefix_${message.guild.id}`) + if(prefix == null) { + prefix = config.DEFAULT_PREFIX + } + + const msg = client.snipe.get(message.channel.id) + if(!msg) return message.channel.send("`︻デ═一` There are no deleted messages in this channel!") + const embed = new Discord.MessageEmbed() + .setTitle("Deleted Message") + .addField("Deleted by:", `${msg.author}`) + .addField("In:", message.channel) + .addField("Content", msg.content) + .setColor("RANDOM") + .setThumbnail(message.author.displayAvatarURL({ dynamic: true })) + if(msg.image)embed.setImage(msg.image) + + message.channel.send(embed) + + + } +} \ No newline at end of file diff --git "a/commands/\342\204\271 _ Info/ss.js" "b/commands/\342\204\271 _ Info/ss.js" new file mode 100644 index 0000000..55419bc --- /dev/null +++ "b/commands/\342\204\271 _ Info/ss.js" @@ -0,0 +1,53 @@ +const { Message, MessageEmbed } = require("discord.js"); +//const { Default_Prefix, Color } = require("../../config.js"); +const Discord = require("discord.js"); +//const db = require("wio.db"); +const moment = require("moment"); +const fetch = require("node-fetch"); + +const url = require("url"); + +module.exports = { + name: "ss", + aliases: ["screenshot"], + category: "info", + description: "Takes a screenshot of any webpage.", + usage: "screenshot ", + run: async (client, message, args) => { + message.delete(); + const user = message.author.tag + const urls = args[0]; + if (!urls) + return message.channel + .send(`\`\`\`\n${user},Please send me a link to screen shot!\n\`\`\``) + .then(m => m.delete({ timeout: 5000 }).catch(e => {})); + if (urls.length < 8) + return message + .reply( + "https is too short to reach - 8 limit" + ) + .then(m => m.delete({ timeout: 9000 }).catch(e => {})); + + const site = /^(https?:\/\/)/i.test(urls) ? urls : `http://${urls}`; + try { + const { body } = await fetch( + `https://image.thum.io/get/width/1920/crop/675/noanimate/${site}` + ); + + return message.channel.send( + `Here is a screenshot from \`${urls}\``, + { + files: [{ attachment: body, name: "Screenshot.png" }] + } + ); + } catch (err) { + if (err.status === 404) + return message.channel + .send("Could not find any results. Invalid URL?") + .then(m => m.delete({ timeout: 14000 }).catch(e => {})); + return message + .reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`) + .then(m => m.delete({ timeout: 13000 }).catch(e => {})); + } + } +}; \ No newline at end of file diff --git "a/commands/\342\204\271 _ Info/support.js" "b/commands/\342\204\271 _ Info/support.js" new file mode 100644 index 0000000..da41f67 --- /dev/null +++ "b/commands/\342\204\271 _ Info/support.js" @@ -0,0 +1,31 @@ +const Discord = require("discord.js"); + +module.exports = { + name: "support", + category: "info", + usage: "support", + description: "bot's support server", + + run: async(client, message, args) => { + const embed = new Discord.MessageEmbed() + .setTitle("Support Links") + .setDescription("Syzebot's Support Links") + .setThumbnail(client.user.displayAvatarURL()) + + + .addField("Support Server", "[Click Me](https://discord.gg/QB5uZJ9tQh) To Get Into My Support Server") + + + .addField("Invite Me", "[Click Me](https://dsc.ink/syze) to invite me") + + + .addField("Website", "[Click Me](https://syxe.endternvl.repl.co) To Get Into My Website!") + + + .addField("Vote Me!", "Vote me in [TOP.GG](https://top.gg/bot/819041526751297578/vote) \n Vote me in [DISCORDBOTLIST](https://discordbotlist.com/bots/syzebot/upvote)") + .setColor("RANDOM") + .setFooter(`Requested by ${message.author.username}`) + .setTimestamp(); + message.channel.send(embed) + } +} \ No newline at end of file diff --git "a/commands/\342\204\271 _ Info/uptimee.js" "b/commands/\342\204\271 _ Info/uptimee.js" new file mode 100644 index 0000000..43ac36f --- /dev/null +++ "b/commands/\342\204\271 _ Info/uptimee.js" @@ -0,0 +1,27 @@ +const { MessageEmbed } = require("discord.js"); +const Discord = require("discord.js"); +module.exports = { + name: "up", + aliases: ["online"], + category: "info", + description: "Shows Bot's Up time.", + usage: "uptime", + + run: async (client, message, args) => { + let days = Math.floor(client.uptime / 86400000); + let hours = Math.floor(client.uptime / 3600000) % 24; + let minutes = Math.floor(client.uptime / 60000) % 60; + let seconds = Math.floor(client.uptime / 1000) % 60; + + const embed = new Discord.MessageEmbed() + .setTitle("Up Time") + .setDescription("How Long I'm Up? You Will Know Now") + .addField("**__UPTIME:__**", `\`${days}d\`-\`${hours}h\`-\`${minutes}m\`-\`${seconds}s\``) + .setColor("BLUE") + .setFooter("©️ SyzeBot") + .setTimestamp(); + + return message.channel.send(embed); + } + +} \ No newline at end of file diff --git "a/commands/\342\204\271 _ Info/userinfo.js" "b/commands/\342\204\271 _ Info/userinfo.js" new file mode 100644 index 0000000..9ff01a8 --- /dev/null +++ "b/commands/\342\204\271 _ Info/userinfo.js" @@ -0,0 +1,116 @@ +const { Client, Message, MessageEmbed } = require("discord.js"); +const moment = require("moment"); + +const flags = { + DISCORD_EMPLOYEE: "<:discordstaff:830630345111371876>", + DISCORD_PARTNER: "<:discord_partner:830629791916883998>", + BUGHUNTER_LEVEL_1: "<:level_1:830629376851836928>", + BUGHUNTER_LEVEL_2: "<:level_2:830629238486728754>", + HYPESQUAD_EVENTS: "<:hypeevent:830630149866520610>", + HOUSE_BRAVERY: "<:bravery:830628707206037515>", + HOUSE_BRILLIANCE: "<:brilliance:830628624587161631>", + HOUSE_BALANCE: "<:balance:830628798722474014>", + EARLY_SUPPORTER: "<:supporter:830629542753599528>", + TEAM_USER: "Team User", + SYSTEM: "System", + VERIFIED_BOT: "<:verified_bot:830628203135238184>", + VERIFIED_DEVELOPER: "", +}; + +module.exports = { + name: "userinfo", + category: "info", + description: "Displays information about the user mentioned", + cooldown: 0, + /** + * @param {Client} client + * @param {Message} message + * @param {String[]} args + */ + run: async (client, message, args) => { + var status; + target = args[0]; + const member = + message.mentions.members.last() || + message.guild.members.cache.get(target) || + message.member; + switch (member.user.presence.status) { + case "dnd": + status = "<:dnd:830627279918858290>"; + break; + case "offline": + status = "<:offline:830627345462722630>"; + break; + case "online": + status = "<:online:830627309979303976>"; + break; + case "idle": + status = "<:idle:830627216214720614>"; + break; + } + const roles = member.roles.cache + .sort((a, b) => b.position - a.position) + .map((role) => role.toString()) + .slice(0, -1); + const userFlags = member.user.flags.toArray(); + + function trimArray(arr, maxLen = 10) { + if (arr.length > maxLen) { + const len = arr.length - maxLen; + arr = arr.slice(0, maxLen); + arr.push(`${len} more...`); + } + return arr; + } + + + const embed = new MessageEmbed() + .setThumbnail(member.user.displayAvatarURL({ dynamic: true, size: 512 })) + .setAuthor(`${member.user.username}#${member.user.discriminator}`) + .setColor("2F3136") + .addField("`User`", [ + `**βž₯πŸ†”:** ${member.id}`, + `**❯ NickName:** ${member.nickname ? member.nickname : "❌"}`, + `**❯ Discriminator:** ${member.user.discriminator}`, + `**❯ Badges:** ${ + userFlags.length + ? userFlags.map((flag) => flags[flag]).join(", ") + : "None" + }`, + `**❯ Avatar:** [Link to avatar](${member.user.displayAvatarURL({ + dynamic: true, + })})`, + `**❯ Account:** ${moment(member.user.createdTimestamp).format( + "LT" + )} ${moment(member.user.createdTimestamp).format("LL")} ${moment( + member.user.createdTimestamp + ).fromNow()}`, + `**❯ Status:** ${status}`, //member.user.presence.status + `**❯ Game:** ${member.user.presence.game || "Not playing a game."}`, + `\u200b`, + ]) + .addField("`Member`", [ + `**βž₯ Server Join Date:** ${moment(member.joinedAt).format("LL LTS")}`, + `**βž₯ Highest Role:** ${ + member.roles.highest.id === message.guild.id + ? "None" + : member.roles.highest.name + }`, + `**βž₯ Roles [${roles.length}]:** ${ + roles.length <= 10 + ? roles.join(", ") + : roles.length > 10 + ? trimArray(roles) + : "None" + }`, + `\u200b`, + ]) + .addField('Nitro', member.premiumSince ? 'Yes' : 'No', true) + .setFooter( + `β€’ Requested by: ${member.user.tag}`, + member.user.displayAvatarURL({ format: "png" }) + ) + .setTimestamp(); + return message.channel.send(embed); + }, +}; diff --git "a/commands/\342\204\271 _ Info/userperms.js" "b/commands/\342\204\271 _ Info/userperms.js" new file mode 100644 index 0000000..0567098 --- /dev/null +++ "b/commands/\342\204\271 _ Info/userperms.js" @@ -0,0 +1,25 @@ +const { MessageEmbed } = require("discord.js") + +module.exports = { + name: "userperms", + aliases: ["usrprms"], + category: "info", + description: "user's permission in the server", + + run: async(client, message, [member = '']) => { + if(!member.match(/\d{17,19}/)) { + member = message.author.id; + }; + member = await message.guild.members.fetch(member.match(/\d{17,19}/)[0]).catch(() => null); + if(!member) { + return message.channel.send(`\\❌ User not found.`); + }; + const sp = member.permissions.serialize(); + const cp = message.channel.permissionsFor(member).serialize(); + return message.channel.send(new MessageEmbed().setColor(member.displayColor || 'RANDOM').setTitle(`${member.displayName}'s Permissions`).setFooter(`Permissions | \©️${new Date().getFullYear()} SyzeBot`).setDescription(['\\πŸ“Š - This Server', '\\#️⃣ - The Current Channel', '\`\`\`properties', 'πŸ“Š | #️⃣ | Permission', '========================================', `${Object.keys(sp).map(perm => [ + sp[perm] ? 'βœ”οΈ |' : '❌ |', + cp[perm] ? 'βœ”οΈ |' : '❌ |', + perm.split('_').map(x => x[0] + x.slice(1).toLowerCase()).join(' ') + ].join(' ')).join('\n')}`, '\`\`\`'].join('\n'))); + } +} \ No newline at end of file diff --git "a/commands/\342\204\271 _ Info/vote.js" "b/commands/\342\204\271 _ Info/vote.js" new file mode 100644 index 0000000..9c5bd91 --- /dev/null +++ "b/commands/\342\204\271 _ Info/vote.js" @@ -0,0 +1,19 @@ +const { MessageEmbed } = require("discord.js"); + +module.exports = { + name: "vote", + usage: "none", + description: "Vote in DISCORD BOT LIST or TOPGG", + category: "info", + + run: async(client, message, args) => { + const vote = new MessageEmbed() + .setTitle("Vote Me!") + .setDescription("**__VOTE IN TOP.GG__**\n [`CLICK ME`](https://top.gg/bot/819041526751297578/vote) \n **__VOTE IN DBL__**\n [`CLICK ME`](https://discord.ly/syzebot)\n **__VOTE IN DCLIST__**\n [`CLICK ME`](https://dclist.net/bots/819041526751297578)") + .setColor("RANDOM") + .setThumbnail(client.user.displayAvatarURL()) + .setFooter("©️ " + client.user.username, client.user.displayAvatarURL()); + + message.channel.send(vote) + } +} \ No newline at end of file diff --git "a/commands/\342\204\271 _ Info/youngest.js" "b/commands/\342\204\271 _ Info/youngest.js" new file mode 100644 index 0000000..ed51770 --- /dev/null +++ "b/commands/\342\204\271 _ Info/youngest.js" @@ -0,0 +1,24 @@ +const { formatDate } = require("../../func2"); +const { MessageEmbed } = require("discord.js"); +module.exports = { + name: "youngest", + category: "info", + description: "Get the youngest account creation date in the guild!", + usage: "youngest", + run: async (bot, message, args) => { + let mem = message.guild.members.cache + .filter((m) => !m.user.bot) + .sort((a, b) => b.user.createdAt - a.user.createdAt) + .first(); + const Embed = new MessageEmbed() + .setTitle(`The youngest member in ${message.guild.name}`) + .setColor(`RANDOM`) + .setFooter(`Date format: MM/DD/YYYY`) + .setDescription( + `${mem.user.tag} is the youngest user in ${ + message.guild.name + }! Account creation date: ${formatDate(mem.user.createdAt)}` + ); + message.channel.send(Embed); + }, +}; \ No newline at end of file diff --git "a/commands/\342\223\202 _ Main/calculate.js" "b/commands/\342\223\202 _ Main/calculate.js" new file mode 100644 index 0000000..7bcd837 --- /dev/null +++ "b/commands/\342\223\202 _ Main/calculate.js" @@ -0,0 +1,27 @@ +const { Client, Message, MessageEmbed } = require("discord.js"); +const math = require("mathjs") + +module.exports = { + name: "math", + category: "main", + aliases: ["calculate", "calculator"], + description: "math command! now it's finnaly released!", + usage: "math , for EXAMPLE: zamath 100 + 100", + + run: async (client, message, args) => { + try { + message.channel.send( + new MessageEmbed() + .setTitle("Math | Calculator") + .setDescription("Gotcha! Here is the result:") + .addField('**Question**', args.join(" ")) + .addField('**Solution**', math.evaluate(args.join(" "))) + .setColor("RANDOM") + .setFooter("πŸ“") + .setTimestamp() + ) + } catch (err) { + message.channel.send("Your Question Is Not Valid! Please Enter The Valid One!") + } + }, +}; \ No newline at end of file diff --git "a/commands/\342\223\202 _ Main/sourcebin.js" "b/commands/\342\223\202 _ Main/sourcebin.js" new file mode 100644 index 0000000..75b5e8b --- /dev/null +++ "b/commands/\342\223\202 _ Main/sourcebin.js" @@ -0,0 +1,39 @@ +const sb = require('sourcebin_js'); +const { default_prefix } = require("../../config.json") +const { MessageEmbed } = require("discord.js"); + +module.exports = { + name: 'sourcebin', + category: 'main', + usage: 'sourcebin ', + description: 'Sourcebin', + run: async (client, message, args) => { + let prefix = db.get(`prefix_${message.guild.id}`) + if(prefix === null) prefix = default_prefix; + + let content = args.join(' '); + if (!content) + return message.reply( + new MessageEmbed({ + title: 'Error Usage! Please Follow The Usage!', + description: `Usage: ${prefix}sourcebin ` + }) + ); + + const value = await sb.create([ + { + title: `A Code From User In ${message.guild.name}`, + name: `code from ${message.author.tag}`, + content, + language: 'javascript', + } + ]); + await message.reply( + new MessageEmbed() + .setTitle('Sourcebin') + .setDescription(`Here is your code: ${value.url}`) + .setColor("#9B2335") + .setFooter(`Code From By ${message.author.tag} and uploaded by ${client.user.tag} in sourcebin`) + ); + } +}; diff --git "a/commands/\342\223\202 _ Main/translate.js" "b/commands/\342\223\202 _ Main/translate.js" new file mode 100644 index 0000000..8c32b46 --- /dev/null +++ "b/commands/\342\223\202 _ Main/translate.js" @@ -0,0 +1,33 @@ +const {Client, Message, MessageEmbed } = require ('discord.js'); +const config = require('../../config.json') +const translate = require('@iamtraction/google-translate'); +const db = require('quick.db') + +module.exports = { + name: "translate", + category: "main", + description: "google translate", + run: async (client, message, args) => { + let prefix = db.get(`prefix_${message.guild.id}`) + if(prefix === null) prefix = default_prefix; + try { + const query = args.slice(1).join(" "); + if (!query) return message.reply(`Dont leave this blank! Try this: \`${prefix}translate id Hello! I'm Altmr!\``) +const arg = args[0] + + const translated = await translate(query, {to: `${arg}`}); + const embed = new MessageEmbed() + .setTitle("Translated!") + .addField("Your Query", `\`\`\`fix\n${query}\`\`\``) + .addField('Selected Language', `\`\`\`fix\n${arg}\`\`\``) + .addField('Result', `\`\`\`fix\n${translated.text}\`\`\``) + .setFooter(`Β© ${client.user.username}`) + .setColor("#d4c5a2") + message.channel.send(embed) + + } catch (error) { + return message.channel.send(`Your question is invalid! Try this: \`${prefix}translate \``) + .then(() => console.log(error)); + } + } +} \ No newline at end of file diff --git "a/commands/\360\237\216\237 _ Ticket/add.js" "b/commands/\360\237\216\237 _ Ticket/add.js" new file mode 100644 index 0000000..a65acb3 --- /dev/null +++ "b/commands/\360\237\216\237 _ Ticket/add.js" @@ -0,0 +1,31 @@ +module.exports = { + name: 'addtick', + category: 'Ticket', + description: 'Adds a member to a specified ticket.', + aliases: ['add-tick'], + usage: 'addtick ', + userperms: ['ADMINISTRATOR'], + botperms: [], + run: async (client, message, args, prefix) => { + if (!message.guild.me.hasPermission("ADMINISTRATOR")) return message.channel.send("I need the `MANAGE_WEBHOOKS` permission to use this comamnd"); + if(message.channel.name.includes('ticket-')) { + const member = message.mentions.members.first() || message.guild.members.cache.get(args[0]) || message.guild.members.cache.find(x => x.user.username === args.slice(0).join(' ') || x.user.username === args[0]); + if(!member) { + return message.channel.send(`Incorrect Usage! Correct Usage: \`sz!add \``); + } + try{ + message.channel.updateOverwrite(member.user, { + VIEW_CHANNEL: true, + SEND_MESSAGES: true, + ATTACH_FILES: true, + READ_MESSAGE_HISTORY: true, + }).then(() => { + message.channel.send(`Successfully added ${member} to ${message.channel}`); + }); + } + catch(e) { + return message.channel.send('**An error occurred, please try again!**'); + } + } + }, +}; \ No newline at end of file diff --git "a/commands/\360\237\216\237 _ Ticket/close.js" "b/commands/\360\237\216\237 _ Ticket/close.js" new file mode 100644 index 0000000..187dd34 --- /dev/null +++ "b/commands/\360\237\216\237 _ Ticket/close.js" @@ -0,0 +1,63 @@ +const sourcebin = require('sourcebin_js'); +const { MessageEmbed } = require('discord.js'); + + + +module.exports = { + name: 'close', + category: 'Ticket', + description: 'Closes the ticket.', + aliases: [], + usage: 'close', + userperms: [], + botperms: [], + run: async (client, message, args) => { + if(message.channel.name.includes('ticket-')) { + const member = message.guild.members.cache.get(message.channel.name.split('ticket-').join('')); + if(message.member.hasPermission('ADMINISTRATOR') || message.channel.name === `ticket-${message.author.id}`) { + message.channel.messages.fetch().then(async (messages) => { + const output = messages.array().reverse().map(m => `${new Date(m.createdAt).toLocaleString('en-US')} - ${m.author.tag}: ${m.attachments.size > 0 ? m.attachments.first().proxyURL : m.content}`).join('\n'); + + let response; + try { + response = await sourcebin.create([ + { + name: ' ', + content: output, + languageId: 'text', + }, + ], { + title: `Chat transcript for ${message.channel.name}`, + description: ' ', + }); + } + catch(e) { + return message.channel.send('An error occurred, please try again!'); + } + + const embed = new MessageEmbed() + .setDescription(`[\`πŸ“„ View\`](${response.url})`) + .setColor('GREEN'); + member.send('Here is a transcript of your ticket, please click the link below to vew the transcript', embed); + }).then(() => { + try { + message.channel.updateOverwrite(member.user, { + VIEW_CHANNEL: false, + SEND_MESSAGES: false, + ATTACH_FILES: false, + READ_MESSAGE_HISTORY: false, + }).then(() => { + message.channel.send(`Successfully closed ${message.channel}!`); + }); + } + catch(e) { + return message.channel.send('An error occurred, please try again!'); + } + }); + } + } + else { + return message.reply('you cannot use this command here. Please use this command when you\'re closing a ticket.'); + } + }, +}; \ No newline at end of file diff --git "a/commands/\360\237\216\237 _ Ticket/del.js" "b/commands/\360\237\216\237 _ Ticket/del.js" new file mode 100644 index 0000000..760fb18 --- /dev/null +++ "b/commands/\360\237\216\237 _ Ticket/del.js" @@ -0,0 +1,17 @@ +module.exports = { + name: 'delete', + category: 'Ticket', + description: 'Delete a specified ticket.', + aliases: ['deltick'], + usage: 'delete', + userperms: ['ADMINISTRATOR'], + botperms: [], + run: async (client, message, args) => { + if(message.channel.name.includes('ticket-')) { + message.channel.delete(); + } + else { + return message.reply('you cannot use this command here. Please use this command when you want to delete a ticket.'); + } + }, +}; \ No newline at end of file diff --git "a/commands/\360\237\216\237 _ Ticket/new.js" "b/commands/\360\237\216\237 _ Ticket/new.js" new file mode 100644 index 0000000..3cf3289 --- /dev/null +++ "b/commands/\360\237\216\237 _ Ticket/new.js" @@ -0,0 +1,36 @@ +module.exports = { + name: 'new-ticket', + category: 'Ticket', + description: 'Creates a new ticket.', + aliases: ['open-ticket', 'otick'], + usage: 'new', + userperms: [], + botperms: ['MANAGE_CHANNELS'], + run: async (client, message, args, prefix) => { + if (!message.guild.me.hasPermission("MANAGE_CHANNELS")) return message.channel.send("I need the `MANAGE_CHANNELS` permission to use this comamnd"); + if(message.guild.channels.cache.find(channel => channel.name === `ticket-${message.author.id}`)) { + return message.reply('you already have a ticket, please close your exsisting ticket first before opening a new one!'); + } + + message.guild.channels.create(`ticket-${message.author.id}`, { + permissionOverwrites: [ + { + id: message.author.id, + allow: ['SEND_MESSAGES', 'VIEW_CHANNEL'], + }, + { + id: message.guild.roles.everyone, + deny: ['VIEW_CHANNEL'], + }, + ], + type: 'text', + }).then(async channel => { + message.reply(`you have successfully created a ticket! Please click on ${channel} to view your ticket.`); + channel.send(`Hi ${message.author}, welcome to your ticket! Please be patient, we will be with you shortly. If you would like to close this ticket please run \`sz!close\``); + let logchannel = message.guild.channels.cache.find(channel => channel.name === `ticket-logs`) + if(logchannel) { + logchannel.send(`Ticket ${message.author.id} created. Click the following to veiw <#${channel.id}>`); + } + }); + }, +}; \ No newline at end of file diff --git "a/commands/\360\237\216\237 _ Ticket/open.js" "b/commands/\360\237\216\237 _ Ticket/open.js" new file mode 100644 index 0000000..b531d8b --- /dev/null +++ "b/commands/\360\237\216\237 _ Ticket/open.js" @@ -0,0 +1,33 @@ +module.exports = { + name: 'open', + category: 'Ticket', + description: 'Re-opens a ticket.', + aliases: [], + usage: 'open', + userperms: ['ADMINISTRATOR'], + botperms: [], + run: async (client, message, args) => { + if (message.channel.name.includes('ticket-')) { + const member = message.guild.members.cache.get(message.channel.name.split('ticket-').join('')); + try { + message.channel.updateOverwrite(member.user, { + VIEW_CHANNEL: true, + SEND_MESSAGES: true, + ATTACH_FILES: true, + READ_MESSAGE_HISTORY: true, + }) + .then(() => { + message.channel.send(`Successfully re-opened ${message.channel}`); + }); + } + catch (e) { + return message.channel.send('An error occurred, please try again!'); + } + } + else { + return message.reply( + 'you cannot use this command here. Please use this command on a closed ticket.', + ); + } + }, +}; \ No newline at end of file diff --git "a/commands/\360\237\216\237 _ Ticket/remove.js" "b/commands/\360\237\216\237 _ Ticket/remove.js" new file mode 100644 index 0000000..53a53f9 --- /dev/null +++ "b/commands/\360\237\216\237 _ Ticket/remove.js" @@ -0,0 +1,30 @@ +module.exports = { + name: 'remove', + category: 'Ticket', + description: 'Removes a member to a specified ticket.', + aliases: [], + usage: 'remove ', + userperms: ['ADMINISTRATOR'], + botperms: [], + run: async (client, message, args, prefix) => { + if(message.channel.name.includes('ticket-')) { + const member = message.mentions.members.first() || message.guild.members.cache.get(args[0]) || message.guild.members.cache.find(x => x.user.username === args.slice(0).join(' ') || x.user.username === args[0]); + if(!member) { + return message.channel.send(`Incorrect Usage! Correct Usage:${prefix}remove `); + } + try{ + message.channel.updateOverwrite(member.user, { + VIEW_CHANNEL: false, + SEND_MESSAGES: false, + ATTACH_FILES: false, + READ_MESSAGE_HISTORY: false, + }).then(() => { + message.channel.send(`Successfully removed ${member} from ${message.channel}`); + }); + } + catch(e) { + return message.channel.send('An error occurred, please try again!'); + } + } + }, +}; \ No newline at end of file diff --git "a/commands/\360\237\216\256 _ Games/8ball.js" "b/commands/\360\237\216\256 _ Games/8ball.js" new file mode 100644 index 0000000..98f8ba2 --- /dev/null +++ "b/commands/\360\237\216\256 _ Games/8ball.js" @@ -0,0 +1,42 @@ +const { MessageEmbed } = require("discord.js"); +const reactions = ["πŸ€”", "πŸ˜…", "πŸ˜€", "😐"] +const answers = [ "Yes.", + "No.", + "My sources say yes", + "Most likely.", + "idk", + "maybe sometime", + "Outlook good.", + "Signs point to yes.", + "Definitely", + "Absolutely", + "Nope.", + "No thanks, I won’t be able to make it.", + "No Way!", + " It is certain.", + "It is decidedly so.", + "Without a doubt.", + "Yes - definitely.", + "You may rely on it.", + "As I see it, yes.", + "idk choose urself im lazy", + "How about u?", + "Hmm... I guess YEZ", + "Hmm... I guess NO"] + +module.exports = { + name: "8ball", + description: "8Ball", + category: "games", + run: (client, message, args) => { + const question = args.join(' '); + if (!question) return message.channel.send('**πŸ₯± - You Didn\'t Ask Me Anything .**'); + const botans = new MessageEmbed() + .setThumbnail(message.guild.iconURL()) + .setColor('RANDOM') + .setTitle(`8ball`) + .setDescription(`${message.author} Asked Me: \n\`${question}?\` \nAnd My Answer Is: \n**${reactions[Math.floor(Math.random() * reactions.length)]} - ${answers[Math.floor(Math.random() * answers.length)]} !**`) + .setTimestamp(); + message.channel.send(botans).then(() => message.delete()); + } +}; \ No newline at end of file diff --git "a/commands/\360\237\216\256 _ Games/aki.js" "b/commands/\360\237\216\256 _ Games/aki.js" new file mode 100644 index 0000000..110a145 --- /dev/null +++ "b/commands/\360\237\216\256 _ Games/aki.js" @@ -0,0 +1,68 @@ +const { Client, MessageEmbed } = require("discord.js"), + { Aki } = require("aki-api"), + emojis = ["πŸ‘", "πŸ‘Ž", "❔", "πŸ€”", "πŸ™„", "❌"], + Started = new Set(); + + + +module.exports = { + name: "aki", + description: "play aki", + usage: "aki", + category: "games", + + run: async (client, message, args) => { + + if (!Started.has(message.author.id)) Started.add(message.author.id); + else return message.channel.send("**:x: | The game already started..**"); + const aki = new Aki("en"); // Full languages list at: https://github.com/jgoralcz/aki-api + await aki.start(); + const msg = await message.channel.send(new MessageEmbed() + .setTitle(`${message.author.username}, Question ${aki.currentStep + 1}`) + .setColor("RANDOM") + .setDescription(`**${aki.question}**\n${aki.answers.map((x, i) => `${x} | ${emojis[i]}`).join("\n")}`)); + for (let emoji of emojis) await msg.react(emoji).catch(console.error); + const collector = msg.createReactionCollector((reaction, user) => emojis.includes(reaction.emoji.name) && user.id === message.author.id, { time: 60000 * 6 }); + collector.on("collect", async (reaction, user) => { + reaction.users.remove(user).catch(console.error); + if (reaction.emoji.name == "❌") return collector.stop(); + + await aki.step(emojis.indexOf(reaction.emoji.name)); + if (aki.progress >= 70 || aki.currentStep >= 78) { + await aki.win(); + collector.stop(); + message.channel.send(new MessageEmbed() + .setTitle("Uhm... Is this your character?") + .setDescription(`**${aki.answers[0].name}**\n${aki.answers[0].description}\nRanking as **#${aki.answers[0].ranking}**\n\n[yes (**y**) / no (**n**)]`) + .setImage(aki.answers[0].absolute_picture_path) + .setColor("RANDOM")); + message.channel.awaitMessages(response => ["yes", "y", "no", "n"].includes(response.content.trim().toLowerCase()) && + response.author.id == message.author.id, { max: 1, time: 30000, errors: ["time"] }) + .then(collected => { + const content = collected.first().content.trim().toLowerCase(); + if (content == "y" || content == "yes") + return message.channel.send(new MessageEmbed() + .setColor("RANDOM") + .setTitle("Great! Guessed right one more time!") + .setDescription("I love playing with you!")); + else + return message.channel.send(new MessageEmbed() + .setColor("RANDOM") + .setTitle("Okay, i loose") + .setDescription("**I'm going to defeat you next time!**")); + }); + return; + } + msg.edit(new MessageEmbed() + .setTitle(`${message.author.username}, Question ${aki.currentStep + 1}`) + .setColor("RANDOM") + .setDescription(`**${aki.question}**\n${aki.answers.map((x, i) => `${x} | ${emojis[i]}`).join("\n")}`)); + }); + + + collector.on("end", () => { + Started.delete(message.author.id); + msg.delete({ timeout: 1000 }).catch(() => { }); + }); + } +} \ No newline at end of file diff --git "a/commands/\360\237\216\256 _ Games/asci.js" "b/commands/\360\237\216\256 _ Games/asci.js" new file mode 100644 index 0000000..1a51b4c --- /dev/null +++ "b/commands/\360\237\216\256 _ Games/asci.js" @@ -0,0 +1,28 @@ +const discord = require("discord.js"); +const figlet = require("figlet"); // MAKE SURE TO INSTALL FIGLET PACKAGE OR CODE WONT WORK + +module.exports = { + name: "ascii", + aliases: [], + category: "games", + usage: "ascii ", + description: "Returns provided text in ascii format.", + run: async (client, message, args) => { + + let text = args.join(" "); + if(!text) { +return message.channel.send(`Please provide text for the ascii conversion!`) +} + let maxlen = 20 +if(text.length > 20) { +return message.channel.send(`Please put text that has 20 characters or less because the conversion won't be good!`) +} + // AGAIN, MAKE SURE TO INSTALL FIGLET PACKAGE! +figlet(text, function(err, data) { +message.channel.send(data, { +code: 'AsciiArt' +}); +}) + + } +}; \ No newline at end of file diff --git "a/commands/\360\237\216\256 _ Games/battleship.js" "b/commands/\360\237\216\256 _ Games/battleship.js" new file mode 100644 index 0000000..1358cca --- /dev/null +++ "b/commands/\360\237\216\256 _ Games/battleship.js" @@ -0,0 +1,19 @@ +const { DiscordBattleShip } = require('discord-battleship'); +const BattleShip = new DiscordBattleShip({ + embedColor: "RANDOM", /* Any Discord.js Color Resolvable will work. */ + prefix: "b!", /* This is the prefix that will be used in the users DM's for commands. + You can set this to any string. */ +}); + +module.exports = { + name: 'battleship', + usage: '[USER TO BATTLE WITH]', + category: 'games', + description: 'play basic battleship board game using [discord-battleship](https://npmjs/package/discord-battleship)', + + run: async (client, message, args) => { + if (message.mentions.users.first().bot) return message.reply("Bots Can't Play Games Like This!") + console.log(`${message.author.username} just played battleship. so i guess errors are coming and nvm them!`) + await BattleShip.createGame(message); + } +} \ No newline at end of file diff --git "a/commands/\360\237\216\256 _ Games/hangman.js" "b/commands/\360\237\216\256 _ Games/hangman.js" new file mode 100644 index 0000000..a43ab11 --- /dev/null +++ "b/commands/\360\237\216\256 _ Games/hangman.js" @@ -0,0 +1,24 @@ +const { hangman } = require('reconlx') + +module.exports = { + name : 'hangman', + category: 'games', + description: 'play hangman', + usage: 'hangman ', + run : async(client, message, args) => { + if(!message.member.hasPermission("MANAGE_MESSAGES")) return message.channel.send('You need `MANAGE_MESSAGES` permission!') + const channel = message.mentions.channels.first() || message.guild.channels.cache.get(args[0]) + if(!channel) return message.channel.send('Please specify a channel!') + const word = args.slice(1).join(" ") + if(!word) return message.channel.send('Please specify a word to guess!') + + const hang = new hangman({ + message: message, + word: word, + client: client, + channelID: channel.id, + }) + + hang.start(); + } +} \ No newline at end of file diff --git "a/commands/\360\237\216\256 _ Games/pokemon.js" "b/commands/\360\237\216\256 _ Games/pokemon.js" new file mode 100644 index 0000000..dae6f3a --- /dev/null +++ "b/commands/\360\237\216\256 _ Games/pokemon.js" @@ -0,0 +1,38 @@ + +const { MessageEmbed } = require("discord.js"); +const { Spawn } = require("pokecord"); + +module.exports = { + name: "pokemon", + category: "games", + description: "Guess the pokemon!", + usage: "sz!pokemon", + run: async (client, message, args) => { + + const pokemon = await Spawn().catch(e => {}); + if (!pokemon) return message.channel.send("OOP! WHAT IS HAPPENING TO ME? SOMETHING WENT WRONG... BEEP BEEP"); + const filter = m => m.author.id === message.author.id; + + const embed = new MessageEmbed() + .setAuthor("Guess The PokΓ©mon") + .setColor("#E15D44") + .setImage(pokemon.imageURL); + console.log(`${message.author.username} from ${message.guild.name} wants to guess ${pokemon.name}`) + await message.channel.send(embed); + + message.channel.awaitMessages(filter, { + max: 1, + error: ["time"], + time: 10000 + }) + .then(collected => { + const m = collected.first(); + if (!m.content || m.content.toLowerCase() !== pokemon.name.toLowerCase()) return message.channel.send(` Incorrect guess! The answer was **${pokemon.name}**.`); + return message.channel.send(` **CORRECT ANSWER!**`); + }) + .catch(() => { + message.channel.send(` You did not answer in time. The pokemon name is **${pokemon.name}**!`); + }); + +} +}; \ No newline at end of file diff --git "a/commands/\360\237\216\256 _ Games/shuffleguess.js" "b/commands/\360\237\216\256 _ Games/shuffleguess.js" new file mode 100644 index 0000000..c31406f --- /dev/null +++ "b/commands/\360\237\216\256 _ Games/shuffleguess.js" @@ -0,0 +1,53 @@ +module.exports = { + name: "shuffle-guess", + aliases: ["guess"], + usage: "sz!guess", + description: "Shuffle Guess Time!", + category: "games", + run: async (client, message, args) => { + const fetch = require('node-fetch'); + const { MessageEmbed } = require('discord.js'); + const randomWords = require('random-words'); + const word = randomWords() + const res = await (await (fetch(`https://api.monkedev.com/fun/shuffle?content=${word}&key=EjLY54Vys5kJVWgcfaA1RjFIp`))).json(); + const firstbd = new MessageEmbed() + .setTitle("Shuffled!") + .setDescription("Now Try To Guess It!") + .addField("Reflushed", `it is \`${res.result}\`\nOptions: \`cancel\`,\`reshuffle\``) + .setColor("RANDOM"); + await message.channel.send(firstbd) + const gameFilter = m => m.author.id + const gameCollector = message.channel.createMessageCollector(gameFilter); + + gameCollector.on('collect', async msg => { + const ggembed = new MessageEmbed() + .setTitle("Nice!") + .setDescription(`You're answer is right! it was \`${word}\``) + .setColor("#C3447A") + .setFooter("©️ SyzeBot"); + if (msg.author.bot) return + const selection = msg.content.toLowerCase(); + if (selection === word) { + message.channel.send(ggembed) + gameCollector.stop() + } else if (selection === 'cancel') { + const cancelbd = new MessageEmbed() + .setTitle("Game Stopped!") + .setColor("RED"); + message.channel.send(cancelbd) + gameCollector.stop(); + } else if (selection === 'reshuffle') { + const reshbd = new MessageEmbed() + .setTitle("Shuffled!") + .setDescription("Now Try To Guess It **AGAIN!** don't make the same mistake...") + .addField("Reflushed", `it is \`${res.result}\`\nOptions: \`cancel\`,\`reshuffle\``) + .setColor("RANDOM"); + const ress = await (await (fetch(`https://api.monkedev.com/fun/shuffle?content=${word}&key=EjLY54Vys5kJVWgcfaA1RjFIp`))).json(); + message.channel.send(reshbd) + } else if (selection !== word) { + message.reply(`Wrong\nOptions: \`cancel\`,\`reshuffle\``) + } + }); + console.log(`${message.author.username} = ${word}`) //if u wanna test + } +} \ No newline at end of file diff --git "a/commands/\360\237\216\256 _ Games/snake.js" "b/commands/\360\237\216\256 _ Games/snake.js" new file mode 100644 index 0000000..5e7bb16 --- /dev/null +++ "b/commands/\360\237\216\256 _ Games/snake.js" @@ -0,0 +1,22 @@ +const { Client, Message } = require('discord.js'); +const SnakeGame = require('snakecord') +module.exports = { + name: 'snek', + category: 'games', + description: 'lets play snake game!', + usage: 'snek', + /** + * @param {Client} client + * @param {Message} message + * @param {String[]} args + */ + run: async(client, message, args) => { + const snakeGame = new SnakeGame({ + title: 'Snake Game', + color: "BLUE", + timestamp: true, + gameOverTitle: " Game Over" + }); + return snakeGame.newGame(message); + } +} \ No newline at end of file diff --git "a/commands/\360\237\216\256 _ Games/tictactoe.js" "b/commands/\360\237\216\256 _ Games/tictactoe.js" new file mode 100644 index 0000000..e62ee53 --- /dev/null +++ "b/commands/\360\237\216\256 _ Games/tictactoe.js" @@ -0,0 +1,19 @@ +const { tictactoe } = require('reconlx') +const MessageEmbed = require("discord.js"); + +module.exports = { + name : 'tictactoe', + category: 'games', + description: 'play tictactoe', + usage: 'tictactoe ', + run : async(client, message, args) => { + const member = message.mentions.members.first() + if(!member) return message.channel.send('Please specify a member to play with!') + + + new tictactoe({ + player_two: member, + message: message + }) + } +} \ No newline at end of file diff --git "a/commands/\360\237\216\256 _ Games/war.js" "b/commands/\360\237\216\256 _ Games/war.js" new file mode 100644 index 0000000..bcde5d8 --- /dev/null +++ "b/commands/\360\237\216\256 _ Games/war.js" @@ -0,0 +1,26 @@ +const weky = require('weky') +const Discord = require('discord.js'); +const bot = new Discord.Client(); + +module.exports = { + name: 'war', + aliases: ['mess'], + description: 'war with others that makes mess with you', + usage: '[USER]', + category: 'games', + + run: async (client, message, args) => { + let target = message.mentions.users.first() + if (!message.mentions.users.first()) return message.reply('Please Ping Someone!') + if (!target === client.user.id) return message.reply("I'm Not Good At Playing This Game... JK! Bots Can't Play Games Like This!") + if (message.mentions.users.first().bot) return message.reply("Bots Can't Play Games Like This!") + let fight = new weky.fight({ + message, + client, + acceptMessage: `${target}, Do You Want To Mess With <@${message.author.id}>`, + challenger: message.author, + opponent: message.mentions.users.first() + }) + fight.start() + } +} \ No newline at end of file diff --git "a/commands/\360\237\220\210 _ Animals/birb.js" "b/commands/\360\237\220\210 _ Animals/birb.js" new file mode 100644 index 0000000..4746778 --- /dev/null +++ "b/commands/\360\237\220\210 _ Animals/birb.js" @@ -0,0 +1,20 @@ +const { MessageEmbed } = require("discord.js"); +const fetch = require("node-fetch"); + +module.exports = { + name: "birb", + description: "Shows a picture of a birb", + category: "animal", + run: async (client, message) => { + const data = await ( + await fetch("https://some-random-api.ml/img/birb") + ).json(); + + const embed = new MessageEmbed() + .setDescription(`[Click here if image failed to load](${data.link})`) + .setImage(data.link) + .setColor("GREEN"); + + message.channel.send(embed); + }, +}; \ No newline at end of file diff --git "a/commands/\360\237\220\210 _ Animals/cat.js" "b/commands/\360\237\220\210 _ Animals/cat.js" new file mode 100644 index 0000000..7dc57be --- /dev/null +++ "b/commands/\360\237\220\210 _ Animals/cat.js" @@ -0,0 +1,22 @@ +const { MessageEmbed } = require("discord.js"); +const fetch = require("node-fetch"); + +module.exports = { + name: "cat", + description: "Shows a picture of a cat", + category: "animal", + run: async (client, message) => { + const data = await fetch("https://nekos.life/api/v2/img/meow").then((res) => + res.json() + ); + + const embed = new MessageEmbed() + .setFooter(message.author.username) + .setColor("YELLOW") + .setDescription(`[Click here if the image failed to load.](${data.url})`) + .setImage(`${data.url}`) + .setTimestamp(); + + message.channel.send(embed); + }, +}; \ No newline at end of file diff --git "a/commands/\360\237\220\210 _ Animals/catfact.js" "b/commands/\360\237\220\210 _ Animals/catfact.js" new file mode 100644 index 0000000..1f5bd2c --- /dev/null +++ "b/commands/\360\237\220\210 _ Animals/catfact.js" @@ -0,0 +1,14 @@ +const fetch = require("node-fetch"); + +module.exports = { + name: "catfact", + description: "Returns a cat fact", + category: "animal", + run: async (client, message) => { + const fact = await fetch("https://catfact.ninja/fact") + .then((res) => res.json()) + .then(({ fact }) => fact); + + message.channel.send(fact); + }, +}; \ No newline at end of file diff --git "a/commands/\360\237\220\210 _ Animals/dog.js" "b/commands/\360\237\220\210 _ Animals/dog.js" new file mode 100644 index 0000000..7bd86e6 --- /dev/null +++ "b/commands/\360\237\220\210 _ Animals/dog.js" @@ -0,0 +1,24 @@ +const { MessageEmbed } = require("discord.js"); +const fetch = require("node-fetch"); + +module.exports = { + name: "dog", + description: "Shows a picture of a dog", + category: "animal", + run: async (client, message) => { + const data = await fetch( + "https://dog.ceo/api/breeds/image/random" + ).then((res) => res.json()); + + const embed = new MessageEmbed() + .setFooter(message.author.username) + .setColor("BLACK") + .setDescription( + `[Click here if the image failed to load.](${data.message})` + ) + .setImage(`${data.message}`) + .setTimestamp(); + + message.channel.send(embed); + }, +}; \ No newline at end of file diff --git "a/commands/\360\237\220\210 _ Animals/dogfact.js" "b/commands/\360\237\220\210 _ Animals/dogfact.js" new file mode 100644 index 0000000..ccde1a5 --- /dev/null +++ "b/commands/\360\237\220\210 _ Animals/dogfact.js" @@ -0,0 +1,13 @@ +const fetch = require("node-fetch"); + +module.exports = { + name: "dogfact", + description: "Returns a dog fact", + category: "animal", + run: async (client, message) => { + const fact = await fetch("http://dog-api.kinduff.com/api/facts?number=1") + .then((res) => res.json()) + .then((body) => body.facts[0]); + return message.channel.send(`πŸ“’ **Dogfact:** *${fact}*`); + }, +}; \ No newline at end of file diff --git "a/commands/\360\237\220\210 _ Animals/own.js" "b/commands/\360\237\220\210 _ Animals/own.js" new file mode 100644 index 0000000..b31f5bb --- /dev/null +++ "b/commands/\360\237\220\210 _ Animals/own.js" @@ -0,0 +1,19 @@ +const { MessageEmbed } = require("discord.js"); +const fetch = require("node-fetch"); + +module.exports = { + name: "whale", + description: "Shows a picture of a whale", + category: "animal", + run: async (client, message) => { + const data = await fetch("http://pics.floofybot.moe/owl").then((res) => + res.json() + ); + + const embed = new MessageEmbed() + .setDescription(`[Click here if image failed to load](${data.image})`) + .setImage(data.image); + + message.channel.send(embed); + }, +}; \ No newline at end of file diff --git "a/commands/\360\237\220\210 _ Animals/panda.js" "b/commands/\360\237\220\210 _ Animals/panda.js" new file mode 100644 index 0000000..635fba6 --- /dev/null +++ "b/commands/\360\237\220\210 _ Animals/panda.js" @@ -0,0 +1,19 @@ +const { MessageEmbed } = require("discord.js"); +const fetch = require("node-fetch"); + +module.exports = { + name: "panda", + description: "Shows a picture of a panda", + category: "animal", + run: async (client, message) => { + const data = await fetch( + "https://some-random-api.ml/img/panda" + ).then((res) => res.json()); + + const embed = new MessageEmbed() + .setDescription(`[Click here if image failed to load](${data.link})`) + .setImage(data.link); + + message.channel.send(embed); + }, +}; \ No newline at end of file diff --git "a/commands/\360\237\221\221 _ Owner/Serverlist.js" "b/commands/\360\237\221\221 _ Owner/Serverlist.js" new file mode 100644 index 0000000..d778662 --- /dev/null +++ "b/commands/\360\237\221\221 _ Owner/Serverlist.js" @@ -0,0 +1,137 @@ +const Discord = require("discord.js"); +const ownerid = "787842689969684480"; + + +module.exports = { + name: "serverlist", + aliases: ["slt"], + category: "owner", + description: "Displays the list of Servers!", + usage: " ", + + run: async (bot, message, args) => { + if (message.author.id == ownerid) { + if (!message.guild.me.hasPermission("ADMINISTRATOR")) + return message.channel + .send("I DONT HAVE PERMISSION: `ADMINISTRATOR`") + .then(msg => msg.delete({ timeout: 5000 })); + + let i0 = 0; + let i1 = 10; + let page = 1; + + let description = + `Total Servers ${bot.user.username} In - ${bot.guilds.cache.size}\n\n` + + bot.guilds.cache + .sort((a, b) => b.memberCount - a.memberCount) + .map(r => r) + .map((r, i) => `**${i + 1}** - ${r.name} | ${r.memberCount} Members\nID - ${r.id}`) + .slice(0, 10) + .join("\n\n"); + + let embed = new Discord.MessageEmbed() + .setAuthor(bot.user.tag, bot.user.displayAvatarURL({dynamic : true})) + + .setColor("00FFFF") + .setFooter(`Page - ${page}/${Math.ceil(bot.guilds.cache.size / 10)}`) + .setDescription(description); + + let msg = await message.channel.send(embed); + + await msg.react("β¬…"); + await msg.react("➑"); + await msg.react("❌"); + + let collector = msg.createReactionCollector( + (reaction, user) => user.id === message.author.id + ); + + collector.on("collect", async (reaction, user) => { + if (reaction._emoji.name === "β¬…") { + // Updates variables + i0 = i0 - 10; + i1 = i1 - 10; + page = page - 1; + + // if there is no guild to display, delete the message + if (i0 + 1 < 0) { + console.log(i0) + return msg.delete(); + } + if (!i0 || !i1) { + return msg.delete(); + } + + description = + `Total Servers - ${bot.guilds.cache.size}\n\n` + + bot.guilds.cache + .sort((a, b) => b.memberCount - a.memberCount) + .map(r => r) + .map( + (r, i) => `**${i + 1}** - ${r.name} | ${r.memberCount} Members\nID - ${r.id}`) + .slice(i0, i1) + .join("\n\n"); + + // Update the embed with new informations + embed + .setFooter( + `Page - ${page}/${Math.round(bot.guilds.cache.size / 10 + 1)}` + ) + .setDescription(description); + + // Edit the message + msg.edit(embed); + } + + if (reaction._emoji.name === "➑") { + // Updates variables + i0 = i0 + 10; + i1 = i1 + 10; + page = page + 1; + + // if there is no guild to display, delete the message + if (i1 > bot.guilds.cache.size + 10) { + return msg.delete(); + } + if (!i0 || !i1) { + return msg.delete(); + } + + description = + `Total Servers - ${bot.guilds.cache.size}\n\n` + + bot.guilds.cache + .sort((a, b) => b.memberCount - a.memberCount) + .map(r => r) + .map( + (r, i) => `**${i + 1}** - ${r.name} | ${r.memberCount} Members\nID - ${r.id}`) + .slice(i0, i1) + .join("\n\n"); + + // Update the embed with new informations + embed + .setFooter( + `Page - ${page}/${Math.round(bot.guilds.cache.size / 10 + 1)}` + ) + .setDescription(description); + + // Edit the message + msg.edit(embed); + } + + if (reaction._emoji.name === "❌") { + const xembed = new Discord.MessageEmbed() + .setTitle(`DESTROYED`) + .setDescription(`Command Destroyed Because Of Reaction: :x:`) + .setColor("RED"); + msg.delete() + message.reply(xembed); + } + + // Remove the reaction when the user react to the message + await reaction.users.remove(message.author.id); + }); + } else { + return; + } + } +}; \ No newline at end of file diff --git "a/commands/\360\237\221\221 _ Owner/eval.js" "b/commands/\360\237\221\221 _ Owner/eval.js" new file mode 100644 index 0000000..9e879c4 --- /dev/null +++ "b/commands/\360\237\221\221 _ Owner/eval.js" @@ -0,0 +1,45 @@ +const Discord = require('discord.js'); +const config = require('../../config.json'); + + + +module.exports = { + name: 'eval', + description: 'Eval', + aliases: ["evl"], + usage: '', + accessableby: "OWNER ONLY BRO", + category: "owner", + run: async (client, message, args) => { + + let array = config.dev + + if(!array.includes(message.author.id.toString())) { + return message.channel.send("This command is only for <@787842689969684480>") + } + + const content = message.content.split(" ").slice(1).join(" "); + const result = new Promise((resolve, reject) => resolve(eval(content))); + + return result.then((output) => { + if(typeof output !== "string"){ + output = require("util").inspect(output, { depth: 0 }); + } + if(output.includes(client.token)){ + output = output.replace(message.client.token, "T0K3N"); + } + message.channel.send(output, { + code: "js" + }); + }).catch((err) => { + err = err.toString(); + if(err.includes(message.client.token)){ + err = err.replace(message.client.token, "T0K3N"); + } + message.channel.send(err, { + code: "js" + }); + }); + + } +} \ No newline at end of file diff --git "a/commands/\360\237\221\221 _ Owner/reload.js" "b/commands/\360\237\221\221 _ Owner/reload.js" new file mode 100644 index 0000000..c8ed440 --- /dev/null +++ "b/commands/\360\237\221\221 _ Owner/reload.js" @@ -0,0 +1,36 @@ +const djs = require('discord.js') + +module.exports = { + name: 'reload', + description: 'Reloades a command', + category: 'owner', + usage: 'reload ', + run: async(client, message, args) => { + //--------Check Permission--------\\ + if(message.author.id !== "787842689969684480") return message.channel.send("This command is only for <@787842689969684480>"); + + if(!args[0]) return message.channel.send('You must provide a category name'); + if(!args[1]) return message.channel.send('You must provide a command for me to reload'); + + let category = args[0].toLowerCase(); + let commandName = args[1].toLowerCase(); + + try { + delete require.cache[require.resolve(`../../commands/${category}/${commandName}.js`)]; + client.commands.delete(commandName); + const pull = require(`../../commands/${category}/${commandName}.js`); + client.commands.set(commandName, pull); + + const embed = new djs.MessageEmbed() + .setTitle('Reload Command') + .setColor('YELLOW') + .setDescription(`Successfully reloaded \`${args[1].toUpperCase()}\` command`) + + return message.channel.send(embed); + } catch(e) { + return message.channel.send(`Error while reloading: \`${args[1].toUpperCase()}\` command`); + } + + } + +} \ No newline at end of file diff --git "a/commands/\360\237\221\221 _ Owner/shutdown.js" "b/commands/\360\237\221\221 _ Owner/shutdown.js" new file mode 100644 index 0000000..4039424 --- /dev/null +++ "b/commands/\360\237\221\221 _ Owner/shutdown.js" @@ -0,0 +1,17 @@ +module.exports = { + name: "shutdown", + aliases: ["turnoff"], + description: "Shuts down the bot !!", + category: "owner", + example: `sz!shutdown`, + + run: async(client, message, args) => { + + if (message.author.id !== "787842689969684480") { + return; + } + + await message.channel.send(`βœ… Thank You For Letting Me Rest!`) + process.exit() + } +} \ No newline at end of file diff --git "a/commands/\360\237\222\276 _ Backup (BETA)/create.js" "b/commands/\360\237\222\276 _ Backup (BETA)/create.js" new file mode 100644 index 0000000..76275ea --- /dev/null +++ "b/commands/\360\237\222\276 _ Backup (BETA)/create.js" @@ -0,0 +1,30 @@ +const Discord = require("discord.js"); +const backup = require("discord-backup"); +const client = new Discord.Client(); +const config = require("../../config.json") + +module.exports = { + name: "create", + usage: "none", + description: "create backup", + category: "backup", + aliases: ["create-backup"], + + run: async (client, message, args) => { + + if(!message.member.hasPermission("ADMINISTRATOR")) { + return message.channel.send(":x: | You must be an administrator of this server to request a backup!"); +} +if (!message.member.hasPermission("ADMINISTRATOR")) { + return message.channel.send(":x: | I must be an administrator of this server to create a backup!"); + } +// Create the backup +backup.create(message.guild, { + jsonBeautify: true +}).then((backupData) => { + // And send informations to the backup owner + message.author.send("The backup has been created! To load it, type this command on the server of your choice: `" + config.default_prefix + "load-backup " + backupData.id + "`!"); + message.channel.send(":white_check_mark: Backup successfully created. Back up id sended in your DMs!"); +}); + } +} \ No newline at end of file diff --git "a/commands/\360\237\222\276 _ Backup (BETA)/infos.js" "b/commands/\360\237\222\276 _ Backup (BETA)/infos.js" new file mode 100644 index 0000000..614fb37 --- /dev/null +++ "b/commands/\360\237\222\276 _ Backup (BETA)/infos.js" @@ -0,0 +1,38 @@ +const Discord = require("discord.js"); +const backup = require("discord-backup"); +const client = new Discord.Client(); +const config = require("../../config.json") + + +module.exports = { + name: "info-backup", + category: "backup", + + run: async (client, message, args) => { + let backupID = args[0]; + if (!backupID) { + return message.channel.send(":x: | You must specify a valid backup ID!"); + } + // Fetch the backup + backup.fetch(backupID).then((backupInfos) => { + const date = new Date(backupInfos.data.createdTimestamp); + const yyyy = date.getFullYear().toString(), mm = (date.getMonth() + 1).toString(), dd = date.getDate().toString(); + const formatedDate = `${yyyy}/${(mm[1] ? mm : "0" + mm[0])}/${(dd[1] ? dd : "0" + dd[0])}`; + let embed = new Discord.MessageEmbed() + .setAuthor("Backup Informations") + // Display the backup ID + .addField("Backup ID", backupInfos.id, false) + // Displays the server from which this backup comes + .addField("Server ID", backupInfos.data.guildID, false) + // Display the size (in mb) of the backup + .addField("Size", `${backupInfos.size} kb`, false) + // Display when the backup was created + .addField("Created at", formatedDate, false) + .setColor("#FF0000"); + message.channel.send(embed); + }).catch((err) => { + // if the backup wasn't found + return message.channel.send(":x: | No backup found for `" + backupID + "`!"); + }); + } +} \ No newline at end of file diff --git "a/commands/\360\237\222\276 _ Backup (BETA)/load.js" "b/commands/\360\237\222\276 _ Backup (BETA)/load.js" new file mode 100644 index 0000000..aa5ab1c --- /dev/null +++ "b/commands/\360\237\222\276 _ Backup (BETA)/load.js" @@ -0,0 +1,52 @@ +const Discord = require("discord.js"); +const backup = require("discord-backup"); +const client = new Discord.Client(); +const config = require("../../config.json") + + +module.exports = { + name: "load-backup", + usage: "", + description: "load a saved backup, yeah some of them may not saved", + category: "backup", + + run: async (client, message, args) => { + if (!message.member.hasPermission("ADMINISTRATOR")) { + return message.channel.send(":x: | You must be an administrator of this server to load a backup!"); + } + if (!message.guild.me.hasPermission("ADMINISTRATOR")) { + return message.channel.send(":x: | I must be an administrator of this server to load a backup!"); + } + let backupID = args[0]; + if (!backupID) { + return message.channel.send(":x: | You must specify a valid backup ID!"); + } + // Fetching the backup to know if it exists + backup.fetch(backupID).then(async () => { + // If the backup exists, request for confirmation + message.channel.send(":warning: | When the backup is loaded, all the channels, roles, etc. will be replaced! Type `-confirm` to confirm!"); + await message.channel.awaitMessages(m => (m.author.id === message.author.id) && (m.content === "-confirm"), { + max: 1, + time: 20000, + errors: ["time"] + }).catch((err) => { + // if the author of the commands does not confirm the backup loading + return message.channel.send(":x: | Time's up! Cancelled backup loading!"); + }); + // When the author of the command has confirmed that he wants to load the backup on his server + message.author.send(":white_check_mark: | Start loading the backup!"); + // Load the backup + backup.load(backupID, message.guild).then(() => { + // When the backup is loaded, delete them from the server + backup.remove(backupID); + }).catch((err) => { + // If an error occurred + return message.author.send(":x: | Sorry, an error occurred... Please check that I have administrator permissions!"); + }); + }).catch((err) => { + console.log(err); + // if the backup wasn't found + return message.channel.send(":x: | No backup found for `" + backupID + "`!"); + }); + } +} \ No newline at end of file diff --git "a/commands/\360\237\224\236 _ NSFW/ass.js" "b/commands/\360\237\224\236 _ NSFW/ass.js" new file mode 100644 index 0000000..6f30c21 --- /dev/null +++ "b/commands/\360\237\224\236 _ NSFW/ass.js" @@ -0,0 +1,23 @@ +const discord = require("discord.js"); +const akaneko = require('akaneko'); + +module.exports = { + name: "ass", + aliases: [], + category: "nsfw", + description: "Get some wallpapers", + run: async (client, message, args) => { + + if(!message.channel.nsfw) { + return message.reply("This channel was unsupported for NSFW content") + + } else { + + let akanekoSan = new discord.MessageEmbed() + akanekoSan.setColor("RANDOM") + akanekoSan.setImage(akaneko.nsfw.ass()); + return message.channel.send(akanekoSan); + + } + } +} \ No newline at end of file diff --git "a/commands/\360\237\224\236 _ NSFW/bdsm.js" "b/commands/\360\237\224\236 _ NSFW/bdsm.js" new file mode 100644 index 0000000..47cce03 --- /dev/null +++ "b/commands/\360\237\224\236 _ NSFW/bdsm.js" @@ -0,0 +1,23 @@ +const discord = require("discord.js"); +const akaneko = require('akaneko'); + +module.exports = { + name: "bdsm", + aliases: [], + category: "nsfw", + description: "Get some wallpapers", + run: async (client, message, args) => { + + if(!message.channel.nsfw) { + return message.reply("This channel was unsupported for NSFW content") + + } else { + + let akanekoSan = new discord.MessageEmbed() + akanekoSan.setColor("RANDOM") + akanekoSan.setImage(akaneko.nsfw.bdsm()); + return message.channel.send(akanekoSan); + + } + } +} \ No newline at end of file diff --git "a/commands/\360\237\224\236 _ NSFW/cum.js" "b/commands/\360\237\224\236 _ NSFW/cum.js" new file mode 100644 index 0000000..1a3959b --- /dev/null +++ "b/commands/\360\237\224\236 _ NSFW/cum.js" @@ -0,0 +1,23 @@ +const discord = require("discord.js"); +const akaneko = require('akaneko'); + +module.exports = { + name: "cum", + aliases: [], + category: "nsfw", + description: "Get some wallpapers", + run: async (client, message, args) => { + + if(!message.channel.nsfw) { + return message.reply("This channel was unsupported for NSFW content") + + } else { + + let akanekoSan = new discord.MessageEmbed() + akanekoSan.setColor("RANDOM") + akanekoSan.setImage(akaneko.nsfw.cum()); + return message.channel.send(akanekoSan); + + } + } +} \ No newline at end of file diff --git "a/commands/\360\237\224\236 _ NSFW/doujin.js" "b/commands/\360\237\224\236 _ NSFW/doujin.js" new file mode 100644 index 0000000..d54b900 --- /dev/null +++ "b/commands/\360\237\224\236 _ NSFW/doujin.js" @@ -0,0 +1,23 @@ +const discord = require("discord.js"); +const akaneko = require('akaneko'); + +module.exports = { + name: "doujin", + aliases: [], + category: "nsfw", + description: "Get some wallpapers", + run: async (client, message, args) => { + + if(!message.channel.nsfw) { + return message.reply("This channel dosen't support nsfw content") + + } else { + + let akanekoSan = new discord.MessageEmbed() + akanekoSan.setColor("RANDOM") + akanekoSan.setImage(akaneko.nsfw.doujin()); + return message.channel.send(akanekoSan); + + } + } +} \ No newline at end of file diff --git "a/commands/\360\237\224\236 _ NSFW/femdom.js" "b/commands/\360\237\224\236 _ NSFW/femdom.js" new file mode 100644 index 0000000..c75d490 --- /dev/null +++ "b/commands/\360\237\224\236 _ NSFW/femdom.js" @@ -0,0 +1,23 @@ +const discord = require("discord.js"); +const akaneko = require('akaneko'); + +module.exports = { + name: "femdom", + aliases: [], + category: "nsfw", + description: "Get some wallpapers", + run: async (client, message, args) => { + + if(!message.channel.nsfw) { + return message.reply("This channel dosen't support nsfw content") + + } else { + + let akanekoSan = new discord.MessageEmbed() + akanekoSan.setColor("RANDOM") + akanekoSan.setImage(akaneko.nsfw.femdom()); + return message.channel.send(akanekoSan); + + } + } +} \ No newline at end of file diff --git "a/commands/\360\237\224\236 _ NSFW/hentai.js" "b/commands/\360\237\224\236 _ NSFW/hentai.js" new file mode 100644 index 0000000..296d756 --- /dev/null +++ "b/commands/\360\237\224\236 _ NSFW/hentai.js" @@ -0,0 +1,23 @@ +const discord = require("discord.js"); +const akaneko = require('akaneko'); + +module.exports = { + name: "hentai", + aliases: [], + category: "nsfw", + description: "Get some wallpapers", + run: async (client, message, args) => { + + if(!message.channel.nsfw) { + return message.reply("This channel dosen't support nsfw content") + + } else { + + let akanekoSan = new discord.MessageEmbed() + akanekoSan.setColor("RANDOM") + akanekoSan.setImage(akaneko.nsfw.hentai()); + return message.channel.send(akanekoSan); + + } + } +} \ No newline at end of file diff --git "a/commands/\360\237\224\250 _ Moderation/addcmd.js" "b/commands/\360\237\224\250 _ Moderation/addcmd.js" new file mode 100644 index 0000000..a181847 --- /dev/null +++ "b/commands/\360\237\224\250 _ Moderation/addcmd.js" @@ -0,0 +1,44 @@ +const db = require("quick.db") +const discord = require("discord.js") + +module.exports = { + name: "addcmd", + usage: "addcmd ", + description: "add guild custom commands", + category: "moderation", + run: (client, message, args) => { + + + if(!message.member.hasPermission("MANAGE_MESSAGES")) return message.channel.send(":x: You need `MANAGE_MESSAGES` perms to use this command") + + let cmdname = args[0] + + if(!cmdname) return message.channel.send(`:x: You have to give command name, \`addcmd \``) + + let cmdresponce = args.slice(1).join(" ") + + if(!cmdresponce) return message.channel.send(`:x: You have to give command cmd responce, \`addcmd \``) + + let database = db.get(`cmd_${message.guild.id}`) + + if(database && database.find(x => x.name === cmdname.toLowerCase())) return message.channel.send(":x: This command name is already added in guild custom commands.") + + let data = { + name: cmdname.toLowerCase(), + responce: cmdresponce + } + + db.push(`cmd_${message.guild.id}`, data) + const createdembed = new discord.MessageEmbed() + .setTitle("Command Added!") + .setDescription("Added **" + cmdname.toLowerCase() + `** as a custom command in **${message.guild.name}**`) + .setColor("GREEN") + .setDescription(message.author.tag, message.author.displayAvatarURL({ dyanmic: true })) + + + + return message.channel.send("Added **" + cmdname.toLowerCase() + `** as a custom command in **${message.guild.name}**`) + + + } +} diff --git "a/commands/\360\237\224\250 _ Moderation/addemj.js" "b/commands/\360\237\224\250 _ Moderation/addemj.js" new file mode 100644 index 0000000..5c88537 --- /dev/null +++ "b/commands/\360\237\224\250 _ Moderation/addemj.js" @@ -0,0 +1,47 @@ +const Discord = require('discord.js') +const { parse } = require("twemoji-parser"); +const { MessageEmbed } = require("discord.js"); +const config = require("../../config.json") + +module.exports = { + name: "addemoji", + aliases: ["stealemoji"], + category: "moderation", + run: async (client, message, args) => { + if (!message.member.hasPermission("MANAGE_EMOJIS")) { + return message.channel.send(`:x: | **You Don't Have Enough Permission To Add Emoji! Missing Perms: \`MANAGE_EMOJIS\`**`) + } + let isUrl = require("is-url"); + let type = ""; + let name = ""; + let emote = args.join(" ").match(/?/gi); + if (emote) { + emote = emote[0]; + type = "emoji"; + name = args.join(" ").replace(/?/gi, "").trim().split(" ")[0]; + } else { + emote = `${args.find(arg => isUrl(arg))}` + name = args.find(arg => arg != emote); + type = "url"; + } + let emoji = { name: "" }; + let Link; + if (type == "emoji") { + emoji = Discord.Util.parseEmoji(emote); + Link = `https://cdn.discordapp.com/emojis/${emoji.id}.${ + emoji.animated ? "gif" : "png" + }` + } else { + if (!name) return message.channel.send(":x: | Please provide a name for emoji!!"); + Link = message.attachments.first() ? message.attachments.first().url : emote; + } + message.guild.emojis.create( + `${Link}`, + `${`${name || emoji.name}`}` + ).then(em => message.channel.send(em.toString() + " added!")).catch(error => { + message.channel.send(`:x: | **Wrong Usage! Please do:** \`${config.default_prefix}addemoji \``) + console.log(`Wrong Usage In ${message.guild.name}`) + }) + + } +} \ No newline at end of file diff --git "a/commands/\360\237\224\250 _ Moderation/addrole.js" "b/commands/\360\237\224\250 _ Moderation/addrole.js" new file mode 100644 index 0000000..4596941 --- /dev/null +++ "b/commands/\360\237\224\250 _ Moderation/addrole.js" @@ -0,0 +1,34 @@ +const { MessageEmbed } = require('discord.js') + +module.exports = { + name: "addrole", + aliases: ["role"], + category: "moderation", + description: "Add role to any user", + run: async (client, message, args) => { + if (!message.member.hasPermission("MANAGE_ROLES")) { + return message.channel.send("sorry you need permission = `MANAGE_ROLES`"); + } + if (!message.guild.me.hasPermission("MANAGE_ROLES")) { + return message.channel.send("I do not have permission = `MANAGE_ROLES`"); + } + let target = message.mentions.members.first(); + + if (!target) return message.reply(`:x:please mention user!`) + + let arole = message.mentions.roles.first(); + + if (!arole) return message.reply(`:x:please mention role for add!`) + + let ticon = target.user.avatarURL({ dynamic: true, size: 2048 }); + let aicon = message.author.avatarURL({ dynamic: true, size: 2048 }); + + const embed = new MessageEmbed() + + .setColor("RANDOM") + .setDescription(`<:check:825944444321923082>changed role for ${target.user.username} added ${arole}`) + target.roles.add(arole) + await message.channel.send(embed) + + } +}; \ No newline at end of file diff --git "a/commands/\360\237\224\250 _ Moderation/ban.js" "b/commands/\360\237\224\250 _ Moderation/ban.js" new file mode 100644 index 0000000..98efaed --- /dev/null +++ "b/commands/\360\237\224\250 _ Moderation/ban.js" @@ -0,0 +1,52 @@ +const { Client, Message, MessageEmbed } = require('discord.js'); +const sendError = require('../../mores/error.js'); + +module.exports = { + name: 'ban', + description: 'Ban a user from the guild', + usage: 'ban [user] [reason]', + category: 'πŸ”¨ moderation', + /** + * @param {Client} client + * @param {Message} message + * @param {String[]} args + */ + run: async(client, message, args) => { + if(!message.guild.me.permissions.has("BAN_MEMBERS")){ + return sendError("I Don't Have Permission To Ban Members!", message.channel) + } + if(!message.member.permissions.has("BAN_MEMBERS")){ + return sendError("You Dont Have Permission To Ban Members!", message.channel) + } + let target = message.mentions.members.first() || message.guild.members.cache.get(args[0]) + let reason = args.slice(1).join(" ") + + if(!target){ + return sendError("Please Mention A User", message.channel) + } + if(!reason){ + return sendError("Please Enter A Reason...", message.channel) + } + if(target === message.guild.owner){ + return sendError("What? You Can't Ban Owner!", message.channel) + } + if(target === message.author){ + return sendError("I Will Ban You Sometimes") + } + if(target.bannable){ + let embed = new MessageEmbed() + .setTitle("BANNED") + .setThumbnail(target.user.displayAvatarURL({ dynamic: true })) + .setDescription(`Banned:\n**__USER:__** ${target} + **__REASON:__** \`${reason}\` + **__AUTHOR__:** <@${message.author.id}>`) + .setColor("RANDOM") + .setFooter("BANNED_MEMBER COMMAND") + + message.channel.send(embed) + target.ban() + } else { + return sendError("Please Check My Role, Or Make My Role Higher Than Everyone.", message.channel) + } + } +} \ No newline at end of file diff --git "a/commands/\360\237\224\250 _ Moderation/banned.js" "b/commands/\360\237\224\250 _ Moderation/banned.js" new file mode 100644 index 0000000..4b0380f --- /dev/null +++ "b/commands/\360\237\224\250 _ Moderation/banned.js" @@ -0,0 +1,34 @@ +const { Client, Message, MessageEmbed } = require('discord.js'); + +module.exports = { + name: 'bannedusers', + category : 'moderation', + aliases : ['fetchBans', 'banneds'], + description : 'This command allows you to know the users who have been banned in the server.', + /** + * @param {Client} client + * @param {Message} message + * @param {String[]} args + */ + run: async(client, message, args) => { + if (!message.member.hasPermission("BAN_MEMBERS")) { + return message.channel.send("sorry you need permission = `BAN_MEMBERS`"); + } + if (!message.guild.me.hasPermission("BAN_MEMBERS")) { + return message.channel.send("I do not have permission = `BAN_MEMBERS`"); + } + + const fetchBans = message.guild.fetchBans(); + const bannedMembers = (await fetchBans) + .map ((member) => member.user.tag) + .join(", "); + const embed = new MessageEmbed() + .setTitle(":hammer_pick: Banned users:") + .setDescription(bannedMembers) + .setColor("FF0000") + .setTimestamp() + + message.channel.send(embed); + }, + +}; \ No newline at end of file diff --git "a/commands/\360\237\224\250 _ Moderation/clear.js" "b/commands/\360\237\224\250 _ Moderation/clear.js" new file mode 100644 index 0000000..a34649a --- /dev/null +++ "b/commands/\360\237\224\250 _ Moderation/clear.js" @@ -0,0 +1,32 @@ +module.exports = { + name: "clear", + aliases:["c", "purge"], + category: "moderation", + description: "Delete bulk messages with 1 command", + run: async (client, message, args) => { + + + if (message.deletable) { + message.delete(); + } + + if (!message.member.hasPermission("MANAGE_MESSAGES")) { + return message.reply("Missing Permissions!").then(m => m.delete(5000)); + } + + if (isNaN(args[0]) || parseInt(args[0]) <= 0) { + return message.reply("This is not a number").then(m => m.delete(5000)); + } + + let deleteAmount; + if (parseInt(args[0]) > 100) { + deleteAmount = 100; + } else { + deleteAmount = parseInt(args[0]); + } + + message.channel.bulkDelete(deleteAmount, true) + .catch(err => message.reply(`Something went wrong... ${err}`)); + + } +} \ No newline at end of file diff --git "a/commands/\360\237\224\250 _ Moderation/delcmd.js" "b/commands/\360\237\224\250 _ Moderation/delcmd.js" new file mode 100644 index 0000000..7c498e9 --- /dev/null +++ "b/commands/\360\237\224\250 _ Moderation/delcmd.js" @@ -0,0 +1,47 @@ +const db = require("quick.db") +const discord = require("discord.js") + +module.exports = { + name: "delcmd", + usage: "delcmd ", + description: "Delete the custom commannd", + category: "moderation", + run: (client, message, args) => { + + let cmdname = args[0] + + if(!cmdname) return message.channel.send(":x: Gimm me commmand name, `delcmd `") + + let database = db.get(`cmd_${message.guild.id}`) + + if(database) { + let data = database.find(x => x.name === cmdname.toLowerCase()) + + if(!data) return message.channel.send(":x: Unable to find this command.") + + let value = database.indexOf(data) + delete database[value] + + var filter = database.filter(x => { + return x != null && x != '' + }) + + const delembed = new discord.MessageEmbed() + .setTitle("Command Deleted!") + .setDescription(`Removed **${cmdname}** Command From ${message.guild.name}!`) + .setColor("GREEN") + .setDescription(`Removed **${cmdname}** Command From ${message.guild.name}`) + + db.set(`cmd_${message.guild.id}`, filter) + return message.channel.send(`Removed **${cmdname}** Command From ${message.guild.name}`) + + + } else { + return message.channel.send(":x: Sorry but i am unable to find that command! make sure it's not typo or make sure it's a **CUSTOM COMMAND**") + + + + } + } +} + \ No newline at end of file diff --git "a/commands/\360\237\224\250 _ Moderation/kick.js" "b/commands/\360\237\224\250 _ Moderation/kick.js" new file mode 100644 index 0000000..33ef6f2 --- /dev/null +++ "b/commands/\360\237\224\250 _ Moderation/kick.js" @@ -0,0 +1,54 @@ +const { Client, Message, MessageEmbed } = require('discord.js'); +const sendError = require('../../mores/error.js'); + +module.exports = { + name: 'kick', + aliases: ['keluarkan'], + description: 'Kicks a member from your server', + usage: 'kick [MEMBER] [REASON]', + category: 'πŸ”¨ moderation', + cooldown: 5, + /** + * @param {Client} client + * @param {Message} message + * @param {String[]} args + */ + run: async(client, message, args) => { + const target = message.mentions.members.first() || message.guild.members.cache.get(args[0]) + const reason = args.slice(1).join(" ") + + if(!message.member.permissions.has("KICK_MEMBERS")){ + return sendError("You Don't Have Permission To Kick Members! Missing Perms - [KICK_MEMBERS]", message.guild) + } + if(!message.guild.me.permissions.has("KICK_MEMBERS")){ + return sendError("I Don't Have Permission To Kick Members! Missing Perms - [KICK_MEMBERS]", message.channel) + } + if(!target){ + return sendError("Please Enter A User!", message.channel) + } + if(!reason){ + return sendError("Please Enter A Reason To Kick!", message.channel) + } + if(target.id === message.guild.owner){ + return sendError("You Cant Kick The Owner Jerk!", message.channel) + } + if(target.id === message.author){ + return sendError("You Can't Kick Yourself!") + } + if(target.kickable){ + const embed = new MessageEmbed() + .setTitle("Kicked Member!") + .setThumbnail(target.user.displayAvatarURL({ dynamic: true })) + .setDescription(`I Kicked:\n + **__USER:__** ${target}\n + **__REASON:__** \`${reason || "Not Provided"}\`\n + **__AUTHOR:__** <@${message.author.id}>`) + .setTimestamp(); + + message.channel.send(embed) + target.kick() + } else { + message.channel.send("Please Check My Role, Or Make My Role Is Higher Than Everyone!") + } + } +} \ No newline at end of file diff --git "a/commands/\360\237\224\250 _ Moderation/lock.js" "b/commands/\360\237\224\250 _ Moderation/lock.js" new file mode 100644 index 0000000..0552813 --- /dev/null +++ "b/commands/\360\237\224\250 _ Moderation/lock.js" @@ -0,0 +1,31 @@ +const Discord = module.require("discord.js"); + +module.exports = { + name: "lock", + category: "moderation", + description: "Locks a Channel", + + run: async(client, message, args) => { + + let channel = message.channel; + + if (!message.member.hasPermission('MANAGE_CHANNELS')) { + return message.channel.send("You don't have enough powers! missing perms: `MANAGE_CHANNELS`") + } + if(!message.guild.me.hasPermission('MANAGE_CHANNELS')) { + return message.channel.send("I Don't Have Enough Powers To Lock! Missing Perms: `MANAGE_CHANNELS`") + } + message.channel.overwritePermissions([ + { + id: message.guild.id, + deny : ['SEND_MESSAGES'], + }, + ],); + const embed = new Discord.MessageEmbed() + .setTitle("Channel Updates") + .setDescription(`πŸ”’ ${message.channel} has been Locked!`) + .setColor(`#34568B`); + await message.channel.send(embed); + message.delete(); + } +} \ No newline at end of file diff --git "a/commands/\360\237\224\250 _ Moderation/multimoji.js" "b/commands/\360\237\224\250 _ Moderation/multimoji.js" new file mode 100644 index 0000000..51f2fe5 --- /dev/null +++ "b/commands/\360\237\224\250 _ Moderation/multimoji.js" @@ -0,0 +1,32 @@ +const Discord = require('discord.js') +const { parse } = require("twemoji-parser"); +const { MessageEmbed } = require("discord.js"); +module.exports = { + name: "multimoji", + description: "add a multiple emoji ", + usage: "multimoji [emoji or more emoji!!!]", + category: "moderation", + run: async (client, message, args) => { + if (!message.member.hasPermission("MANAGE_EMOJIS")) { +return message.channel.send(`:x: | **You Don't Have Permission To Use This Command**`) +} + const emojis = args.join(" ").match(/?/gi) + if (!emojis) return message.channel.send(`:x: | **Provde The emojis to add**`); + emojis.forEach(emote => { + let emoji = Discord.Util.parseEmoji(emote); + if (emoji.id) { + const Link = `https://cdn.discordapp.com/emojis/${emoji.id}.${ + emoji.animated ? "gif" : "png" +}` + message.guild.emojis.create( + `${Link}`, + `${`${emoji.name}`}` + ).then(em => message.channel.send(em.toString() + " added!")).catch(error => { + message.channel.send(":x: | an Error occured") + console.log(error) +}) + + } + }) +} +} \ No newline at end of file diff --git "a/commands/\360\237\224\250 _ Moderation/mute.js" "b/commands/\360\237\224\250 _ Moderation/mute.js" new file mode 100644 index 0000000..e2474fe --- /dev/null +++ "b/commands/\360\237\224\250 _ Moderation/mute.js" @@ -0,0 +1,52 @@ +const { MessageEmbed } = require("discord.js"); + +module.exports = { + name: "mute", + aliases: ["mutes", "muted"], + category: "moderation", + description: "mute a member", + run: async (client, message, args) => { + if (!message.member.hasPermission("MANAGE_ROLES")) { + return message.channel.send("sorry you need permission to mute someone"); + } + if (!message.guild.me.hasPermission("MANAGE_ROLES")) { + return message.channel.send("I do not have permission to mute"); + } + + const user = message.mentions.members.first(); + + if (!user) { + return message.channel.send("\```please mention the members for mute\```"); + } + if (user.id === message.author.id) { + return message.channel.send("I can't mute you because you are message author"); + } + let reason = args.slice(1).join(""); + + if (!reason) { + return message.channel.send(" \``` please give some reason for mute\``` "); + } + + if(!user === client.user.id) { + return message.reply('i cant mute myself...') + } + + const vrole = user.roles.cache + + let muterole = message.guild.roles.cache.find(x => x.name === "muted"); + + if (!muterole) { + return message.channel.send("\```please create role name with muted \``` "); + } + + await user.roles.remove(vrole); + await user.roles.add(muterole); + + await message.channel.send( + `you muted ${message.mentions.users.first().username} for ${reason}` + ); + + user.send(`You get muted in ${message.guild} for ${reason}` + ); + } +}; \ No newline at end of file diff --git "a/commands/\360\237\224\250 _ Moderation/reaction.js" "b/commands/\360\237\224\250 _ Moderation/reaction.js" new file mode 100644 index 0000000..f22b2d8 --- /dev/null +++ "b/commands/\360\237\224\250 _ Moderation/reaction.js" @@ -0,0 +1,66 @@ +const discord = require("discord.js"); + +module.exports = { + name: "react", + aliases: ["reaction-role", "rr"], + category: "moderation", + description: "react to a message", + + run: async (client, message, args) => { + + if(!message.member.hasPermission("MANAGE_MESSAGES")) return message.channel.send("You need `MANAGE_MESSAGES` permission!") + + if(!message.guild.me.hasPermission("MANAGE_MESSAGES")) return message.channel.send("Please add a `MANAGE_MESSAGES` permission!") + + // gets the role for the reaction + let reactRole = message.mentions.roles.first() + + // if no role provided it will send this + if (!reactRole) return message.channel.send(`Say a role you want to get added`) + + // create an embed + const embed = new discord.MessageEmbed() + .setColor("RANDOM") // the color of the embed + .setTitle("Reaction Roles") + .setDescription(`React with βœ… to get the role ${reactRole}`) + .setFooter("Reaction Role") // desc of the embed + .setTimestamp(); + + // send the embed. + let msg = await message.channel.send(embed) + + // reacts to the embed with an emoji + await msg.react('βœ…') + + // filtering so it only works for the emoji choosen + const reactionFilter = (reaction, user) => ["βœ…"].includes(reaction.emoji.name) + + // making a collection for the emoji + const reactionCollector = msg.createReactionCollector(reactionFilter, { dispose: true }) + + // setting the collection that when the reaction was removed + reactionCollector.on("remove", (reaction, user) => { + + // if the bot removed their reaction return + if (user.bot) return; + + // getting the member of the server who reacted + let member = reaction.message.guild.members.cache.find(member => member.id === user.id) + + // remove the role when he/she remove his/her reaction. + member.roles.remove(reactRole.id) + }) + + reactionCollector.on("collect", (reaction, user) => { + + // if a bot reacted return + if (user.bot) return; + + // getting the member of the server who reacted + let member = reaction.message.guild.members.cache.find(member => member.id === user.id) + + // adds the role to the member! + member.roles.add(reactRole.id) + }) + } +} \ No newline at end of file diff --git "a/commands/\360\237\224\250 _ Moderation/removerole.js" "b/commands/\360\237\224\250 _ Moderation/removerole.js" new file mode 100644 index 0000000..25c529b --- /dev/null +++ "b/commands/\360\237\224\250 _ Moderation/removerole.js" @@ -0,0 +1,34 @@ +const { MessageEmbed } = require('discord.js') + +module.exports = { + name: "removerole", + aliases: ["rmrole", "-role"], + category: "moderation", + description: "Remove role from any user", + run: async (client, message, args) => { + + let target = message.mentions.members.first(); + + if(!target) return message.reply(`I am unable to find the user`) + + let rrole = message.mentions.roles.first(); + + if(!rrole) return message.reply(`I am unable to find the role`) + + let ticon = target.user.avatarURL({ dynamic: true, size: 2048 }); + let aicon = message.author.avatarURL({ dynamic: true, size: 2048 }); + + const embed = new MessageEmbed() + .setAuthor(target.user.username, ticon) + .setThumbnail(target.user.displayAvatarURL({ dynamic: true })) + .setColor("RANDOM") + .setDescription(`${rrole} role removed from ${target}`) + .setFooter(`Role added by ${message.author.username}`, aicon) + .setTimestamp() + + await message.channel.send(embed) + + target.roles.remove(rrole) + + } +} \ No newline at end of file diff --git "a/commands/\360\237\224\250 _ Moderation/resetwarn.js" "b/commands/\360\237\224\250 _ Moderation/resetwarn.js" new file mode 100644 index 0000000..93b67e5 --- /dev/null +++ "b/commands/\360\237\224\250 _ Moderation/resetwarn.js" @@ -0,0 +1,48 @@ +const db = require("quick.db"); +const discord = require("discord.js") + +module.exports = { + name: "resetwarns", + aliases: ["rwarns", "rsetwarns", "reswarns"], + category: "moderation", + usage: "rwarns <@user>", + description: "Reset warnings of mentioned person", + run: async (client, message, args) => { + if (!message.member.hasPermission("ADMINISTRATOR")) { + const resperms = new discord.MessageEmbed() + .setTitle("Reset-Warns") + .setDescription("You dont' have enough permission to use this command! missing perms: `ADMINISTRATOR`") + .setColor("RED") + .setTimestamp() + return message.channel.send("You dont' have enough permission to use this command! missing perms: `ADMINISTRATOR`"); + } + + const user = message.mentions.members.first(); + + if (!user) { + return message.channel.send("Please mention the person whose warning you want to reset"); + } + + if (message.mentions.users.first().bot) { + return message.channel.send("Bot are not allowed to have warnings"); + } + + if (message.author.id === user.id) { + return message.channel.send("You are not allowed to reset your warnings"); + } + + let warnings = db.get(`warnings_${message.guild.id}_${user.id}`); + + if (warnings === null) { + return message.channel.send(`${message.mentions.users.first().username} do not have any warnings!`); + } + + db.delete(`warnings_${message.guild.id}_${user.id}`); + user.send( + `Your all warnings are reseted by ${message.author.username} from ${message.guild.name}` + ); + await message.channel.send( + `Reseted all warnings of ${message.mentions.users.first().username}` + ); + } +}; diff --git "a/commands/\360\237\224\250 _ Moderation/reswarns.js" "b/commands/\360\237\224\250 _ Moderation/reswarns.js" new file mode 100644 index 0000000..ac81045 --- /dev/null +++ "b/commands/\360\237\224\250 _ Moderation/reswarns.js" @@ -0,0 +1,44 @@ +const db = require("quick.db"); + +module.exports = { + name: "resetwarns", + aliases: ["rwarns", "rsetwarns"], + category: "moderation", + usage: "rwarns <@user>", + description: "Reset warnings of mentioned person", + run: async (client, message, args) => { + if (!message.member.hasPermission("ADMINISTRATOR")) { + return message.channel.send( + "Yopu should have admin perms to use this command" + ); + } + + const user = message.mentions.members.first(); + + if (!user) { + return message.channel.send("Please mention the person whose warning you want to reset"); + } + + if (message.mentions.users.first().bot) { + return message.channel.send("Bot are not allowed to have warnings"); + } + + if (message.author.id === user.id) { + return message.channel.send("You are not allowed to reset your warnings"); + } + + let warnings = db.get(`warnings_${message.guild.id}_${user.id}`); + + if (warnings === null) { + return message.channel.send(`${message.mentions.users.first().username} do not have any warnings`); + } + + db.delete(`warnings_${message.guild.id}_${user.id}`); + user.send( + `Your all warnings are reseted by ${message.author.username} from ${message.guild.name}` + ); + await message.channel.send( + `Reseted all warnings of ${message.mentions.users.first().username}` + ); + } +}; \ No newline at end of file diff --git "a/commands/\360\237\224\250 _ Moderation/setprefix.js" "b/commands/\360\237\224\250 _ Moderation/setprefix.js" new file mode 100644 index 0000000..1a4c40b --- /dev/null +++ "b/commands/\360\237\224\250 _ Moderation/setprefix.js" @@ -0,0 +1,50 @@ +const db = require("quick.db") +const { default_prefix } = require("../../config.json") +const sendError = require('../../mores/error') +const { MessageEmbed } = require('discord.js') + +module.exports = { + name: "setprefix", + category: "moderation", + usage: "prefix [NEW_PREFIX]", + description: "Change the guild prefix", + run: async (client, message, args) => { + //PERMISSION + if(!message.member.hasPermission("ADMINISTRATOR")) { + return sendError("**You are not allowed or do not have permission to change prefix, missing perms: `ADMINISTRATOR`**", message.channel) + } + + if(!args[0]) { + return sendError("**Please give the prefix that you want to set**", message.channel) + } + + if(args[1]) { + return sendError("**You can not set prefix a double argument**", message.channel) + } + + if(args[0].length > 3) { + return sendError("**You Cannot Set A Prefix More Than 3 Arguments!**", message.channel) + } + + if(args.join("") === default_prefix) { + let reseted = new MessageEmbed() + .setTitle("Success!") + .setDescription(`Prefix was resseted! | Back To \`${default_prefix}\``) + .setColor("GREEN") + .setThumbnail(message.author.displayAvatarURL({ dynamic: true })) + .setFooter(`Requested By ${message.author.username}`); + db.delete(`prefix_${message.guild.id}`) + return await message.channel.send(reseted) + } + + db.set(`prefix_${message.guild.id}`, args[0]) + let doneembed = new MessageEmbed() + .setTitle("Success!") + .setDescription(`Setted Server Bot Prefix to \`${args[0]}\``) + .setColor("GREEN") + .setThumbnail(message.author.displayAvatarURL({ dynamic: true })) + .setFooter(`Requested By ${message.author.username}`) + await message.channel.send(doneembed) + + } +} \ No newline at end of file diff --git "a/commands/\360\237\224\250 _ Moderation/silentban.js" "b/commands/\360\237\224\250 _ Moderation/silentban.js" new file mode 100644 index 0000000..9797de1 --- /dev/null +++ "b/commands/\360\237\224\250 _ Moderation/silentban.js" @@ -0,0 +1,27 @@ +const db = require("quick.db") +const { MessageEmbed } = require("discord.js"); +const { measureMemory } = require("vm"); + +module.exports = { + name: "silentban", + description: "Ban a user without him knowing", + category: "moderation", + run: async(bot, message, args) => { + + if(!message.channel.permissionsFor(message.member).has("BAN_MEMBERS") && !ownerID.includes(message.author.id)) return; + + const target = message.mentions.members.first() || message.guild.members.cache.get(args[0]); + if (!target) return message.reply(`Please specify a user!`); + + const reason = args.splice(1, args.length).join(' '); + + try { + message.guild.members.ban(target, {reason: reason.length < 1 ? 'No Reason': reason}); + const embed2 = new MessageEmbed() + .setColor("GREEN") + .setDescription("**They were successfully banned. User was not notified!**"); + await message.channel.send(embed2); + + } catch (error) { console.log(error)} + } +} \ No newline at end of file diff --git "a/commands/\360\237\224\250 _ Moderation/slowmode.js" "b/commands/\360\237\224\250 _ Moderation/slowmode.js" new file mode 100644 index 0000000..9d5a613 --- /dev/null +++ "b/commands/\360\237\224\250 _ Moderation/slowmode.js" @@ -0,0 +1,48 @@ +module.exports = { + name: "slowmode", + category: "moderation", + description: "Lets you set slowmode on the channel.", + args: true, + usage: "