├── Procfile ├── .gitignore ├── lib ├── index.d.ts ├── index.js ├── Locale.d.ts └── Locale.js ├── src ├── utils │ ├── index.js │ ├── plugins │ │ ├── renderEmoji.js │ │ ├── convertAbbrev.js │ │ └── abbrev.js │ ├── Util.js │ ├── Emojis.js │ └── Files.js ├── languages │ ├── en-US │ │ └── commands.json │ └── pt-BR │ │ └── commands.json ├── assets │ ├── fonts │ │ ├── Segoe UI.ttf │ │ ├── Segoe Print.ttf │ │ ├── Montserrat-Black.ttf │ │ └── Segoe UI Black.ttf │ └── img │ │ ├── jpeg │ │ ├── background.jpg │ │ └── Work_Template.png │ │ └── png │ │ ├── Profile_Card.png │ │ ├── Profile_Card_Green.png │ │ ├── Profile_Card_Purple.png │ │ └── Profile_Card_Different.png ├── loaders │ └── Modules.js ├── structures │ ├── Command.js │ └── ClientEmbed.js ├── database │ ├── Schemas │ │ ├── Command.js │ │ ├── Client.js │ │ ├── Guild.js │ │ └── User.js │ └── index.js ├── commands │ ├── Owner │ │ ├── FKASKFSAOFKASo │ │ │ └── cmd.js │ │ ├── say.js │ │ ├── eval.js │ │ ├── test.js │ │ ├── reload.js │ │ ├── blacklist.js │ │ ├── shards.js │ │ ├── manu.js │ │ └── vip.js │ ├── Information │ │ ├── ping.js │ │ ├── avatar.js │ │ ├── rank.js │ │ ├── xp.js │ │ ├── botinfo.js │ │ ├── serverinfo.js │ │ └── help.js │ ├── Minecraft │ │ ├── mcbody.js │ │ ├── mchead.js │ │ ├── mcskin.js │ │ ├── mcbust.js │ │ ├── mchelm.js │ │ ├── mcplayer.js │ │ └── mcserver.js │ ├── Fun │ │ ├── hug.js │ │ ├── kiss.js │ │ ├── wedding.js │ │ ├── divorce.js │ │ └── marry.js │ ├── Music │ │ ├── stop.js │ │ ├── skip.js │ │ ├── nowplaying.js │ │ ├── queue.js │ │ └── play.js │ ├── Utils │ │ └── translate.js │ ├── Moderation │ │ ├── sayEmbed.js │ │ ├── unmute.js │ │ ├── clear.js │ │ ├── ban.js │ │ └── kick.js │ ├── Miscellaneous │ │ ├── about.js │ │ ├── inventory.js │ │ ├── ship.js │ │ ├── reps.js │ │ ├── rep.js │ │ ├── shop.js │ │ ├── sugestion.js │ │ ├── upvote.js │ │ ├── anime.js │ │ └── infoCall.js │ ├── Economy │ │ ├── Work │ │ │ └── name.js │ │ ├── coins.js │ │ ├── rankcoins.js │ │ ├── daily.js │ │ ├── deposit.js │ │ ├── withdraw.js │ │ ├── steal.js │ │ ├── work.js │ │ └── pay.js │ ├── Config │ │ ├── createCall │ │ │ ├── status.js │ │ │ ├── info.js │ │ │ └── set.js │ │ ├── prefix.js │ │ ├── lang.js │ │ ├── createCall.js │ │ ├── notification.js │ │ ├── antifake.js │ │ ├── logs.js │ │ └── contador.js │ └── Registrador │ │ └── registrar.js ├── modules │ ├── AntInvite.js │ ├── VipUtils.js │ ├── MuteUtils.js │ └── ReminderUtils.js ├── services │ └── Collection.js └── client │ └── listeningIn │ ├── guildMemberRemove.js │ ├── guildDelete.js │ ├── interactionCreate.js │ ├── messageDelete.js │ ├── channelDelete.js │ ├── guildCreate.js │ ├── messageUpdate.js │ └── guildMemberAdd.js ├── index.js ├── ClientSharding.js ├── .env.example ├── progressBar.js ├── LICENSE └── package.json /Procfile: -------------------------------------------------------------------------------- 1 | BotTutorialRun: node index.js -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | package-lock/ 3 | .env -------------------------------------------------------------------------------- /lib/index.d.ts: -------------------------------------------------------------------------------- 1 | import Locale from "./Locale"; 2 | export default Locale; 3 | -------------------------------------------------------------------------------- /src/utils/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | Util: require('./Util.js') 3 | } -------------------------------------------------------------------------------- /src/languages/en-US/commands.json: -------------------------------------------------------------------------------- 1 | { 2 | "help": { 3 | "title": "fafassfa" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/assets/fonts/Segoe UI.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leonnardom/Bot-Tutorial/HEAD/src/assets/fonts/Segoe UI.ttf -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | require("dotenv").config(); 2 | 3 | var Index = require("./src/index.js"); 4 | 5 | module.exports = Index; 6 | -------------------------------------------------------------------------------- /src/assets/fonts/Segoe Print.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leonnardom/Bot-Tutorial/HEAD/src/assets/fonts/Segoe Print.ttf -------------------------------------------------------------------------------- /src/assets/img/jpeg/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leonnardom/Bot-Tutorial/HEAD/src/assets/img/jpeg/background.jpg -------------------------------------------------------------------------------- /src/assets/fonts/Montserrat-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leonnardom/Bot-Tutorial/HEAD/src/assets/fonts/Montserrat-Black.ttf -------------------------------------------------------------------------------- /src/assets/fonts/Segoe UI Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leonnardom/Bot-Tutorial/HEAD/src/assets/fonts/Segoe UI Black.ttf -------------------------------------------------------------------------------- /src/assets/img/jpeg/Work_Template.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leonnardom/Bot-Tutorial/HEAD/src/assets/img/jpeg/Work_Template.png -------------------------------------------------------------------------------- /src/assets/img/png/Profile_Card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leonnardom/Bot-Tutorial/HEAD/src/assets/img/png/Profile_Card.png -------------------------------------------------------------------------------- /src/assets/img/png/Profile_Card_Green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leonnardom/Bot-Tutorial/HEAD/src/assets/img/png/Profile_Card_Green.png -------------------------------------------------------------------------------- /src/assets/img/png/Profile_Card_Purple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leonnardom/Bot-Tutorial/HEAD/src/assets/img/png/Profile_Card_Purple.png -------------------------------------------------------------------------------- /src/assets/img/png/Profile_Card_Different.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leonnardom/Bot-Tutorial/HEAD/src/assets/img/png/Profile_Card_Different.png -------------------------------------------------------------------------------- /lib/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const Locale_1 = require("./Locale"); 4 | module.exports = Locale_1; 5 | -------------------------------------------------------------------------------- /ClientSharding.js: -------------------------------------------------------------------------------- 1 | const { ShardingManager } = require("discord.js"), 2 | manager = new ShardingManager(`./index.js`, { 3 | totalShards: 1, 4 | respawn: true, 5 | }); 6 | 7 | manager.spawn(); 8 | -------------------------------------------------------------------------------- /src/utils/plugins/renderEmoji.js: -------------------------------------------------------------------------------- 1 | const emoji = require("node-canvas-with-twemoji-and-discord-emoji"); 2 | 3 | module.exports = async (ctx, message, x, y) => { 4 | return await emoji.fillTextWithTwemoji(ctx, message, x, y); 5 | }; 6 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | TOKEN=TOKEN 2 | EMBED_COLOR=#cc4545 3 | DATABASE_CONNECT=URL MONGODB -> VÊ O PRIMEIRO VÍDEO 4 | GUILD_ID=788318198411558912 5 | CHANNEL_LOGS=797800248948293673 6 | 7 | HOST=LAVALINK_HOST 8 | PORT=LAVALINK_PORT 9 | PASSWORD=LAVALINK_PASSWORD -------------------------------------------------------------------------------- /src/loaders/Modules.js: -------------------------------------------------------------------------------- 1 | const Files = require("../utils/Files"); 2 | 3 | module.exports = new (class Modules { 4 | async load(client) { 5 | return Files.requireDirectory("./src/modules", (Module) => { 6 | new Module(client).run(); 7 | }); 8 | } 9 | })(); 10 | -------------------------------------------------------------------------------- /src/utils/plugins/convertAbbrev.js: -------------------------------------------------------------------------------- 1 | module.exports = (num) => { 2 | if (!num) return "0"; 3 | 4 | const number = parseFloat(num.substr(0, num.length - 1)); 5 | const unit = num.substr(-1); 6 | const zeros = { K: 1e3, k: 1e3, M: 1e6, m: 1e6 }; 7 | 8 | if (!zeros[unit]) return parseFloat(num); 9 | 10 | num = number * zeros[unit]; 11 | 12 | return num; 13 | }; 14 | -------------------------------------------------------------------------------- /src/structures/Command.js: -------------------------------------------------------------------------------- 1 | module.exports = class Command { 2 | constructor(client) { 3 | this.client = client; 4 | 5 | this.name = "Nome"; 6 | this.category = "Categoria"; 7 | this.description = "Descrição"; 8 | this.usage = "Sem Informação"; 9 | this.aliases = []; 10 | 11 | this.enabled = true; 12 | this.guildOnly = true; 13 | this.isSub = false; 14 | } 15 | }; 16 | -------------------------------------------------------------------------------- /src/database/Schemas/Command.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | const Schema = mongoose.Schema; 3 | 4 | let commandSchema = new Schema({ 5 | _id: { type: String }, 6 | usages: { type: Number, default: 0 }, 7 | manutenção: { type: Boolean, default: false }, 8 | reason: { type: String }, 9 | }); 10 | 11 | let Command = mongoose.model("Commands", commandSchema); 12 | module.exports = Command; 13 | -------------------------------------------------------------------------------- /src/structures/ClientEmbed.js: -------------------------------------------------------------------------------- 1 | const Discord = require("discord.js"); 2 | 3 | module.exports = class ClientEmbed extends ( 4 | Discord.MessageEmbed 5 | ) { 6 | constructor(user, data = {}) { 7 | super(data); 8 | this.setTimestamp(); 9 | this.setColor(process.env.EMBED_COLOR); 10 | this.setFooter( 11 | `Pedido por ${user.tag}`, 12 | user.displayAvatarURL({ dynamic: true }) 13 | ); 14 | } 15 | }; 16 | -------------------------------------------------------------------------------- /src/languages/pt-BR/commands.json: -------------------------------------------------------------------------------- 1 | { 2 | "help": { 3 | "title": "Central de Ajuda do Bot - Testando" 4 | }, 5 | "welcome": { 6 | "channel": { 7 | "sucess": "o canal **<#{{canal}}>** foi setado como canal de welcome com sucesso." 8 | } 9 | }, 10 | "deposit": { 11 | "noArgs": "modo correto de utilizar o comando: **{{prefix}}depositar **", 12 | "sucess": "você depositou **{{coins}} coins** com sucesso." 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /lib/Locale.d.ts: -------------------------------------------------------------------------------- 1 | interface Options { 2 | returnUndefined: boolean; 3 | } 4 | export default class Locale { 5 | dir: string; 6 | languages: any; 7 | actualLang: string; 8 | options: Options; 9 | constructor(dir: string); 10 | init(options: Options): Promise<(locale: string, options?: any) => any>; 11 | setLang(lang: string): Promise; 12 | t(locale: string, options?: any): any; 13 | format(locale: string, options: any): any; 14 | } 15 | export {}; 16 | -------------------------------------------------------------------------------- /src/database/Schemas/Client.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | const Schema = mongoose.Schema; 3 | 4 | let clientSchema = new Schema({ 5 | _id: { type: String }, 6 | manutenção: { type: Boolean, default: false }, 7 | reason: { type: String }, 8 | blacklist: { type: Array, default: [] }, 9 | ranks: { 10 | coins: { type: Array, default: [] }, 11 | }, 12 | }); 13 | 14 | let Client = mongoose.model("Client", clientSchema); 15 | module.exports = Client; 16 | -------------------------------------------------------------------------------- /src/utils/Util.js: -------------------------------------------------------------------------------- 1 | const abbrev = require("./plugins/abbrev.js"); 2 | const renderEmoji = require("./plugins/renderEmoji.js"); 3 | const convertAbbrev = require("./plugins/convertAbbrev"); 4 | 5 | module.exports = class Util { 6 | static toAbbrev(num) { 7 | return abbrev(num); 8 | } 9 | 10 | static renderEmoji(ctx, msg, x, y) { 11 | return renderEmoji(ctx, msg, x, y); 12 | } 13 | 14 | static notAbbrev(num) { 15 | return convertAbbrev(num); 16 | } 17 | }; 18 | -------------------------------------------------------------------------------- /src/database/index.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | const c = require("colors"); 3 | 4 | module.exports = { 5 | start() { 6 | try { 7 | mongoose.connect(process.env.DATABASE_CONNECT, { 8 | useNewUrlParser: true, 9 | useUnifiedTopology: true, 10 | useFindAndModify: false, 11 | }); 12 | 13 | console.log(c.red(`[DataBase] - Conectado ao Banco de Dados.`)); 14 | } catch (err) { 15 | if (err) return console.log(c.red(`[DataBase] - ERROR:`, +err)); 16 | } 17 | }, 18 | }; 19 | -------------------------------------------------------------------------------- /progressBar.js: -------------------------------------------------------------------------------- 1 | const porcent = 360 / 100, 2 | porcentTotal = porcent * ((doc.xp / doc.level) * 250 * 100); 3 | 4 | ctx.lineCap = "round"; 5 | 6 | /* Fundo */ 7 | 8 | ctx.beginPath(); 9 | ctx.arc(90, 90, 70, (Math.PI / 180) * 270, (Math.PI / 180) * (270 + 360)); 10 | ctx.strokeStyle = "#b1b1b1"; 11 | ctx.lineWidth = "10"; 12 | ctx.stroke(); 13 | 14 | /* Barra de progresso */ 15 | 16 | ctx.beginPath(); 17 | ctx.strokeStyle = "#3949AB"; 18 | ctx.lineWidth = "10"; 19 | 20 | ctx.arc( 21 | 90, 22 | 90, 23 | 70, 24 | (Math.PI / 180) * 270, 25 | (Math.PI / 180) * (270 + porcentTotal) 26 | ); 27 | ctx.stroke(); 28 | -------------------------------------------------------------------------------- /src/utils/plugins/abbrev.js: -------------------------------------------------------------------------------- 1 | module.exports = (num) => { 2 | if (!num || isNaN(num)) return "0"; 3 | if (typeof num === "string") num = parseInt(num); 4 | let decPlaces = Math.pow(10, 1); 5 | var abbrev = ["K", "M", "B", "T"]; 6 | for (var i = abbrev.length - 1; i >= 0; i--) { 7 | var size = Math.pow(10, (i + 1) * 3); 8 | if (size <= num) { 9 | num = Math.round((num * decPlaces) / size) / decPlaces; 10 | if (num == 1000 && i < abbrev.length - 1) { 11 | num = 1; 12 | i++; 13 | } 14 | num += abbrev[i]; 15 | break; 16 | } 17 | } 18 | return num; 19 | }; 20 | -------------------------------------------------------------------------------- /src/commands/Owner/FKASKFSAOFKASo/cmd.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../../structures/Command"); 2 | 3 | module.exports = class Cmd extends Command { 4 | constructor(client) { 5 | super(client); 6 | this.client = client; 7 | 8 | this.name = "cmd"; 9 | this.category = "Economy"; 10 | this.description = "Comando para trabalhar"; 11 | this.usage = ""; 12 | this.aliases = ["c-m-d"]; 13 | this.reference = "Test"; 14 | 15 | this.enabled = true; 16 | this.guildOnly = true; 17 | this.isSub = true; 18 | } 19 | 20 | async run({ message }) { 21 | message.reply(`subcommand **cmd**`); 22 | } 23 | }; 24 | -------------------------------------------------------------------------------- /src/commands/Information/ping.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | 3 | module.exports = class Ping extends Command { 4 | constructor(client) { 5 | super(client); 6 | this.client = client; 7 | 8 | this.name = "ping"; 9 | this.category = "Information"; 10 | this.description = "Comando para olhar o ping da host do bot"; 11 | this.usage = "ping"; 12 | this.aliases = ["pong"]; 13 | 14 | this.enabled = true; 15 | this.guildOnly = true; 16 | } 17 | 18 | async run({ message, args, prefix, author }, t) { 19 | message.channel 20 | .send(`Ping do Bot: **${this.client.ws.ping}ms**`) 21 | .then((x) => x.delete({ timeout: 5000 })); 22 | } 23 | }; 24 | -------------------------------------------------------------------------------- /src/commands/Owner/say.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | 3 | module.exports = class Say extends Command { 4 | constructor(client) { 5 | super(client); 6 | this.client = client; 7 | 8 | this.name = "say"; 9 | this.category = "Owner"; 10 | this.description = "Comando para fazer o Bot falar"; 11 | this.usage = "eval "; 12 | this.aliases = []; 13 | 14 | this.enabled = true; 15 | this.guildOnly = true; 16 | } 17 | 18 | async run({ message, args, prefix, author }, t) { 19 | const msg = args.join(" "); 20 | 21 | if (!msg) return message.reply(`${message.author}, escreva algo primeiro.`); 22 | 23 | message.channel.send(msg); 24 | 25 | message.delete(); 26 | } 27 | }; 28 | -------------------------------------------------------------------------------- /src/utils/Emojis.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | Errado: "❌", 3 | Certo: "✅", 4 | Bank: "🏦", 5 | Coins: "💵", 6 | Economy: "💰", 7 | Minecraft: "", 8 | Next: "➡️", 9 | Back: "⬅️", 10 | Help: "❔", 11 | Early: "<:ES:848914312810463273>", 12 | Bravery: "<:Bravery:848914312830910544>", 13 | Balance: "<:Balance:848914312843231282>", 14 | Brilliance: "<:Brilliance:848914312789622784>", 15 | Verified_Developer: "<:EVBD:848914312876916776>", 16 | Verified_Bot: "<:BV:848916250847084565>", 17 | Computer: "💻", 18 | Mobile: "📱", 19 | Robot: "🤖", 20 | Thinking: "🤔", 21 | Angry: "😠", 22 | Aki_Cancel: "🔹", 23 | Alianca: "<:aliancas:864915668948221962>", 24 | Owner: "<:crown:864916805176918036>", 25 | Vip: "<:vipcard:864917341091135548>", 26 | }; 27 | -------------------------------------------------------------------------------- /src/commands/Owner/eval.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | 3 | module.exports = class Eval extends Command { 4 | constructor(client) { 5 | super(client); 6 | this.client = client; 7 | 8 | this.name = "eval"; 9 | this.category = "Owner"; 10 | this.description = "Comando para testar códigos"; 11 | this.usage = "eval "; 12 | this.aliases = ["kickar"]; 13 | 14 | this.enabled = true; 15 | this.guildOnly = true; 16 | } 17 | 18 | async run({ message, args, prefix, author }, t) { 19 | if (message.author.id !== "600804786492932101") return; 20 | if (!args[0]) return; 21 | 22 | let litchdelicia = args.join(" "); 23 | let litchtotoso = eval(litchdelicia); 24 | if (typeof litchtotoso !== "string") 25 | litchtotoso = require("util").inspect(litchtotoso, { depth: 0 }); 26 | message.reply( 27 | `Entrada: \`\`\`js\n${litchdelicia}\`\`\`\n Saída: \`\`\`js\n${litchtotoso}\`\`\`` 28 | ); 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /src/commands/Minecraft/mcbody.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | const ClientEmbed = require("../../structures/ClientEmbed"); 3 | const Emojis = require("../../utils/Emojis"); 4 | 5 | module.exports = class McBody extends Command { 6 | constructor(client) { 7 | super(client); 8 | this.client = client; 9 | 10 | this.name = "mcbody"; 11 | this.category = "Minecraft"; 12 | this.description = "Comando para pegar o Body de uma Skin de Minecraft."; 13 | this.usage = "mcbody"; 14 | this.aliases = ["mc-body"]; 15 | 16 | this.enabled = true; 17 | this.guildOnly = true; 18 | } 19 | 20 | async run({ message, args, prefix, author }, t) { 21 | const nick = args[0]; 22 | 23 | if (!nick) 24 | return message.reply( 25 | `${message.author}, você deve inserir um nick de uma skin de minecraft.` 26 | ); 27 | 28 | const EMBED = new ClientEmbed(author) 29 | 30 | .setTitle(`${Emojis.Minecraft} - Nick: ${nick}`) 31 | .setImage(`https://mc-heads.net/body/${nick}`); 32 | 33 | message.reply({embeds: [EMBED]}); 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /src/commands/Minecraft/mchead.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | const ClientEmbed = require("../../structures/ClientEmbed"); 3 | const Emojis = require("../../utils/Emojis"); 4 | 5 | module.exports = class McHead extends Command { 6 | constructor(client) { 7 | super(client); 8 | this.client = client; 9 | 10 | this.name = "mchead"; 11 | this.category = "Minecraft"; 12 | this.description = "Comando para pegar o Head de uma Skin de Minecraft."; 13 | this.usage = "mchead"; 14 | this.aliases = ["mc-head"]; 15 | 16 | this.enabled = true; 17 | this.guildOnly = true; 18 | } 19 | 20 | async run({ message, args, prefix, author }, t) { 21 | const nick = args[0]; 22 | 23 | if (!nick) 24 | return message.reply( 25 | `${message.author}, você deve inserir um nick de uma skin de minecraft.` 26 | ); 27 | 28 | const EMBED = new ClientEmbed(author) 29 | 30 | .setTitle(`${Emojis.Minecraft} - Nick: ${nick}`) 31 | .setImage(`https://mc-heads.net/head/${nick}/200`); 32 | 33 | message.reply({embeds: [EMBED]}); 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /src/commands/Minecraft/mcskin.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | const ClientEmbed = require("../../structures/ClientEmbed"); 3 | const Emojis = require("../../utils/Emojis"); 4 | 5 | module.exports = class McSkin extends Command { 6 | constructor(client) { 7 | super(client); 8 | this.client = client; 9 | 10 | this.name = "mcskin"; 11 | this.category = "Minecraft"; 12 | this.description = "Comando para pegar o Skin de uma Skin de Minecraft."; 13 | this.usage = "mcskin"; 14 | this.aliases = ["mc-skin"]; 15 | 16 | this.enabled = true; 17 | this.guildOnly = true; 18 | } 19 | 20 | async run({ message, args, prefix, author }, t) { 21 | const nick = args[0]; 22 | 23 | if (!nick) 24 | return message.reply( 25 | `${message.author}, você deve inserir um nick de uma skin de minecraft.` 26 | ); 27 | 28 | const EMBED = new ClientEmbed(author) 29 | 30 | .setTitle(`${Emojis.Minecraft} - Nick: ${nick}`) 31 | .setImage(`https://mc-heads.net/body/${nick}/300`); 32 | 33 | message.reply({embeds: [EMBED]}); 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /src/commands/Minecraft/mcbust.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | const ClientEmbed = require("../../structures/ClientEmbed"); 3 | const Emojis = require("../../utils/Emojis"); 4 | 5 | module.exports = class McBust extends Command { 6 | constructor(client) { 7 | super(client); 8 | this.client = client; 9 | 10 | this.name = "mcbust"; 11 | this.category = "Minecraft"; 12 | this.description = "Comando para pegar o Bust de uma Skin de Minecraft."; 13 | this.usage = "mcbust"; 14 | this.aliases = ["mc-bust"]; 15 | 16 | this.enabled = true; 17 | this.guildOnly = true; 18 | } 19 | 20 | async run({ message, args, prefix, author }, t) { 21 | const nick = args[0]; 22 | 23 | if (!nick) 24 | return message.reply( 25 | `${message.author}, você deve inserir um nick de uma skin de minecraft.` 26 | ); 27 | 28 | const EMBED = new ClientEmbed(author) 29 | 30 | .setTitle(`${Emojis.Minecraft} - Nick: ${nick}`) 31 | .setImage(`https://minotar.net/bust/${nick}/200.png`); 32 | 33 | message.reply({embeds: [EMBED]}); 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /src/commands/Minecraft/mchelm.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | const ClientEmbed = require("../../structures/ClientEmbed"); 3 | const Emojis = require("../../utils/Emojis"); 4 | 5 | module.exports = class Mchelm extends Command { 6 | constructor(client) { 7 | super(client); 8 | this.client = client; 9 | 10 | this.name = "mchelm"; 11 | this.category = "Minecraft"; 12 | this.description = "Comando para pegar o Helm de uma Skin de Minecraft."; 13 | this.usage = "mchelm"; 14 | this.aliases = ["mc-helm"]; 15 | 16 | this.enabled = true; 17 | this.guildOnly = true; 18 | } 19 | 20 | async run({ message, args, prefix, author }, t) { 21 | const nick = args[0]; 22 | 23 | if (!nick) 24 | return message.reply( 25 | `${message.author}, você deve inserir um nick de uma skin de minecraft.` 26 | ); 27 | 28 | const EMBED = new ClientEmbed(author) 29 | 30 | .setTitle(`${Emojis.Minecraft} - Nick: ${nick}`) 31 | .setImage(`https://minotar.net/helm/${nick}/200.png`); 32 | 33 | message.reply({embeds: [EMBED]}); 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /src/commands/Minecraft/mcplayer.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | const ClientEmbed = require("../../structures/ClientEmbed"); 3 | const Emojis = require("../../utils/Emojis"); 4 | 5 | module.exports = class McPlayer extends Command { 6 | constructor(client) { 7 | super(client); 8 | this.client = client; 9 | 10 | this.name = "mcplayer"; 11 | this.category = "Minecraft"; 12 | this.description = "Comando para pegar a Skin de uma Skin de Minecraft."; 13 | this.usage = "mcplayer"; 14 | this.aliases = ["mc-player"]; 15 | 16 | this.enabled = true; 17 | this.guildOnly = true; 18 | } 19 | 20 | async run({ message, args, prefix, author }, t) { 21 | const nick = args[0]; 22 | 23 | if (!nick) 24 | return message.reply( 25 | `${message.author}, você deve inserir um nick de uma skin de minecraft.` 26 | ); 27 | 28 | const EMBED = new ClientEmbed(author) 29 | 30 | .setTitle(`${Emojis.Minecraft} - Nick: ${nick}`) 31 | .setImage(`https://mc-heads.net/player/${nick}`); 32 | 33 | message.reply({embeds: [EMBED]}); 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Bot-Tutorial 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tutorial", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "ClientSharding.js", 6 | "dependencies": { 7 | "@iamtraction/google-translate": "^1.1.2", 8 | "aki-api": "^5.2.1", 9 | "ascii-table": "0.0.9", 10 | "axios": "^0.21.1", 11 | "canvacord": "^5.0.8", 12 | "canvas": "^2.6.1", 13 | "colors": "^1.4.0", 14 | "discord-tictactoe": "^2.0.7", 15 | "discord.js": "^13.0.1", 16 | "dotenv": "^8.2.0", 17 | "erela.js": "^2.3.3", 18 | "erela.js-spotify": "^1.2.0", 19 | "fs": "0.0.1-security", 20 | "gamedig": "^2.0.24", 21 | "klaw": "^3.0.0", 22 | "mal-scraper": "^2.11.3", 23 | "moment": "^2.29.1", 24 | "moment-duration-format": "^2.3.2", 25 | "mongoose": "^5.11.8", 26 | "ms": "^2.1.3", 27 | "node-canvas-with-twemoji-and-discord-emoji": "^1.1.8", 28 | "node-fetch": "^2.6.1", 29 | "parse-duration": "^1.0.0", 30 | "parse-ms": "^2.1.0", 31 | "path": "^0.12.7", 32 | "rss-parser": "^3.12.0", 33 | "simple-youtube-api": "^5.2.1" 34 | }, 35 | "scripts": { 36 | "test": "echo \"Error: no test specified\" && exit 1" 37 | }, 38 | "keywords": [], 39 | "author": "zSpl1nterUS_#6455", 40 | "license": "ISC" 41 | } 42 | -------------------------------------------------------------------------------- /src/commands/Fun/hug.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | const ClientEmbed = require("../../structures/ClientEmbed"); 3 | const fetch = require("node-fetch"); 4 | 5 | module.exports = class Hug extends Command { 6 | constructor(client) { 7 | super(client); 8 | this.client = client; 9 | 10 | this.name = "hug"; 11 | this.category = "Fun"; 12 | this.description = "Comando para abraçar outros membros."; 13 | this.usage = "hug "; 14 | this.aliases = ["abraço"]; 15 | 16 | this.enabled = true; 17 | this.guildOnly = true; 18 | } 19 | 20 | async run({ message, args, prefix, author }, t) { 21 | const user = 22 | this.client.users.cache.get(args[0]) || message.mentions.users.first(); 23 | 24 | if (!user) 25 | return message.reply( 26 | `${message.author}, você deve mencionar quem deseja abraçar primeiro.` 27 | ); 28 | 29 | const body = await fetch("https://nekos.life/api/v2/img/hug").then((res) => 30 | res.json() 31 | ); 32 | 33 | const EMBED = new ClientEmbed(author) 34 | .setImage(body.url) 35 | .setDescription(`${message.author} deu um abraço no(a) ${user}`); 36 | 37 | message.reply({embeds: [EMBED]}) 38 | } 39 | }; 40 | -------------------------------------------------------------------------------- /src/commands/Fun/kiss.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | const ClientEmbed = require("../../structures/ClientEmbed"); 3 | const fetch = require("node-fetch"); 4 | 5 | module.exports = class Kiss extends Command { 6 | constructor(client) { 7 | super(client); 8 | this.client = client; 9 | 10 | this.name = "kiss"; 11 | this.category = "Fun"; 12 | this.description = "Comando para beijar outros membros."; 13 | this.usage = "kiss "; 14 | this.aliases = ["beijar"]; 15 | 16 | this.enabled = true; 17 | this.guildOnly = true; 18 | } 19 | 20 | async run({ message, args, prefix, author }, t) { 21 | const user = 22 | this.client.users.cache.get(args[0]) || message.mentions.users.first(); 23 | 24 | if (!user) 25 | return message.reply( 26 | `${message.author}, você deve mencionar quem deseja abraçar primeiro.` 27 | ); 28 | 29 | const body = await fetch("https://nekos.life/api/v2/img/kiss").then((res) => 30 | res.json() 31 | ); 32 | 33 | const EMBED = new ClientEmbed(author) 34 | .setImage(body.url) 35 | .setDescription(`${message.author} deu um beijo no(a) ${user}`); 36 | 37 | message.reply({embeds: [EMBED]}) 38 | } 39 | }; 40 | -------------------------------------------------------------------------------- /src/commands/Information/avatar.js: -------------------------------------------------------------------------------- 1 | const User = require("../../database/Schemas/User"); 2 | const Command = require("../../structures/Command"); 3 | const ClientEmbed = require("../../structures/ClientEmbed"); 4 | const moment = require("moment"); 5 | require("moment-duration-format"); 6 | 7 | module.exports = class Avatar extends Command { 8 | constructor(client) { 9 | super(client); 10 | this.client = client; 11 | 12 | this.name = "avatar"; 13 | this.category = "Information"; 14 | this.description = "Comando para olhar o avatar do membro."; 15 | this.usage = "avatar [user]"; 16 | this.aliases = ["logo"]; 17 | 18 | this.enabled = true; 19 | this.guildOnly = true; 20 | } 21 | 22 | async run({ message, args, prefix, author }, t) { 23 | const user = 24 | this.client.users.cache.get(args[0]) || 25 | message.mentions.users.first() || 26 | message.author; 27 | 28 | const avatar = user.displayAvatarURL({ 29 | dynamic: true, 30 | format: "jpg", 31 | size: 2048, 32 | }); 33 | 34 | const EMBED = new ClientEmbed(author) 35 | 36 | .setTitle(user.username) 37 | .setDescription(`Clique **[aqui](${avatar})** para baixar o avatar.`) 38 | .setImage(avatar); 39 | 40 | message.reply({embeds: [EMBED]}) 41 | } 42 | }; 43 | -------------------------------------------------------------------------------- /src/utils/Files.js: -------------------------------------------------------------------------------- 1 | const fs = require("fs"); 2 | const path = require("path"); 3 | const { promisify } = require("util"); 4 | 5 | module.exports = class Files { 6 | static async requireDirectory(dirPath, sucess, error, recursive = true) { 7 | const files = await Files.readdir(dirPath); 8 | const filesObject = {}; 9 | return Promise.all( 10 | files.map(async (file) => { 11 | const fullPath = path.resolve(dirPath, file); 12 | if (file.match(/\.(js|json)$/)) { 13 | try { 14 | const required = require(fullPath); 15 | if (sucess) await sucess(required); 16 | filesObject[file] = required; 17 | return required; 18 | } catch (e) { 19 | console.log(e); 20 | } 21 | } else if (recursive) { 22 | const isDirectory = await Files.stat(fullPath).then((x) => 23 | x.isDirectory() 24 | ); 25 | 26 | if (isDirectory) { 27 | return files.requireDirectory(fullPath, sucess, error); 28 | } 29 | } 30 | }) 31 | ) 32 | .then(() => filesObject) 33 | .catch(console.error); 34 | } 35 | }; 36 | 37 | module.exports.readdir = promisify(fs.readdir); 38 | module.exports.readFile = promisify(fs.readFile); 39 | module.exports.stat = promisify(fs.stat); 40 | -------------------------------------------------------------------------------- /src/modules/AntInvite.js: -------------------------------------------------------------------------------- 1 | module.exports = class AntInvite { 2 | constructor(client) { 3 | this.client = client; 4 | } 5 | 6 | async run() { 7 | this.client.on("messageCreate", async (message) => { 8 | const doc = await this.client.database.guilds.findOne({ 9 | idS: message.guild.id, 10 | }); 11 | return; 12 | 13 | const regex = 14 | /(https?:\/\/)?(www\.)?(discord\.(gg|io|me|li)|(discord|discordapp)\.com\/invite)\/.+[a-z]/g; 15 | 16 | if (!regex.test(message.content)) return; 17 | 18 | const channels = doc.antinvite.channels.some( 19 | (x) => x === message.channel.id 20 | ); 21 | const roles = doc.antinvite.roles.some((x) => 22 | message.member.roles.cache.has(x) 23 | ); 24 | 25 | if ( 26 | !message.member.permissions.has("ADMINISTRATOR") && 27 | !channels && 28 | !roles 29 | ) 30 | return message.channel 31 | .send( 32 | doc.antinvite.msg === "null" 33 | ? `${message.author}, você não pode divulgar neste canal.` 34 | : doc.antinvite.msg 35 | .replace(/{user}/g, message.author) 36 | .replace(/{channel}/g, message.channel) 37 | ) 38 | .then(() => { 39 | return message.delete(); 40 | }); 41 | }); 42 | } 43 | }; 44 | -------------------------------------------------------------------------------- /src/commands/Music/stop.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | 3 | module.exports = class Stop extends Command { 4 | constructor(client) { 5 | super(client); 6 | this.client = client; 7 | 8 | this.name = "stop"; 9 | this.category = "Music"; 10 | this.description = "Comando para ver a lista de próximas músicas.."; 11 | this.usage = "stop"; 12 | this.aliases = ["parar"]; 13 | 14 | this.enabled = true; 15 | this.guildOnly = true; 16 | } 17 | 18 | async run({ message, args, author }) { 19 | const player = this.client.music.players.get(message.guild.id); 20 | 21 | if (!player) 22 | return message.reply( 23 | `${message.author}, não estou tocando música neste servidor.` 24 | ); 25 | 26 | if ( 27 | !message.member.voice.channel || 28 | message.member.voice.channel.id != message.guild.me.voice.channel.id 29 | ) 30 | return message.reply( 31 | `${message.author}, você não está em um canal de voz ou não está no mesmo canal que eu.` 32 | ); 33 | 34 | if (message.member.voice.selfDeaf) 35 | return message.reply( 36 | `${message.author}, você não pode parar a música estando com o aúdio desativado.` 37 | ); 38 | 39 | const stop = () => { 40 | message.react("👍"); 41 | player.destroy(); 42 | }; 43 | 44 | stop(); 45 | } 46 | }; 47 | -------------------------------------------------------------------------------- /src/commands/Utils/translate.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | const translate = require("@iamtraction/google-translate"); 3 | 4 | module.exports = class Translate extends Command { 5 | constructor(client) { 6 | super(client); 7 | this.client = client; 8 | 9 | this.name = "translate"; 10 | this.category = "Utils"; 11 | this.description = "Comando para traduzir frases."; 12 | this.usage = "translate "; 13 | this.aliases = ["traduzir"]; 14 | 15 | this.enabled = true; 16 | this.guildOnly = true; 17 | } 18 | 19 | async run({ message, args, prefix, author }, t) { 20 | const text = args.slice(1).join(" "); 21 | 22 | if (!text) 23 | return message.reply( 24 | `${message.author}, insira o que você deseja traduzir primeiro.` 25 | ); 26 | 27 | try { 28 | const trad = await translate(text, { 29 | to: args[0], 30 | }); 31 | 32 | message.reply( 33 | `${message.author}\n\n${trad.text ? trad.text : ""}` 34 | ); 35 | } catch (err) { 36 | console.log(err); 37 | if (err) 38 | if ( 39 | err.message.startsWith("The language") && 40 | err.message.endsWith("is not supported.") 41 | ) 42 | return message.reply( 43 | `${message.author}, linguagem não suportada.` 44 | ); 45 | } 46 | } 47 | }; 48 | -------------------------------------------------------------------------------- /src/commands/Moderation/sayEmbed.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | const ClientEmbed = require("../../structures/ClientEmbed"); 3 | 4 | module.exports = class SayEmbed extends Command { 5 | constructor(client) { 6 | super(client); 7 | this.client = client; 8 | 9 | this.name = "sayembed"; 10 | this.category = "Moderation"; 11 | this.description = "Comando para mandar uma mensagem pelo bot em embed"; 12 | this.usage = "sayembed "; 13 | this.aliases = ["say-embed", "s-embed", "say-e", "s-e"]; 14 | 15 | this.enabled = true; 16 | this.guildOnly = true; 17 | } 18 | 19 | async run({ message, args, prefix, author }, t) { 20 | if (!message.member.permissions.has("MANAGE_MESSAGES")) 21 | return message.reply( 22 | `${message.author}, você precisa da permissão de gerenciar mensagens para executar este comando.` 23 | ); 24 | 25 | const msg = args.join(" "); 26 | 27 | if (!msg) 28 | return message.reply( 29 | `${message.author}, você deve inserir o que deseja anunciar primeiro.` 30 | ); 31 | 32 | const EMBED = new ClientEmbed(author) 33 | .setDescription(msg) 34 | .setFooter( 35 | `Mensagem Enviada por ${message.author.tag}`, 36 | message.author.displayAvatarURL({ dynamic: true }) 37 | ); 38 | 39 | message.reply({embeds: [EMBED]}); 40 | } 41 | }; 42 | -------------------------------------------------------------------------------- /src/commands/Miscellaneous/about.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | 3 | module.exports = class About extends Command { 4 | constructor(client) { 5 | super(client); 6 | this.client = client; 7 | 8 | this.name = "about"; 9 | this.category = "Miscellaneous"; 10 | this.description = "Troque o sobre do seu perfil"; 11 | this.usage = "about "; 12 | this.aliases = ["sobremim", "sobre"]; 13 | 14 | this.enabled = true; 15 | this.guildOnly = true; 16 | } 17 | 18 | async run({ message, args, prefix, author }, t) { 19 | const about = args.join(" "); 20 | const doc = await this.client.database.users.findOne({ idU: message.author.id }); 21 | 22 | if (!about) 23 | return message.reply( 24 | `${message.author}, você não inseriu o que deseja colocar no seu sobre.` 25 | ); 26 | if (about.length > 300) 27 | return message.reply( 28 | `${message.author}, o seu sobre deve ter menos de 300 caracteres.` 29 | ); 30 | if (doc.about == about) 31 | return message.reply( 32 | `${message.author}, o sobre que você inseriu é o mesmo setado atualmente.` 33 | ); 34 | 35 | message.reply( 36 | `${message.author}, seu sobre foi alterado com sucesso.` 37 | ); 38 | await this.client.database.users.findOneAndUpdate( 39 | { idU: message.author.id }, 40 | { $set: { about: about } } 41 | ); 42 | } 43 | }; 44 | -------------------------------------------------------------------------------- /src/commands/Miscellaneous/inventory.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | const Utils = require("../../utils/Util"); 3 | const User = require("../../database/Schemas/User"); 4 | const ClientEmbed = require("../../structures/ClientEmbed"); 5 | 6 | module.exports = class Inventory extends Command { 7 | constructor(client) { 8 | super(client); 9 | this.client = client; 10 | 11 | this.name = "inventory"; 12 | this.category = "Miscellaneous"; 13 | this.description = "Veja seu perfil com este comando"; 14 | this.usage = "inventory"; 15 | this.aliases = ["inventário", "inv"]; 16 | 17 | this.enabled = true; 18 | this.guildOnly = true; 19 | } 20 | 21 | async run({ message, args, prefix, author }, t) { 22 | const user = await User.findOne({ idU: message.author.id }).then((x) => 23 | Object.entries(x.shop.itens) 24 | ); 25 | 26 | const list = user.filter(([, x]) => x.size >= 1); 27 | 28 | const test = list.sort((x, f) => f[1].id - x[1].id); 29 | 30 | const EMBED = new ClientEmbed(author).setDescription( 31 | test 32 | .map( 33 | ([_, value]) => 34 | `${value.emoji} **${value.name}** - ID: \`${ 35 | value.id 36 | }\`\nPreço: **${Utils.toAbbrev( 37 | value.price 38 | )}** - Quantia que você tem: **\`${value.size}\`**` 39 | ) 40 | .join("\n\n") 41 | ); 42 | 43 | message.reply({embeds: [EMBED]}) 44 | } 45 | }; 46 | -------------------------------------------------------------------------------- /src/modules/VipUtils.js: -------------------------------------------------------------------------------- 1 | const ClientEmbed = require("../structures/ClientEmbed"); 2 | 3 | module.exports = class { 4 | constructor(client) { 5 | this.client = client; 6 | } 7 | 8 | async run() { 9 | this.client.on("ready", async () => { 10 | await this.VipFilter(); 11 | }); 12 | } 13 | async VipFilter() { 14 | setInterval(async () => { 15 | const list_vips = await require("mongoose") 16 | .connection.collection("users") 17 | .find({ "vip.date": { $gt: 1 } }) 18 | .toArray(); 19 | 20 | const filter_members = Object.entries(list_vips).filter( 21 | ([, x]) => x.vip.date <= Date.now() 22 | ); 23 | 24 | const VIPS = filter_members.map(([, x]) => x.idU); 25 | 26 | await this.VipRemove(VIPS); 27 | }, 60000); 28 | } 29 | 30 | async VipRemove(VIPS) { 31 | let totalPessoas = VIPS.length; 32 | let size = 0; 33 | 34 | const interval = setInterval(async () => { 35 | if (totalPessoas <= 0) clearInterval(interval); 36 | else { 37 | let members = VIPS[size++]; 38 | 39 | const user = await this.client.users.fetch(members); 40 | 41 | //const doc = await this.client.database.users.findOne({id: user.id}) 42 | 43 | await this.client.database.users.findOneAndUpdate( 44 | { idU: user.id }, 45 | { $set: { "vip.date": 0, "vip.hasVip": false } } 46 | ); 47 | } 48 | 49 | totalPessoas--; 50 | }, 5000); 51 | } 52 | }; 53 | -------------------------------------------------------------------------------- /src/services/Collection.js: -------------------------------------------------------------------------------- 1 | module.exports = class Collection { 2 | constructor() { 3 | this.collection = []; 4 | } 5 | 6 | length() { 7 | return this.collection.length; 8 | } 9 | 10 | log() { 11 | return console.log(this.collection); 12 | } 13 | 14 | push(value) { 15 | return this.collection.push(value); 16 | } 17 | 18 | pushAll(...values) { 19 | return this.collection.push(...values); 20 | } 21 | 22 | pop() { 23 | return this.collection.pop(); 24 | } 25 | 26 | shift() { 27 | return this.collection.shift(); 28 | } 29 | 30 | unshift(value) { 31 | return this.collection.unshift(value); 32 | } 33 | 34 | unshiftAll(...values) { 35 | return this.collection.unshift(...values); 36 | } 37 | 38 | remove(index) { 39 | return this.collection.splice(index, 1); 40 | } 41 | 42 | add(index, value) { 43 | return this.collection.splice(index, 0, value); 44 | } 45 | 46 | replace(index, value) { 47 | return this.collection.splice(index, 1, value); 48 | } 49 | 50 | clear() { 51 | this.collection.length = 0; 52 | } 53 | 54 | isEmpty() { 55 | return this.collection.length === 0; 56 | } 57 | 58 | viewFirst() { 59 | return this.collection[0]; 60 | } 61 | 62 | viewLast() { 63 | return this.collection[this.collection.length - 1]; 64 | } 65 | 66 | paginate(page_number, page_size) { 67 | return this.collection.slice( 68 | (page_number - 1) * page_size, 69 | page_number * page_size 70 | ); 71 | } 72 | }; 73 | -------------------------------------------------------------------------------- /src/commands/Economy/Work/name.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../../structures/Command"); 2 | 3 | module.exports = class Name extends Command { 4 | constructor(client) { 5 | super(client); 6 | this.client = client; 7 | 8 | this.name = "name"; 9 | this.category = "Economy"; 10 | this.description = "Comando para trabalhar"; 11 | this.usage = ""; 12 | this.aliases = ["nome"]; 13 | this.reference = "Work"; 14 | 15 | this.enabled = true; 16 | this.guildOnly = true; 17 | this.isSub = true; 18 | } 19 | 20 | async run({ message, args }) { 21 | const user = await this.client.database.users.findOne({ 22 | idU: message.author.id, 23 | }); 24 | 25 | const work = user.work; 26 | let name = args.slice(1).join(" "); 27 | if (!name) 28 | return message.reply( 29 | `${message.author}, você deve escrever um nome para setar na sua empresa.` 30 | ); 31 | if (name == work.name) 32 | return message.reply( 33 | `${message.author}, o nome inserido é o mesmo setado atualmente, tenta novamente.` 34 | ); 35 | if (name.length > 25) 36 | return message.reply( 37 | `${message.author}, o nome inserido é muito grande, por favor diminua o tamanho e tente novamente.` 38 | ); 39 | 40 | message.reply( 41 | `${message.author}, o nome da sua empresa foi alterado com sucesso!` 42 | ); 43 | await this.client.database.users.findOneAndUpdate( 44 | { idU: message.author.id }, 45 | { $set: { "work.name": name } } 46 | ); 47 | } 48 | }; 49 | -------------------------------------------------------------------------------- /src/client/listeningIn/guildMemberRemove.js: -------------------------------------------------------------------------------- 1 | const Guild = require("../../database/Schemas/Guild"); 2 | 3 | module.exports = class { 4 | constructor(client) { 5 | this.client = client; 6 | } 7 | 8 | async run(member) { 9 | let guild = member.guild; 10 | 11 | Guild.findOne({ idS: guild.id }, async (err, server) => { 12 | if (server.byebye.status) { 13 | this.client.channels.cache.get(server.byebye.channel).send( 14 | server.byebye.msg 15 | .replace(/{name}/g, `${member.user.username}`) 16 | .replace(/{total}/g, guild.memberCount) 17 | .replace(/{guildName}/g, guild.name) 18 | ); 19 | } 20 | 21 | if (server.serverstats.status) { 22 | const st = server.serverstats; 23 | const ch = st.channels; 24 | 25 | if (ch.total != "null") { 26 | let channel = guild.channels.cache.get(ch.total); 27 | 28 | channel.setName(`Total: ${guild.memberCount.toLocaleString()}`); 29 | } 30 | 31 | if (ch.bot != "null") { 32 | let channel = guild.channels.cache.get(ch.bot); 33 | 34 | channel.setName( 35 | `Bots: ${guild.members.cache 36 | .filter((x) => x.user.bot) 37 | .size.toLocaleString()}` 38 | ); 39 | } 40 | 41 | if (ch.users != "null") { 42 | let channel = guild.channels.cache.get(ch.users); 43 | 44 | channel.setName( 45 | `Usuários: ${guild.members.cache 46 | .filter((x) => !x.user.bot) 47 | .size.toLocaleString()}` 48 | ); 49 | } 50 | } 51 | }); 52 | } 53 | }; 54 | -------------------------------------------------------------------------------- /src/commands/Config/createCall/status.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../../structures/Command"); 2 | const Emojis = require("../../../utils/Emojis"); 3 | 4 | module.exports = class Status extends Command { 5 | constructor(client) { 6 | super(client); 7 | this.client = client; 8 | 9 | this.name = "status"; 10 | this.category = "Configuration"; 11 | this.description = "Comando para setar o canal"; 12 | this.usage = ""; 13 | this.aliases = ["ativar", "desativar"]; 14 | this.reference = "createCall"; 15 | 16 | this.enabled = true; 17 | this.isSub = true; 18 | } 19 | 20 | async run({ message, args, prefix, author }, t) { 21 | if (!message.member.permissions.has("MANAGE_MESSAGES")) 22 | return message.reply( 23 | `${Emojis.Errado} | ${message.author}, você precisa da permissão **MANAGE_MESSAGES**.` 24 | ); 25 | 26 | const doc = await this.client.database.guilds.findOne({ 27 | _id: message.guild.id, 28 | }); 29 | 30 | const createC = doc.createCall; 31 | 32 | if (createC.status) { 33 | await this.client.database.guilds.findOneAndUpdate( 34 | { idS: message.guild.id }, 35 | { $set: { "createCall.status": false } } 36 | ); 37 | return message.reply( 38 | `${Emojis.Certo} | ${message.author}, sistema desativado.` 39 | ); 40 | } else { 41 | await this.client.database.guilds.findOneAndUpdate( 42 | { idS: message.guild.id }, 43 | { $set: { "createCall.status": true } } 44 | ); 45 | return message.reply( 46 | `${Emojis.Certo} | ${message.author}, sistema ativado.` 47 | ); 48 | } 49 | } 50 | }; 51 | -------------------------------------------------------------------------------- /src/commands/Owner/test.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | 3 | const { MessageAttachment } = require("discord.js"); 4 | const { registerFont, createCanvas } = require("canvas"); 5 | registerFont("src/assets/fonts/Segoe UI Black.ttf", { family: "Montserrat" }); 6 | 7 | module.exports = class Test extends Command { 8 | constructor(client) { 9 | super(client); 10 | this.client = client; 11 | 12 | this.name = "test"; 13 | this.category = "Owner"; 14 | this.description = "Comando para testar códigos"; 15 | this.usage = ""; 16 | this.aliases = []; 17 | this.reference = "Test"; 18 | 19 | this.enabled = true; 20 | this.guildOnly = true; 21 | } 22 | 23 | async run({ message, args, prefix, author }, t) { 24 | if (message.author.id !== "600804786492932101") return; 25 | 26 | const subs = 27 | args[0] && 28 | this.client.subcommands 29 | .get(this.reference) 30 | .find( 31 | (cmd) => 32 | cmd.name.toLowerCase() === args[0].toLowerCase() || 33 | cmd.aliases.includes(args[0].toLowerCase()) 34 | ); 35 | 36 | let subcmd; 37 | let sub; 38 | 39 | if (!subs) { 40 | sub = "null"; 41 | this.client.subcommands 42 | .get(this.reference) 43 | .find( 44 | (cmd) => 45 | cmd.name.toLowerCase() === sub.toLowerCase() || 46 | cmd.aliases.includes(sub.toLowerCase()) 47 | ); 48 | } else subcmd = subs; 49 | 50 | if (subcmd != undefined) return subcmd.run({ message }); 51 | 52 | message.reply(`nenhum subcommand encontrado/não tem nenhum subcommand`); 53 | } 54 | }; 55 | -------------------------------------------------------------------------------- /src/client/listeningIn/guildDelete.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | 3 | module.exports = class { 4 | constructor(client) { 5 | this.client = client; 6 | } 7 | 8 | async run(guild) { 9 | try { 10 | const LEAVE = new MessageEmbed() 11 | .setTimestamp() 12 | .setColor(process.env.EMBED_COLOR) 13 | .setThumbnail(guild.iconURL({ dynamic: true, size: 2048 })); 14 | 15 | const owner = await guild.fetchOwner() 16 | 17 | 18 | LEAVE.setAuthor(`${guild.client.user.username} | Removido de um Servidor` 19 | ).addFields( 20 | { 21 | name: `Nome do Servidor`, 22 | value: `${guild.name}`, 23 | inline: true, 24 | }, 25 | { 26 | name: `ID Do Servidor`, 27 | value: `${guild.id}`, 28 | inline: true, 29 | }, 30 | { 31 | name: `Propietário`, 32 | value: `${owner}`, 33 | inline: true, 34 | }, 35 | { 36 | name: `ID Do Propietário`, 37 | value: `${owner.id}`, 38 | inline: true, 39 | }, 40 | { 41 | name: `Total de Usuários`, 42 | value: `${guild.memberCount}`, 43 | inline: true, 44 | }, 45 | { 46 | name: `Total de Canais`, 47 | value: `${guild.channels.cache.size}`, 48 | inline: true, 49 | } 50 | ) 51 | 52 | this.client.channels.cache.get(process.env.CHANNEL_LOGS).send({ embeds: [LEAVE] }) 53 | } catch (err) { 54 | console.log(`EVENTO: GuildDelete ${err}`); 55 | } 56 | }; 57 | } 58 | -------------------------------------------------------------------------------- /src/commands/Config/prefix.js: -------------------------------------------------------------------------------- 1 | const Guild = require("../../database/Schemas/Guild"); 2 | const Command = require("../../structures/Command"); 3 | 4 | module.exports = class Prefix extends Command { 5 | constructor(client) { 6 | super(client); 7 | this.client = client; 8 | 9 | this.name = "prefix"; 10 | this.category = "Config"; 11 | this.description = "Comando para configurar o prefixo do bot no servidor"; 12 | this.usage = "prefix "; 13 | this.aliases = ["prefixo"]; 14 | 15 | this.enabled = true; 16 | this.guildOnly = true; 17 | } 18 | 19 | async run({ message, args, prefix, author }, t) { 20 | Guild.findOne({ idS: message.guild.id }, async function (err, server) { 21 | let prefixos = args[0]; 22 | 23 | if (!prefixos) { 24 | return message.reply( 25 | `${message.author}, você não inseriu nenhum prefixo para eu alterar.` 26 | ); 27 | } else if (prefixos.length > 5) { 28 | return message.reply( 29 | `${message.author}, você deve inserir um prefixo com no máximo 5 caracteres.` 30 | ); 31 | } else if (prefixos == server.prefix) { 32 | return message.reply( 33 | `${message.author}, não foi possível alterar o prefixo, poís o prefixo inserido é o mesmo setado atualmente, tente novamente.` 34 | ); 35 | } else { 36 | message.reply( 37 | `${message.author}, meu prefixo em seu servidor foi alterado para **\`${prefixos}\`** com sucesso.` 38 | ); 39 | 40 | await Guild.findOneAndUpdate( 41 | { idS: message.guild.id }, 42 | { $set: { prefix: prefixos } } 43 | ); 44 | } 45 | }); 46 | } 47 | }; 48 | -------------------------------------------------------------------------------- /src/commands/Miscellaneous/ship.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | const Utils = require("../../utils/Util"); 3 | 4 | 5 | module.exports = class Ship extends ( 6 | Command 7 | ) { 8 | constructor(client) { 9 | super(client); 10 | this.client = client; 11 | 12 | this.name = "ship"; 13 | this.category = "Miscellaneous"; 14 | this.description = "Veja seu perfil com este comando"; 15 | this.usage = "ship <@user> <@user>"; 16 | this.aliases = ["shippar"]; 17 | 18 | this.enabled = true; 19 | this.guildOnly = true; 20 | } 21 | 22 | async run({message, args, prefix, author}, t) { 23 | 24 | let user = message.mentions.users.first(2)[0] || this.client.users.cache.get(args[0]) 25 | let target = message.mentions.users.first(2)[1] || this.client.users.cache.get(args[1]) 26 | 27 | if(!user) user = message.author; 28 | if(!target) target = this.client.user; 29 | 30 | function progressBar(progress, maxProgress, size) { 31 | const progressT = Math.round((size * progress) / maxProgress) 32 | const progressEmpty = size - progressT; 33 | 34 | const progressText = `█`.repeat(progressT); 35 | const progressEmptyText = `:`.repeat(progressEmpty) 36 | 37 | return progressText + progressEmptyText; 38 | } 39 | 40 | let ship = Math.round(Math.random() * 100); 41 | let max = target.username.length 42 | let min = max - (max > 5 ? 5 : 3) 43 | 44 | message.reply(`${message.author}\n> \`${user.username}\` + \`${target.username}\` = **${user.username.slice(0, 5)}${target.username.slice(min, max)}**\n\n> Eles tem **\`${ship}%\`** de chance de ficarem juntos.\n\n> \`0% [ ${progressBar(ship, 100, 50)} ] 100%\``) 45 | 46 | } 47 | }; 48 | -------------------------------------------------------------------------------- /src/commands/Moderation/unmute.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | 3 | module.exports = class UnMute extends Command { 4 | constructor(client) { 5 | super(client); 6 | this.client = client; 7 | 8 | this.name = "unmute"; 9 | this.category = "Moderation"; 10 | this.description = "Comando para desmutar membros."; 11 | this.usage = "unmute <@user>"; 12 | this.aliases = []; 13 | 14 | this.enabled = true; 15 | this.guildOnly = true; 16 | } 17 | 18 | async run({ message, args, prefix, author }, t) { 19 | const doc = await this.client.database.guilds.findOne({ 20 | idS: message.guild.id, 21 | }); 22 | 23 | const USER = message.guild.member( 24 | this.client.users.cache.get(args[0]) || message.mentions.users.first() 25 | ); 26 | 27 | if (!USER) 28 | return message.reply( 29 | `${message.author}, você deve mencionar quem deseja desmutar.` 30 | ); 31 | 32 | let role = message.guild.roles.cache.find((x) => x.name === "Mutado"); 33 | 34 | if (!doc.mutes.list.find((x) => x.user === USER.id)) 35 | return message.reply( 36 | `${message.author}, este membro não está mutado.` 37 | ); 38 | 39 | message.reply(`${message.author}, membro desmutado com sucesso.`); 40 | 41 | await this.client.database.guilds.findOneAndUpdate( 42 | { idS: message.guild.id }, 43 | { 44 | $pull: { "mutes.list": doc.mutes.list.find((x) => x.user === USER.id) }, 45 | } 46 | ); 47 | USER.roles 48 | .remove(role.id, `Membro desmutado por: ${message.author.tag}`) 49 | .catch((err) => { 50 | return message.reply( 51 | `${message.author}, este membro não tinha o cargo de mute.` 52 | ); 53 | }); 54 | } 55 | }; 56 | -------------------------------------------------------------------------------- /src/client/listeningIn/interactionCreate.js: -------------------------------------------------------------------------------- 1 | module.exports = class { 2 | constructor(client) { 3 | this.client = client; 4 | } 5 | 6 | async run(interaction) { 7 | if (!interaction.isCommand()) return; 8 | 9 | await interaction.deferReply(); 10 | 11 | if (!interaction.guildId || !interaction.channelId) 12 | return interaction.editReply( 13 | `Os SlashCommands ainda não podem ser usados na minha DM.` 14 | ); 15 | 16 | if (!interaction.client.guilds.cache.get(interaction.guildId)) 17 | return interaction.editReply( 18 | `Eu não fui adicionado corretamente ao servidor.` 19 | ); 20 | 21 | const prefix = 22 | (await this.client.database.guilds 23 | .findOne({ idS: interaction.guildId }) 24 | .then((x) => x.prefix)) || process.env.PREFIX; 25 | 26 | interaction.author = interaction.user; 27 | 28 | interaction.content = `${prefix}${interaction.commandName} ${ 29 | interaction.options._hoistedOptions.length > 0 30 | ? interaction.options._hoistedOptions.map((x) => x.value) 31 | : "" 32 | }`; 33 | 34 | interaction.slash = true; 35 | 36 | let response = false; 37 | 38 | interaction.reply = async (x, f) => { 39 | if (!response) { 40 | response = true; 41 | return interaction.editReply(x, f); 42 | } else { 43 | return this.client.channels.cache.get(interaction.channelId).send(x, f); 44 | } 45 | }; 46 | 47 | interaction.edit = async (x, f) => { 48 | if (!response) { 49 | response = true; 50 | return interaction.editReply(x, f); 51 | } else { 52 | return this.client.channels.cache.get(interaction.channelId).send(x, f); 53 | } 54 | }; 55 | 56 | this.client.emit("messageCreate", interaction); 57 | } 58 | }; 59 | -------------------------------------------------------------------------------- /src/commands/Music/skip.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | let array = []; 3 | 4 | 5 | module.exports = class Skip extends Command { 6 | constructor(client) { 7 | super(client); 8 | this.client = client; 9 | 10 | this.name = "skip"; 11 | this.category = "Music"; 12 | this.description = "Comando para pular para próxima música."; 13 | this.usage = "skip"; 14 | this.aliases = ["pular"]; 15 | 16 | this.enabled = true; 17 | this.guildOnly = true; 18 | } 19 | 20 | async run({ message }) { 21 | const player = this.client.music.players.get(message.guild.id); 22 | 23 | if (!player) 24 | return message.reply( 25 | `${message.author}, não estou tocando música neste servidor.` 26 | ); 27 | 28 | if ( 29 | !message.member.voice.channel || 30 | message.member.voice.channel.id != message.guild.me.voice.channel.id 31 | ) 32 | return message.reply( 33 | `${message.author}, você não está em um canal de voz/no mesmo canal que eu.` 34 | ); 35 | 36 | if (message.member.voice.selfDeaf) 37 | return message.reply( 38 | `${message.author}, você está com seu fone desativado portanto não é possível votar para pular a música.` 39 | ); 40 | 41 | const requiredVotes = 42 | message.guild.me.voice.channel.members.filter( 43 | (x) => !x.user.bot && !x.voice.selfDeaf 44 | ).size - 1; 45 | 46 | if (array.some((x) => x === message.author.id)) return; 47 | array.push(message.author.id); 48 | 49 | if (array.length >= requiredVotes) { 50 | player.stop(); 51 | 52 | message.reply(`Música pulada com sucesso.`); 53 | return (array = []); 54 | } 55 | 56 | message.reply( 57 | `Skipar a Música? **( ${array.length}/${requiredVotes} )**.` 58 | ); 59 | } 60 | }; 61 | -------------------------------------------------------------------------------- /src/client/listeningIn/messageDelete.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const Guild = require("../../database/Schemas/Guild"); 3 | 4 | module.exports = class { 5 | constructor(client) { 6 | this.client = client; 7 | } 8 | 9 | async run(message) { 10 | Guild.findOne({ idS: message.guild.id }, async function (err, server) { 11 | try { 12 | if (message.author.bot) return; // caso um bot tenha deletado alguma mensagem ele não vai mandar no canal de LOGS. 13 | const guild = message.guild; 14 | 15 | const UPDATE = new MessageEmbed() 16 | .setAuthor(guild.name, guild.iconURL({ dynamic: true })) 17 | .setTitle(`Mensagem Deletada`) 18 | .addFields( 19 | { 20 | name: `Author`, 21 | value: `${message.author}`, // pega o author da mensagem 22 | }, 23 | { 24 | name: `Contéudo da Mensagem`, 25 | value: `${message.content}`, // pega o contéudo da mensagem 26 | }, 27 | { 28 | name: `Canal`, 29 | value: `${message.channel}`, // pega o canal que a mensagem foi deletada 30 | } 31 | ) 32 | .setThumbnail( 33 | message.author.displayAvatarURL({ dynamic: true, size: 2048 }) 34 | ) 35 | .setFooter( 36 | `${message.author.tag} | ${message.author.id}`, 37 | message.author.displayAvatarURL({ dynamic: true, size: 2048 }) 38 | ) 39 | .setTimestamp() 40 | .setColor(process.env.EMBED_COLOR); 41 | 42 | if (server.logs.status) { 43 | const channel = guild.channels.cache.get(server.logs.channel); 44 | channel.send({ embeds: [UPDATE] }); 45 | } 46 | } catch (err) { 47 | console.log(`EVENTO: MessageDelete`); 48 | } 49 | }); 50 | } 51 | }; 52 | -------------------------------------------------------------------------------- /src/commands/Economy/coins.js: -------------------------------------------------------------------------------- 1 | const User = require("../../database/Schemas/User"); 2 | const Command = require("../../structures/Command"); 3 | const Utils = require("../../utils/Util"); 4 | const Emojis = require("../../utils/Emojis"); 5 | const ClientEmbed = require("../../structures/ClientEmbed"); 6 | 7 | module.exports = class Coins extends Command { 8 | constructor(client) { 9 | super(client); 10 | this.client = client; 11 | 12 | this.name = "coins"; 13 | this.category = "Economy"; 14 | this.description = "Comando para olhar seus coins/do usuário"; 15 | this.usage = "coins <@user>"; 16 | this.aliases = ["money"]; 17 | 18 | this.enabled = true; 19 | this.guildOnly = true; 20 | } 21 | 22 | async run({ message, args, prefix, author }, t) { 23 | const USER = 24 | this.client.users.cache.get(args[0]) || 25 | message.mentions.users.first() || 26 | message.author; 27 | 28 | User.findOne({ idU: USER.id }, async (err, user) => { 29 | let coins = user.coins; 30 | let bank = user.bank; 31 | 32 | const EMBED = new ClientEmbed(message.author) 33 | .setAuthor( 34 | `${USER.username} - Coins`, 35 | USER.displayAvatarURL({ dynamic: true }) 36 | ) 37 | .addFields( 38 | { 39 | name: `${Emojis.Bank} Coins fora do Banco`, 40 | value: Utils.toAbbrev(coins), 41 | }, 42 | 43 | { 44 | name: `${Emojis.Coins} Coins no Banco`, 45 | value: Utils.toAbbrev(bank), 46 | }, 47 | { 48 | name: `${Emojis.Economy} Total`, 49 | value: Utils.toAbbrev(coins + bank), 50 | } 51 | ) 52 | .setThumbnail( 53 | USER.displayAvatarURL({ dynamic: true, size: 2048, format: "jpg" }) 54 | ); 55 | 56 | message.reply({embeds: [EMBED]}) 57 | }); 58 | } 59 | }; 60 | -------------------------------------------------------------------------------- /src/client/listeningIn/channelDelete.js: -------------------------------------------------------------------------------- 1 | const Guild = require("../../database/Schemas/Guild"); 2 | 3 | module.exports = class { 4 | constructor(client) { 5 | this.client = client; 6 | } 7 | 8 | async run(channel) { 9 | const guild = channel.guild; 10 | 11 | const doc = await this.client.database.guilds.findOne({ idS: guild.id }); 12 | 13 | try { 14 | if (doc.createCall.channel == channel.id) { 15 | await this.client.database.guilds.findOneAndUpdate( 16 | { 17 | idS: guild.id, 18 | }, 19 | { 20 | $set: { 21 | "createCall.status": false, 22 | "createCall.channel": "null", 23 | "createCall.category": "null", 24 | }, 25 | } 26 | ); 27 | } 28 | 29 | if (doc.createCall.users.find((x) => x.channel === channel.id)) { 30 | await this.client.database.guilds.findOneAndUpdate( 31 | { 32 | idS: guild.id, 33 | }, 34 | { 35 | $pull: { 36 | "createCall.users": doc.createCall.users.find( 37 | (x) => x.channel == channel.id 38 | ), 39 | }, 40 | } 41 | ); 42 | } 43 | 44 | const channels = await Guild.findOne({ 45 | idS: channel.guild.id, 46 | }).then((r) => Object.entries(r.serverstats.channels)); 47 | 48 | const updatedObject = channels 49 | .filter(([, c]) => c === channel.id) 50 | .reduce( 51 | (o, [key]) => 52 | Object.assign(o, { 53 | [`serverstats.channels.${key}`]: "null", 54 | }), 55 | {} 56 | ); 57 | 58 | return await Guild.findOneAndUpdate( 59 | { idS: channel.guild.id }, 60 | updatedObject 61 | ); 62 | } catch (err) { 63 | console.log(`EVENTO: ChannelDelete ${err}`); 64 | } 65 | } 66 | }; 67 | -------------------------------------------------------------------------------- /src/commands/Fun/wedding.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | const ClientEmbed = require("../../structures/ClientEmbed"); 3 | const moment = require("moment"); 4 | require("moment-duration-format"); 5 | 6 | module.exports = class Wedding extends Command { 7 | constructor(client) { 8 | super(client); 9 | this.client = client; 10 | 11 | this.name = "wedding"; 12 | this.category = "Fun"; 13 | this.description = "Comando para ver suas informações de casamento."; 14 | this.usage = "wedding [user]"; 15 | this.aliases = ["casamento"]; 16 | 17 | this.enabled = true; 18 | this.guildOnly = true; 19 | } 20 | 21 | async run({ message, args, prefix, author }, t) { 22 | moment.locale("pt-BR"); 23 | const user = 24 | this.client.users.cache.get(args[0]) || 25 | message.mentions.users.first() || 26 | message.author; 27 | 28 | const doc = await this.client.database.users.findOne({ 29 | idU: user.id, 30 | }); 31 | 32 | if (!doc.marry.has) 33 | return message.reply( 34 | `${message.author}, você/o usuário não está casado.` 35 | ); 36 | 37 | const par = await this.client.users.fetch(doc.marry.user); 38 | 39 | const EMBED = new ClientEmbed(user) 40 | .setThumbnail( 41 | par.displayAvatarURL({ dynamic: true, format: "jpg", size: 2048 }) 42 | ) 43 | .setDescription(`> Informações sobre o casamento do(a) ${user}.`) 44 | .addFields( 45 | { 46 | name: `Par do Usuário`, 47 | value: `**${par.tag}** \`( ${par.id} )\``, 48 | }, 49 | { 50 | name: `Data do Casamento`, 51 | value: `**${moment 52 | .duration(Date.now() - doc.marry.time) 53 | .format("M [M] d [d] h [h] m [m] s [s]")}** \`( ${moment( 54 | doc.marry.time 55 | ).format("L LT")} )\``, 56 | } 57 | ); 58 | 59 | message.reply({embeds: [EMBED]}) 60 | } 61 | }; 62 | -------------------------------------------------------------------------------- /src/client/listeningIn/guildCreate.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | 3 | module.exports = class { 4 | constructor(client) { 5 | this.client = client; 6 | } 7 | 8 | async run(guild) { 9 | try { 10 | const JOIN = new MessageEmbed() 11 | .setTimestamp() 12 | .setColor(process.env.EMBED_COLOR) 13 | .setThumbnail(guild.iconURL({ dynamic: true, size: 2048 })); 14 | 15 | const INVITE = await guild.invites.fetch() 16 | .then((invites) => { 17 | if (invites) return invites.random().url; 18 | return false; 19 | }) 20 | .catch(() => { 21 | return false; 22 | }); 23 | 24 | if (INVITE) JOIN.setURL(INVITE).setTitle(guild.name); 25 | 26 | const owner = await guild.fetchOwner() 27 | 28 | JOIN.setAuthor(`${guild.client.user.username} | Adicionado à um Servidor`).addFields( 29 | { 30 | name: `Nome do Servidor`, 31 | value: `${guild.name}`, 32 | inline: true, 33 | }, 34 | { 35 | name: `ID Do Servidor`, 36 | value: `${guild.id}`, 37 | inline: true, 38 | }, 39 | { 40 | name: `Propietário`, 41 | value: `${owner}`, 42 | inline: true, 43 | }, 44 | { 45 | name: `ID Do Propietário`, 46 | value: `${owner.id}`, 47 | inline: true, 48 | }, 49 | { 50 | name: `Total de Usuários`, 51 | value: `${guild.memberCount}`, 52 | inline: true, 53 | }, 54 | { 55 | name: `Total de Canais`, 56 | value: `${guild.channels.cache.size}`, 57 | inline: true, 58 | } 59 | ) 60 | 61 | this.client.channels.cache.get(process.env.CHANNEL_LOGS).send({ embeds: [JOIN] }) 62 | } catch (err) { 63 | console.log(`EVENTO: GuildCreate ${err}`); 64 | } 65 | }; 66 | } 67 | -------------------------------------------------------------------------------- /src/commands/Economy/rankcoins.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | const Utils = require("../../utils/Util"); 3 | const ClientEmbed = require("../../structures/ClientEmbed"); 4 | 5 | module.exports = class RankCoins extends Command { 6 | constructor(client) { 7 | super(client); 8 | this.client = client; 9 | 10 | this.name = "rankcoins"; 11 | this.category = "Economy"; 12 | this.description = "Comando para olhar o Top Rank de Dinheiro."; 13 | this.usage = "rankcoins"; 14 | this.aliases = ["top-coins", "r-c", "t-c", "rank-coins"]; 15 | 16 | this.enabled = true; 17 | this.guildOnly = true; 18 | } 19 | 20 | async run({ message }) { 21 | const COINS = await require("mongoose") 22 | .connection.collection("users") 23 | .find({ bank: { $gt: 0 } }) 24 | .toArray(); 25 | 26 | const coins = Object.entries(COINS) 27 | .map(([, x]) => x.idU) 28 | .sort((x, f) => x.bank - f.bank); 29 | 30 | const members = []; 31 | 32 | await this.PUSH(coins, members); 33 | 34 | const coinsMap = members 35 | .map((x) => x) 36 | .sort((x, f) => f.coins - x.coins) 37 | .slice(0, 10); 38 | 39 | const TOP = new ClientEmbed(this.client.user) 40 | .setAuthor(`Ranking Monetário`) 41 | .setDescription( 42 | coinsMap 43 | .map( 44 | (x, f) => 45 | `\`${f + 1}º\` **\`${x.user.tag}\`** - **R$${Utils.toAbbrev( 46 | x.coins 47 | )}**\nID: \`${x.user.id}\`` 48 | ) 49 | .join("\n\n") 50 | ); 51 | message.reply({ embeds: [TOP] }); 52 | } 53 | 54 | async PUSH(coins, members) { 55 | for (const member of coins) { 56 | const doc = await this.client.database.users.findOne({ idU: member }); 57 | 58 | members.push({ 59 | user: await this.client.users.fetch(member).then((user) => { 60 | return user; 61 | }), 62 | coins: doc.coins + doc.bank, 63 | }); 64 | } 65 | } 66 | }; 67 | -------------------------------------------------------------------------------- /src/commands/Economy/daily.js: -------------------------------------------------------------------------------- 1 | const User = require("../../database/Schemas/User"); 2 | const Command = require("../../structures/Command"); 3 | const moment = require("moment"); 4 | require("moment-duration-format"); 5 | const Utils = require("../../utils/Util"); 6 | module.exports = class Daily extends Command { 7 | constructor(client) { 8 | super(client); 9 | this.client = client; 10 | 11 | this.name = "daily"; 12 | this.category = "Economy"; 13 | this.description = "Comando para pegar seus coins diário"; 14 | this.usage = "daily"; 15 | this.aliases = ["diario"]; 16 | 17 | this.enabled = true; 18 | this.guildOnly = true; 19 | } 20 | 21 | async run({ message, args, prefix, author }, t) { 22 | const user = await this.client.database.users.findOne({ 23 | idU: message.author.id, 24 | }); 25 | 26 | //================= Imports =================// 27 | 28 | const give = Math.floor(Math.random() * 100); 29 | let cooldown = 8.64e7; 30 | let coins = user.vip.hasVip ? give + Math.floor(Math.random() * 200) : give; 31 | let daily = user.daily; 32 | let atual = user.coins; 33 | let time = cooldown - (Date.now() - daily); 34 | 35 | //================= Verifcação do Tempo =================// 36 | 37 | if (daily !== null && cooldown - (Date.now() - daily) > 0) { 38 | return message.reply( 39 | `${message.author}, aguarde **${moment 40 | .duration(time) 41 | .format( 42 | "h [horas] m [minutos] e s [segundos]" 43 | )}** até pegar o prêmio diário novamente` 44 | ); 45 | } else { 46 | message.reply( 47 | `${ 48 | message.author 49 | }, você resgatou seu prêmio diário de hoje e conseguiu **${coins}** coins.\nAgora você possui **${Utils.toAbbrev( 50 | atual + coins 51 | )}** coins.` 52 | ); 53 | 54 | await User.findOneAndUpdate( 55 | { idU: message.author.id }, 56 | { $set: { coins: coins + atual, daily: Date.now() } } 57 | ); 58 | } 59 | } 60 | }; 61 | -------------------------------------------------------------------------------- /src/commands/Owner/reload.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | const path = require("path"); 3 | 4 | module.exports = class Reload extends Command { 5 | constructor(client) { 6 | super(client); 7 | this.client = client; 8 | 9 | this.name = "reload"; 10 | this.category = "Owner"; 11 | this.description = "Comando para reiniciar outros comandos."; 12 | this.usage = "reload "; 13 | this.aliases = ["r"]; 14 | 15 | this.enabled = true; 16 | this.guildOnly = true; 17 | } 18 | 19 | async run({ message, args, prefix, author }, t) { 20 | if (message.author.id !== process.env.OWNER_ID) return; 21 | 22 | if (!args[0]) 23 | return message.reply( 24 | `${message.author}, insira o nome/aliases do comando.` 25 | ); 26 | 27 | const cmd = 28 | this.client.commands.get(args[0].toLowerCase()) || 29 | this.client.commands.get(this.client.aliases.get(args[0].toLowerCase())); 30 | 31 | if (!cmd) 32 | return message.reply(`${message.author}, comando não encontrado.`); 33 | 34 | const cmdFile = path.parse(`../../commands/${cmd.category}/${cmd.name}.js`); 35 | 36 | if (!cmdFile.ext || cmdFile.ext !== ".js") 37 | return message.reply( 38 | `${message.author}, oque foi inserido não é um comando.` 39 | ); 40 | 41 | const reload = async (commandPath, commandName) => { 42 | const props = new (require(`${commandPath}/${commandName}`))(this.client); 43 | delete require.cache[require.resolve(`${commandPath}/${commandName}`)]; 44 | 45 | this.client.commands.set(props.name, props); 46 | }; 47 | 48 | const response = reload(cmdFile.dir, `${cmdFile.name}${cmdFile.ext}`).catch( 49 | (error) => { 50 | if (error) 51 | return message.reply( 52 | `${message.author}, ocorreu um erro ao reiniciar o comando **${error.name}** ( \`${error.message}\` )` 53 | ); 54 | } 55 | ); 56 | 57 | if (response) 58 | return message.reply( 59 | `${message.author}, comando recarregado com sucesso.` 60 | ); 61 | } 62 | }; 63 | -------------------------------------------------------------------------------- /src/commands/Config/createCall/info.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../../structures/Command"); 2 | const ClientEmbed = require("../../../structures/ClientEmbed"); 3 | const Emojis = require("../../../utils/Emojis"); 4 | 5 | module.exports = class Info extends Command { 6 | constructor(client) { 7 | super(client); 8 | this.client = client; 9 | 10 | this.name = "info"; 11 | this.category = "Configuration"; 12 | this.description = "Comando para setar o canal"; 13 | this.usage = ""; 14 | this.aliases = ["information", "i"]; 15 | this.reference = "createCall"; 16 | 17 | this.enabled = true; 18 | this.isSub = true; 19 | } 20 | 21 | async run({ message, args, prefix, author }, t) { 22 | const doc = await this.client.database.guilds.findOne({ 23 | idS: message.guild.id, 24 | }); 25 | 26 | const USER = 27 | this.client.users.cache.get(args[1]) || 28 | message.mentions.users.first() || 29 | message.author; 30 | 31 | const createCall = doc.createCall; 32 | 33 | const findUser = createCall.users.find((x) => x.user === USER.id); 34 | 35 | if (!findUser) 36 | return message.reply( 37 | `${Emojis.Errado} | ${message.author}, você/o usuário não tem uma call criada.` 38 | ); 39 | 40 | const channel = message.guild.channels.cache.get(findUser.channel); 41 | 42 | const EMBED = new ClientEmbed(author) 43 | .setAuthor(USER.username, USER.displayAvatarURL({ dynamic: true })) 44 | .setThumbnail( 45 | USER.displayAvatarURL({ dynamic: true, format: "png", size: 2048 }) 46 | ) 47 | .setDescription( 48 | `> ${Emojis.Owner} Dono da Call: **${ 49 | USER.tag 50 | }**\n\n> Membros no Canal: **${ 51 | channel.members.size 52 | }**\n> Silenciados: **${ 53 | channel.members.filter((x) => x.voice.selfMute).size 54 | }**\n> Mutados: **${ 55 | channel.members.filter((x) => x.voice.selfDeaf).size 56 | }**\n\n> Canal criado ****` 57 | ); 58 | 59 | message.reply({ embeds: [EMBED] }); 60 | } 61 | }; 62 | -------------------------------------------------------------------------------- /src/client/listeningIn/messageUpdate.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const Guild = require("../../database/Schemas/Guild"); 3 | 4 | module.exports = class { 5 | constructor(client) { 6 | this.client = client; 7 | } 8 | 9 | async run(oldMessage, newMessage) { 10 | Guild.findOne({ idS: newMessage.guild.id }, async (err, server) => { 11 | try { 12 | if (newMessage.author.bot) return; // caso um bot tenha editado alguma mensagem ele não vai mandar no canal de LOGS. 13 | const guild = newMessage.guild; 14 | 15 | if (oldMessage.content === newMessage.content) return; 16 | 17 | this.client.emit("messageCreate", newMessage); 18 | 19 | const UPDATE = new MessageEmbed() 20 | .setAuthor(guild.name, guild.iconURL({ dynamic: true })) 21 | .setTitle(`Mensagem Editada`) 22 | .addFields( 23 | { 24 | name: `Author`, 25 | value: `${newMessage.author}`, // pega o author da mensagem 26 | }, 27 | { 28 | name: `Mensagem Anterior`, 29 | value: `${oldMessage.content}`, 30 | }, 31 | { 32 | name: `Mensagem Posterior`, 33 | value: `${newMessage.content}`, 34 | }, 35 | { 36 | name: `Canal`, 37 | value: `${newMessage.channel}`, 38 | } 39 | ) 40 | .setThumbnail( 41 | newMessage.author.displayAvatarURL({ dynamic: true, size: 2048 }) 42 | ) 43 | .setFooter( 44 | `${newMessage.author.tag} | ${newMessage.author.id}`, 45 | newMessage.author.displayAvatarURL({ dynamic: true, size: 2048 }) 46 | ) 47 | .setTimestamp() 48 | .setColor(process.env.EMBED_COLOR); 49 | 50 | if (server.logs.status) { 51 | const channel = guild.channels.cache.get(server.logs.channel); 52 | channel.send({ embeds: [UPDATE] }); 53 | } 54 | } catch (err) { 55 | console.log(`EVENTO: MessageUpdate ${err}`); 56 | } 57 | }); 58 | } 59 | }; 60 | -------------------------------------------------------------------------------- /src/commands/Information/rank.js: -------------------------------------------------------------------------------- 1 | const User = require("../../database/Schemas/User"); 2 | const Command = require("../../structures/Command"); 3 | const ClientEmbed = require("../../structures/ClientEmbed"); 4 | 5 | module.exports = class Rank extends Command { 6 | constructor(client) { 7 | super(client); 8 | this.client = client; 9 | 10 | this.name = "rank"; 11 | this.category = "Information"; 12 | this.description = "Comando para olhar o rank de xp"; 13 | this.usage = "rank"; 14 | this.aliases = ["pong"]; 15 | 16 | this.enabled = true; 17 | this.guildOnly = true; 18 | } 19 | 20 | async run({ message, args, prefix, author }, t) { 21 | User.findOne({ idU: message.author.id }, async (err, user) => { 22 | await require("mongoose") 23 | .connection.collection("users") 24 | .find({ "Exp.xp": { $gt: 5 } }) 25 | .toArray((err, res) => { 26 | if (err) throw err; 27 | let Exp = res.map((x) => x.Exp).sort((x, f) => f.level - x.level); 28 | 29 | let ranking = 30 | [...Exp.values()].findIndex((x) => x.id === message.author.id) + 1; 31 | 32 | const EMBED = new ClientEmbed(author) 33 | .setAuthor( 34 | `${this.client.user.username} - Ranking de XP`, 35 | this.client.user.displayAvatarURL() 36 | ) 37 | .setDescription( 38 | Exp.map( 39 | (x, f) => 40 | `**\`${f + 1}.\`** **${x.user}** ( Level: ${x.level} / XP: ${ 41 | x.xp 42 | } )\n**\`ID:\`**: ${x.id}` 43 | ) 44 | .slice(0, 10) 45 | .join("\n\n") 46 | ) 47 | 48 | .setFooter( 49 | `Sua colocação ${ranking}º lugar - ( Level: ${user.Exp.level} / XP: ${user.Exp.xp} )`, 50 | message.author.displayAvatarURL({ dynamic: true, size: 2048 }) 51 | ) 52 | .setThumbnail( 53 | message.author.displayAvatarURL({ dynamic: true, size: 2048 }) 54 | ); 55 | 56 | message.reply({embeds: [EMBED]}) 57 | }); 58 | }); 59 | } 60 | }; 61 | -------------------------------------------------------------------------------- /src/commands/Information/xp.js: -------------------------------------------------------------------------------- 1 | const Discord = require("discord.js"); 2 | const CanvaCord = require("canvacord"); 3 | const User = require("../../database/Schemas/User"); 4 | const Command = require("../../structures/Command"); 5 | 6 | module.exports = class XP extends Command { 7 | constructor(client) { 8 | super(client); 9 | this.client = client; 10 | 11 | this.name = "xp"; 12 | this.category = "Information"; 13 | this.description = "Comando para olhar seu xp"; 14 | this.usage = "xp <@user>"; 15 | this.aliases = []; 16 | 17 | this.enabled = true; 18 | this.guildOnly = true; 19 | } 20 | 21 | async run({ message, args, prefix, author }, t) { 22 | let USER = 23 | message.mentions.users.first() || 24 | this.client.users.cache.get(args[0]) || 25 | message.author; 26 | 27 | User.findOne({ idU: USER.id }, async (err, user) => { 28 | await require("mongoose") 29 | .connection.collection("users") 30 | .find({ "Exp.xp": { $gt: 5 } }) 31 | .toArray((err, res) => { 32 | if (err) throw err; 33 | let Exp = res.map((x) => x.Exp).sort((x, f) => f.level - x.level); 34 | 35 | let ranking = 36 | [...Exp.values()].findIndex((x) => x.id === message.author.id) + 1; 37 | 38 | let xp = user.Exp.xp; 39 | let level = user.Exp.level; 40 | let nextLevel = user.Exp.nextLevel * level; 41 | 42 | const rank = new CanvaCord.Rank() 43 | .setAvatar(message.author.displayAvatarURL({ format: "jpg" })) 44 | .setCurrentXP(xp) 45 | .setRequiredXP(nextLevel) 46 | .setRank(ranking, "Rank", true) 47 | .setLevel(level) 48 | .setStatus(message.author.presence.status) 49 | .setProgressBar(process.env.EMBED_COLOR, "COLOR") 50 | .setUsername(message.author.username) 51 | .setDiscriminator(message.author.discriminator); 52 | 53 | rank.build().then((data) => { 54 | const attachment = new Discord.MessageAttachment( 55 | data, 56 | `${USER.tag}--XP.png` 57 | ); 58 | message.reply({ files: [attachment] }); 59 | }); 60 | }); 61 | }); 62 | } 63 | }; 64 | -------------------------------------------------------------------------------- /src/commands/Miscellaneous/reps.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | const ClientEmbed = require("../../structures/ClientEmbed"); 3 | const moment = require("moment"); 4 | require("moment-duration-format"); 5 | 6 | module.exports = class Reps extends Command { 7 | constructor(client) { 8 | super(client); 9 | this.client = client; 10 | 11 | this.name = "reps"; 12 | this.category = "Miscellaneous"; 13 | this.description = "Dê rep para seus amigos."; 14 | this.usage = "reps <@user>"; 15 | this.aliases = []; 16 | 17 | this.enabled = true; 18 | this.guildOnly = true; 19 | } 20 | 21 | async run({ message, args, prefix, author }, t) { 22 | const USER = 23 | this.client.users.cache.get(args[0]) || 24 | message.mentions.users.first() || 25 | message.author; 26 | 27 | const doc = await this.client.database.users.findOne({ idU: USER.id }); 28 | const rep = doc.reps; 29 | const cooldown = 7.2e6 - (Date.now() - rep.time); 30 | 31 | const lastReceived = 32 | rep.lastRep == "null" ? "" : await this.client.users.fetch(rep.lastRep); 33 | const lastSend = 34 | rep.lastSend == "null" ? "" : await this.client.users.fetch(rep.lastSend); 35 | 36 | const EMBED = new ClientEmbed(author) 37 | 38 | .setTitle(`Informações sobre suas Reputações`) 39 | .addFields( 40 | { 41 | name: `Quanto de reputação você tem agora`, 42 | value: rep.size == 0 ? "Nenhuma" : rep.size, 43 | }, 44 | { 45 | name: `Última pessoa que te enviou uma reputação`, 46 | value: rep.lastRep == "null" ? "Ninguém" : lastReceived.tag, 47 | }, 48 | { 49 | name: `Última pessoa que você enviou uma reputação`, 50 | value: rep.lastSend == "null" ? "Ninguém" : lastSend.tag, 51 | }, 52 | { 53 | name: `Tempo até poder enviar novamente`, 54 | value: 55 | cooldown < 0 56 | ? "Já pode enviar novamente" 57 | : moment 58 | .duration(cooldown) 59 | .format("h [horas] m [minutos] e s [segundos]") 60 | .replace("minsutos", "minutos"), 61 | } 62 | ); 63 | 64 | message.reply({embeds: [EMBED]}); 65 | } 66 | }; 67 | -------------------------------------------------------------------------------- /src/commands/Config/lang.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | const ClientEmbed = require("../../structures/ClientEmbed"); 3 | 4 | module.exports = class Lnaguage extends Command { 5 | constructor(client) { 6 | super(client); 7 | this.client = client; 8 | 9 | this.name = "lang"; 10 | this.category = "Config"; 11 | this.description = "Comando para alterar a linguagem do bot no servidor."; 12 | this.usage = "lang"; 13 | this.aliases = ["language"]; 14 | 15 | this.enabled = true; 16 | this.guildOnly = true; 17 | } 18 | 19 | async run({ message, args, prefix, author, language }, t) { 20 | const doc = await this.client.database.guilds.findOne({ 21 | idS: message.guild.id, 22 | }); 23 | 24 | const lang = { 25 | one: { 26 | id: 1, 27 | language: "🇧🇷 pt-BR", 28 | db: "pt-BR", 29 | }, 30 | two: { 31 | id: 2, 32 | language: "🇺🇸 en-US", 33 | db: "en-US", 34 | }, 35 | }; 36 | 37 | if (!args[0]) { 38 | const EMBED = new ClientEmbed(author) 39 | .setTitle(`Linguagens Disponíveis`) 40 | .setDescription( 41 | `${Object.entries(lang) 42 | .map(([, x]) => `ID: **${x.id}** - ${x.language}`) 43 | .join("\n")}\n\nLinguagem setada atualmente: **${language}**` 44 | ); 45 | 46 | return message.reply({embeds: [EMBED]}) 47 | } 48 | 49 | if (["set", "setar", "trocar"].includes(args[0].toLowerCase())) { 50 | const id = parseInt(args[1]); 51 | const filter = Object.entries(lang).filter(([, x]) => x.id == id); 52 | const find = filter[0][1]; 53 | 54 | if (!filter.length) 55 | return message.reply( 56 | `${message.author}, não tenho esta linguagem disponível ainda.` 57 | ); 58 | if (find.db === doc.lang) 59 | return message.reply( 60 | `${message.author}, esta linguagem já está setada no momento.` 61 | ); 62 | 63 | message.reply( 64 | `${message.author}, linguagem alterada com sucesso.` 65 | ); 66 | 67 | await this.client.database.guilds.findOneAndUpdate( 68 | { idS: message.guild.id }, 69 | { $set: { lang: find.id == 1 ? "pt-BR" : "en-US" } } 70 | ); 71 | } 72 | } 73 | }; 74 | -------------------------------------------------------------------------------- /src/commands/Miscellaneous/rep.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | const moment = require("moment"); 3 | require("moment-duration-format"); 4 | 5 | module.exports = class Rep extends Command { 6 | constructor(client) { 7 | super(client); 8 | this.client = client; 9 | 10 | this.name = "rep"; 11 | this.category = "Miscellaneous"; 12 | this.description = "Dê rep para seus amigos."; 13 | this.usage = "reps <@user>"; 14 | this.aliases = []; 15 | 16 | this.enabled = true; 17 | this.guildOnly = true; 18 | } 19 | 20 | async run({ message, args, prefix, author }, t) { 21 | const USER = 22 | this.client.users.cache.get(args[0]) || message.mentions.users.first(); 23 | 24 | const doc = await this.client.database.users.findOne({ idU: message.author.id }); 25 | const doc1 = await this.client.database.users.findOne({ idU: USER.id }); 26 | 27 | const rep = doc.reps; 28 | const cooldown = 7.2e6 - (Date.now() - rep.time); 29 | 30 | if (cooldown > 0) 31 | return message.reply( 32 | `${message.author}, você deve aguardar **${moment 33 | .duration(cooldown) 34 | .format("h [horas] m [minutos] e s [segundos]") 35 | .replace( 36 | "minsutos", 37 | "minutos" 38 | )}** até poder mandar reputação de novo.` 39 | ); 40 | if (!USER) 41 | return message.reply( 42 | `${message.author}, você deve mencionar para quem deseja enviar uma reputação.` 43 | ); 44 | 45 | if (USER.bot) 46 | return message.reply( 47 | `${message.author}, você não pode enviar reputação para bots.` 48 | ); 49 | 50 | if (!doc1) 51 | return message.reply( 52 | `${message.author}, este usuário não está registrado em minha database.` 53 | ); 54 | 55 | message.reply( 56 | `${message.author}, você enviou uma reputaçaõ para o usuário **${USER.tag}** com sucesso.` 57 | ); 58 | 59 | await this.client.database.users.findOneAndUpdate( 60 | { idU: message.author.id }, 61 | { $set: { "reps.lastSend": USER.id, "reps.time": Date.now() } } 62 | ); 63 | await this.client.database.users.findOneAndUpdate( 64 | { idU: USER.id }, 65 | { 66 | $set: { 67 | "reps.lastRep": message.author.id, 68 | "reps.size": doc1.reps.size + 1, 69 | }, 70 | } 71 | ); 72 | } 73 | }; 74 | -------------------------------------------------------------------------------- /lib/Locale.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const glob_1 = require("glob"); 4 | const fs_1 = require("fs"); 5 | class Locale { 6 | constructor(dir) { 7 | this.dir = dir; 8 | this.languages = {}; 9 | this.actualLang = "pt"; 10 | this.options = { 11 | returnUndefined: true, 12 | }; 13 | } 14 | async init(options) { 15 | this.options = options; 16 | const dirs = glob_1.sync(this.dir + "/**/*.json"); 17 | 18 | const promises = dirs.map(async (file) => { 19 | return new Promise((rej) => { 20 | const lang = file.split("/")[2]; 21 | 22 | if (this.languages[lang] === undefined) this.languages[lang] = {}; 23 | 24 | const ns = file.split("/")[3].replace(".json", ""); 25 | fs_1.readFile(file, async (err, data) => { 26 | this.languages[lang][ns] = JSON.parse(data.toString()); 27 | rej(true); 28 | }); 29 | }); 30 | }); 31 | await Promise.all(promises); 32 | return this.t.bind(this); 33 | } 34 | async setLang(lang) { 35 | this.actualLang = lang; 36 | } 37 | t(locale, options) { 38 | let nSeparator = locale.split(":"); 39 | let actualLocale = []; 40 | actualLocale.push(this.actualLang); 41 | nSeparator.map((ns) => { 42 | const lSeparator = ns.split("."); 43 | if (lSeparator.length !== 2) { 44 | actualLocale.push(ns); 45 | } else { 46 | actualLocale.push(lSeparator[0]); 47 | actualLocale.push(lSeparator[1]); 48 | } 49 | }); 50 | let finalLocale = {}; 51 | actualLocale.map((locale, index) => { 52 | if (index === 0) { 53 | finalLocale = this.languages[locale]; 54 | } else { 55 | finalLocale = finalLocale[locale]; 56 | } 57 | }); 58 | if (!this.options.returnUndefined) { 59 | if (finalLocale === undefined) { 60 | return "No locale available"; 61 | } else { 62 | return this.format(finalLocale, options); 63 | } 64 | } else { 65 | return this.format(finalLocale, options); 66 | } 67 | } 68 | 69 | format(locale, options) { 70 | var formatted = locale; 71 | if (typeof options == "object") { 72 | var vars = options; 73 | for (let v in vars) { 74 | var regexp = new RegExp("\\{{" + v + "\\}}", "gi"); 75 | formatted = formatted.replace(regexp, vars[v]); 76 | } 77 | } 78 | return formatted; 79 | } 80 | } 81 | module.exports = Locale; 82 | -------------------------------------------------------------------------------- /src/commands/Economy/deposit.js: -------------------------------------------------------------------------------- 1 | const User = require("../../database/Schemas/User"); 2 | const Command = require("../../structures/Command"); 3 | const Utils = require("../../utils/Util"); 4 | 5 | module.exports = class Deposit extends Command { 6 | constructor(client) { 7 | super(client); 8 | this.client = client; 9 | 10 | this.name = "deposit"; 11 | this.category = "Economy"; 12 | this.description = "Comando para depositar seu dinheiro"; 13 | this.usage = "deposit "; 14 | this.aliases = ["depositar", "dep", "deep"]; 15 | 16 | this.enabled = true; 17 | this.guildOnly = true; 18 | } 19 | 20 | async run({ message, args, prefix, author }, t) { 21 | User.findOne({ idU: message.author.id }, async (err, user) => { 22 | let coins = parseInt(args[0]); 23 | 24 | if (!args[0]) 25 | return message.reply( 26 | `${message.author}, ${t('commands:deposit.noArgs', { 27 | prefix 28 | } )}` 29 | ); 30 | 31 | if (["all", "tudo"].includes(args[0].toLowerCase())) { 32 | if (user.coins == 0) { 33 | return message.reply( 34 | `${message.author}, você não possui coins para depositar.` 35 | ); 36 | } else { 37 | message.reply( 38 | `${message.author}, ${t('commands:deposit.sucess', { 39 | coins: `${Utils.toAbbrev(user.coins)}` 40 | } )}` 41 | ); 42 | await User.findOneAndUpdate( 43 | { idU: message.author.id }, 44 | { $set: { coins: 0, bank: user.coins + user.bank } } 45 | ); 46 | } 47 | return; 48 | } 49 | if (coins < 0) { 50 | return message.reply( 51 | `${message.author}, não é possível depositar menos de 1 coins.` 52 | ); 53 | } else if (isNaN(coins)) { 54 | return message.reply( 55 | `${message.author}, modo correto de utilizar o comando: **${prefix}depositar **` 56 | ); 57 | } else if (coins > user.coins) { 58 | return message.reply( 59 | `${message.author}, você não possui essa quantia para depositar.` 60 | ); 61 | } else { 62 | message.reply( 63 | `${message.author}, você depositou **${Utils.toAbbrev( 64 | coins 65 | )} coins** com sucesso.` 66 | ); 67 | await User.findOneAndUpdate( 68 | { idU: message.author.id }, 69 | { $set: { coins: user.coins - coins, bank: user.bank + coins } } 70 | ); 71 | } 72 | }); 73 | } 74 | }; 75 | -------------------------------------------------------------------------------- /src/commands/Economy/withdraw.js: -------------------------------------------------------------------------------- 1 | const User = require("../../database/Schemas/User"); 2 | const Command = require("../../structures/Command"); 3 | const Utils = require("../../utils/Util"); 4 | 5 | module.exports = class WithDraw extends Command { 6 | constructor(client) { 7 | super(client); 8 | this.client = client; 9 | 10 | this.name = "withdraw"; 11 | this.category = "Economy"; 12 | this.description = "Comando para sacar seu dinheiro"; 13 | this.usage = "withdraw "; 14 | this.aliases = ["sacar", "retirar"]; 15 | 16 | this.enabled = true; 17 | this.guildOnly = true; 18 | } 19 | 20 | async run({ message, args, prefix, author }, t) { 21 | User.findOne({ idU: message.author.id }, async (err, user) => { 22 | let coins = parseInt(args[0]); 23 | 24 | if (!args[0]) 25 | return message.reply( 26 | `${message.author}, modo correto de utilizar o comando: **${prefix}sacar **` 27 | ); 28 | 29 | if (["all", "tudo"].includes(args[0].toLowerCase())) { 30 | if (user.bank == 0) { 31 | return message.reply( 32 | `${message.author}, você não possui coins para sacar.` 33 | ); 34 | } else { 35 | message.reply( 36 | `${message.author}, você sacou **${Utils.toAbbrev( 37 | user.bank 38 | )} coins** com sucesso.` 39 | ); 40 | await User.findOneAndUpdate( 41 | { idU: message.author.id }, 42 | { $set: { coins: user.coins + user.bank, bank: 0 } } 43 | ); 44 | } 45 | return; 46 | } 47 | 48 | if (args[0]) { 49 | if (coins < 0) { 50 | return message.reply( 51 | `${message.author}, não é possível retirar menos de 1 coins` 52 | ); 53 | } else if (isNaN(coins)) { 54 | return message.reply( 55 | `${message.author}, modo correto de utilizar o comando: **${prefix}sacar **` 56 | ); 57 | } else if (coins > user.bank) { 58 | return message.reply( 59 | `${message.author}, você não possui essa quantia para sacar.` 60 | ); 61 | } else { 62 | message.reply( 63 | `${message.author}, você sacou **${Utils.toAbbrev( 64 | coins 65 | )} coins** com sucesso.` 66 | ); 67 | await User.findOneAndUpdate( 68 | { idU: message.author.id }, 69 | { $set: { coins: user.coins + coins, bank: user.bank - coins } } 70 | ); 71 | } 72 | } 73 | }); 74 | } 75 | }; 76 | -------------------------------------------------------------------------------- /src/commands/Music/nowplaying.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | const ClientEmbed = require("../../structures/ClientEmbed"); 3 | 4 | module.exports = class NowPlaying extends Command { 5 | constructor(client) { 6 | super(client); 7 | this.client = client; 8 | 9 | this.name = "nowplaying"; 10 | this.category = "Music"; 11 | this.description = "Comando para ver a lista de próximas músicas.."; 12 | this.usage = "nowplaing"; 13 | this.aliases = ["np"]; 14 | 15 | this.enabled = true; 16 | this.guildOnly = true; 17 | } 18 | 19 | async run({ message, args, author }) { 20 | const player = this.client.music.players.get(message.guild.id); 21 | 22 | if (!player) 23 | return message.reply( 24 | `${message.author}, não estou tocando música neste servidor.` 25 | ); 26 | 27 | const track = player.queue.current; 28 | 29 | const EMBED = new ClientEmbed(author) 30 | .setAuthor( 31 | `${message.guild.name} - Tocando Agora`, 32 | message.guild.iconURL({ dynamic: true }) 33 | ) 34 | .setDescription(`Informações da Música que estou tocando agora`) 35 | .addFields( 36 | { 37 | name: `Nome:`, 38 | value: `**[${track.title}](${track.uri})**`, 39 | }, 40 | { 41 | name: `Quem colocou`, 42 | value: this.client.users.cache.get(track.requester.id).tag, 43 | }, 44 | { 45 | name: `Duração`, 46 | value: `\`${this.msToHour( 47 | player.position 48 | )}\` **${this.progressBarEnhanced( 49 | player.position / 1000 / 50, 50 | track.duration / 1000 / 50, 51 | 15 52 | )}** \`${this.msToHour(track.duration)}\``, 53 | } 54 | ); 55 | //.setThumbnail(track.displayThumbnail("maxresdefault")) 56 | 57 | message.reply({embeds: [EMBED]}); 58 | } 59 | msToHour(time) { 60 | time = Math.round(time / 1000); 61 | const s = time % 60, 62 | m = ~~((time / 60) % 60), 63 | h = ~~(time / 60 / 60); 64 | 65 | return h === 0 66 | ? `${String(m).padStart(2, "0")}:${String(s).padStart(2, "0")}` 67 | : `${String(Math.abs(h) % 24).padStart(2, "0")}:${String(m).padStart( 68 | 2, 69 | "0" 70 | )}:${String(s).padStart(2, "0")}`; 71 | } 72 | progressBarEnhanced(current, total, barSize) { 73 | const progress = Math.round((barSize * current) / total); 74 | 75 | return ( 76 | "━".repeat(progress > 0 ? progress - 1 : progress) + 77 | "🔘" + // 78 | "━".repeat(barSize - progress) 79 | ); 80 | } 81 | }; 82 | -------------------------------------------------------------------------------- /src/modules/MuteUtils.js: -------------------------------------------------------------------------------- 1 | const ClientEmbed = require("../structures/ClientEmbed"); 2 | 3 | module.exports = class { 4 | constructor(client) { 5 | this.client = client; 6 | } 7 | 8 | async run() { 9 | this.client.on("ready", async () => { 10 | setInterval(async () => { 11 | await this.VerifyMute(); 12 | }, 10000); 13 | }); 14 | } 15 | 16 | async VerifyMute() { 17 | const list_mutes = await require("mongoose") 18 | .connection.collection("guilds") 19 | .find({ "mutes.has": { $gt: 2 } }) 20 | .toArray(); // Pega todos os servidores que tem alguém mutado; 21 | 22 | if (!list_mutes.length) return; // Se não tiver nenhum mute nos servidores ele para o código; 23 | 24 | const filter = Object.entries(list_mutes).filter(([, x]) => 25 | x.mutes.list.map((f) => f.time <= Date.now()) 26 | ); // Filtra todos os usuários que tem um mute menor que o tempo de agora; 27 | 28 | if (!filter.length) return; // Caso não tenha ninguém para ser desmutado ele para o código; 29 | 30 | const LIST = filter.map(([, x]) => x.idS); // Faz o mapeamento dos servidores que tem alguém com o mute menor que o tempo de agora; 31 | 32 | await this.RemoveMute(LIST); 33 | } 34 | 35 | async RemoveMute(LIST) { 36 | const doc = await this.client.database.guilds.findOne({ idS: LIST }); 37 | 38 | const filter = doc.mutes.list.filter((x) => x.time <= Date.now()); 39 | 40 | const map = filter.map((x) => x.user); 41 | 42 | for (const members of map) { 43 | try { 44 | const guild = await this.client.guilds.fetch(LIST); // Pega o servidor 45 | const member = await guild.members.fetch(members); // Pega o usuário dentro do servidor 46 | const role = guild.roles.cache.find((x) => x.name === "Mutado"); // Pega o cargo mutado no servidor 47 | 48 | member.roles.remove(role, `Membro desmutado automáticamente`); // Parte de remover o cargo do usuário 49 | 50 | await this.UnMute(guild, doc, members); 51 | } catch (err) { 52 | const guild = await this.client.guilds.fetch(LIST); // Pega o servidor 53 | 54 | if (err) await this.UnMute(guild, doc, members); 55 | } 56 | } 57 | } 58 | 59 | async UnMute(guild, doc, members) { 60 | await this.client.database.guilds.findOneAndUpdate( 61 | { idS: guild.id }, 62 | { 63 | $pull: { 64 | "mutes.list": doc.mutes.list.find((x) => x.user === members), 65 | }, 66 | } 67 | ); 68 | if (doc.mutes.list.length - 1 <= 0) 69 | await this.client.database.guilds.findOneAndUpdate( 70 | { idS: guild.id }, 71 | { $set: { "mutes.has": 0 } } 72 | ); 73 | } 74 | }; 75 | -------------------------------------------------------------------------------- /src/commands/Moderation/clear.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | 3 | module.exports = class Clear extends Command { 4 | constructor(client) { 5 | super(client); 6 | this.client = client; 7 | 8 | this.name = "clear"; 9 | this.category = "Moderation"; 10 | this.description = "Comando para limpar o chat"; 11 | this.usage = "clear "; 12 | this.aliases = ["limpar"]; 13 | 14 | this.enabled = true; 15 | this.guildOnly = true; 16 | } 17 | 18 | async run({ message, args, prefix, author }, t) { 19 | if (!message.member.permissions.has("MANAGE_MESSAGES")) 20 | return message.reply( 21 | `${message.author}, você precisa da permissão **MANAGE_MESSAGES* para executar este comando.` 22 | ); 23 | 24 | if (!args[0]) 25 | return message.reply( 26 | `${message.author}, você deve inserir quantas mensagens deseja apagar no chat.` 27 | ); 28 | 29 | const amount = parseInt(args[0]); 30 | 31 | if (amount > 1000 || amount < 2) 32 | return message.reply( 33 | `${message.author}, você deve inserir um número de **2** à **1000** para eu limpar em mensagens.` 34 | ); 35 | 36 | const size = Math.ceil(amount / 100); 37 | 38 | if (size === 1) { 39 | let messages = await message.channel.messages.fetch({ limit: amount }); 40 | 41 | const deleted = await message.channel.bulkDelete(messages, true); 42 | 43 | message.reply( 44 | `${message.author}, ${ 45 | deleted.size < messages.length 46 | ? `limpou o chat. Mas **${ 47 | messages.length - deleted.size 48 | }** mensagens não foram apagadas por terem mais de 14 dias desde o envio` 49 | : `limpou o chat com sucesso.` 50 | }` 51 | ); 52 | } else { 53 | let length = 0; 54 | 55 | for (let i = 0; i < size; i++) { 56 | let messages = await message.channel.messages.fetch({ 57 | limit: i === size.length - 1 ? amount - (pages - 1) * 100 : 100, 58 | }); 59 | 60 | messages = messages.array().filter((x) => x.pinned === false); 61 | 62 | const deleted = await message.channel.bulkDelete(messages, true); 63 | 64 | length += deleted.size; 65 | 66 | if (deleted.size < messages.length) continue; 67 | } 68 | 69 | await message.reply( 70 | `${message.author}, ${ 71 | length < amount 72 | ? `limpou o chat. Mas **${ 73 | amount - length 74 | }** mensagens não foram apagadas por terem mais de 14 dias desde o envio` 75 | : `limpou o chat com sucesso.` 76 | }` 77 | ); 78 | } 79 | } 80 | }; 81 | -------------------------------------------------------------------------------- /src/commands/Minecraft/mcserver.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | const ClientEmbed = require("../../structures/ClientEmbed"); 3 | const Emojis = require("../../utils/Emojis"); 4 | const fetch = require("node-fetch"); 5 | const { MessageAttachment: Attachment } = require("discord.js"); 6 | 7 | module.exports = class McServer extends Command { 8 | constructor(client) { 9 | super(client); 10 | this.client = client; 11 | 12 | this.name = "mcserver"; 13 | this.category = "Minecraft"; 14 | this.description = 15 | "Comando para pegar informações de um servidor de Minecraft."; 16 | this.usage = "mcserver"; 17 | this.aliases = ["mc-server"]; 18 | 19 | this.enabled = true; 20 | this.guildOnly = true; 21 | } 22 | 23 | async run({ message, args, prefix, author }, t) { 24 | const ip = args[0]; 25 | 26 | if (!ip) 27 | return message.reply( 28 | `${message.author}, você deve inserir o IP de um servidor primeiro.` 29 | ); 30 | 31 | const [host, port = 25565] = args[0].split(":"); 32 | const server = await fetch( 33 | `https://mcapi.us/server/status?ip=${host}&port=${port}` 34 | ).then((res) => res.json()); 35 | 36 | if (server.online) { 37 | const EMBED = new ClientEmbed(author) 38 | 39 | .setTitle(`${Emojis.Minecraft} - Minecraft Server Status`) 40 | .addFields( 41 | { 42 | name: `Status do Servidor`, 43 | value: server.online ? "Online" : "Offline", 44 | }, 45 | { 46 | name: `Status dos Players`, 47 | value: `${server.players.now.toLocaleString()}/${server.players.max.toLocaleString()}`, 48 | }, 49 | { 50 | name: `IP`, 51 | value: `\`${host}:${port}\``, 52 | }, 53 | { 54 | name: `MOTD`, 55 | value: server.server.name.replace(/§[0-9a-fk-or]/g, ""), 56 | } 57 | ) 58 | .attachFiles( 59 | new Attachment(this.ImageBanner(server.favicon), "ImageBanner.png") 60 | ) 61 | .setImage(`http://status.mclive.eu/${ip}/${ip}/25565/banner.png`) 62 | .setThumbnail("attachment://ImageBanner.png"); 63 | 64 | return message.reply({embeds: [EMBED]}); 65 | } else { 66 | message.reply( 67 | `${message.author}, o servidor do IP: **${ip}** encontra-se offline ou não existe.` 68 | ); 69 | } 70 | } 71 | 72 | ImageBanner(str) { 73 | if (!str) return "https://i.imgur.com/nZ6nRny.png"; 74 | const matches = str.match(/^data:([A-Za-z-+\/]+);base64,([\s\S]+)/); 75 | if (!matches || matches.length !== 3) return Buffer.from(str, "base64"); 76 | return Buffer.from(matches[2], "base64"); 77 | } 78 | }; 79 | -------------------------------------------------------------------------------- /src/commands/Fun/divorce.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | const Emojis = require("../../utils/Emojis"); 3 | 4 | module.exports = class Divorce extends Command { 5 | constructor(client) { 6 | super(client); 7 | this.client = client; 8 | 9 | this.name = "divorce"; 10 | this.category = "Fun"; 11 | this.description = "Comando para se divorciar."; 12 | this.usage = "divorce"; 13 | this.aliases = ["divorcio"]; 14 | 15 | this.enabled = true; 16 | this.guildOnly = true; 17 | } 18 | 19 | async run({ message, args, prefix, author }, t) { 20 | const doc = await this.client.database.users.findOne({ 21 | idU: message.author.id, 22 | }); 23 | 24 | if (!doc.marry.has) 25 | return message.reply(`${message.author}, você não está casado.`); 26 | 27 | const filter = (reaction, member) => { 28 | return ( 29 | member.id === message.author.id && 30 | [Emojis.Certo, Emojis.Errado].includes(reaction.emoji.name) 31 | ); 32 | }; 33 | message 34 | .reply( 35 | `${ 36 | message.author 37 | }, você deve divorciar do(a) **\`${await this.client.users 38 | .fetch(doc.marry.user) 39 | .then((x) => x.tag)}\`**?` 40 | ) 41 | .then(async (msg) => { 42 | for (let emoji of [Emojis.Certo, Emojis.Errado]) await msg.react(emoji); 43 | 44 | msg 45 | .awaitReactions({ filter: filter, max: 1 }) 46 | .then(async (collected) => { 47 | if (collected.first().emoji.name === Emojis.Certo) { 48 | message.reply( 49 | `${message.author}, você se divorciou com sucesso.` 50 | ); 51 | 52 | await this.client.database.users.findOneAndUpdate( 53 | { idU: message.author.id }, 54 | { 55 | $set: { 56 | "marry.user": "null", 57 | "marry.has": false, 58 | "marry.time": 0, 59 | }, 60 | } 61 | ); 62 | await this.client.database.users.findOneAndUpdate( 63 | { idU: doc.marry.user }, 64 | { 65 | $set: { 66 | "marry.user": "null", 67 | "marry.has": false, 68 | "marry.time": 0, 69 | }, 70 | } 71 | ); 72 | 73 | return msg.delete(); 74 | } 75 | 76 | if (collected.first().emoji.name === Emojis.Errado) { 77 | msg.delete(); 78 | 79 | return message.reply(`${message.author}, divorcio cancelado.`); 80 | } 81 | }); 82 | }); 83 | } 84 | }; 85 | -------------------------------------------------------------------------------- /src/commands/Music/queue.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | const ClientEmbed = require("../../structures/ClientEmbed"); 3 | 4 | module.exports = class Queue extends Command { 5 | constructor(client) { 6 | super(client); 7 | this.client = client; 8 | 9 | this.name = "queue"; 10 | this.category = "Music"; 11 | this.description = "Comando para ver a lista de próximas músicas.."; 12 | this.usage = "queue"; 13 | this.aliases = ["lista"]; 14 | 15 | this.enabled = true; 16 | this.guildOnly = true; 17 | } 18 | 19 | async run({ message, args, author }) { 20 | const player = this.client.music.players.get(message.guild.id); 21 | 22 | if (!player) 23 | return message.reply( 24 | `${message.author}, não estou tocando música neste servidor.` 25 | ); 26 | 27 | const getSongDetails = (pos, pos2) => { 28 | const data = []; 29 | 30 | for (; pos <= pos2 && player.queue[pos]; pos++) { 31 | const requester = player.queue[pos].requester; 32 | data.push( 33 | `**${pos + 1}º** - [${this.shorten(player.queue[pos].title, 25)}](${ 34 | player.queue[pos].uri 35 | }) [${requester}]` 36 | ); 37 | } 38 | return data.join("\n"); 39 | }; 40 | 41 | const QUEUE = new ClientEmbed(author) 42 | .setAuthor( 43 | `PlayList do Servidor [${player.queue.length}]`, 44 | message.guild.iconURL({ dynamic: true }) 45 | ) 46 | .setDescription( 47 | `${ 48 | player.queue.length <= 0 49 | ? `Nenhuma Música na Fila` 50 | : getSongDetails(0, 9) 51 | }\n\n> Tocando Agora: **[${this.shorten(player.queue.current.title)}](${ 52 | player.queue.current.uri 53 | })**\n> Duração da PlayList: **${this.formatTime( 54 | this.convertMilliseconds(player.queue.duration), 55 | `hh:mm:ss` 56 | )}**` 57 | ) 58 | 59 | message.reply({embeds: [QUEUE]}); 60 | } 61 | 62 | shorten(text, size) { 63 | if (typeof text !== "string") return ""; 64 | if (text.length <= size) return text; 65 | return text.substr(0, size).trim() + "..."; 66 | } 67 | convertMilliseconds(ms) { 68 | const seconds = ~~(ms / 1000); 69 | const minutes = ~~(seconds / 60); 70 | const hours = ~~(minutes / 60); 71 | 72 | return { hours: hours % 24, minutes: minutes % 60, seconds: seconds % 60 }; 73 | } 74 | 75 | formatTime(time, format, twoDigits = true) { 76 | const formats = { 77 | dd: "days", 78 | hh: "hours", 79 | mm: "minutes", 80 | ss: "seconds", 81 | }; 82 | 83 | return format.replace(/dd|hh|mm|ss/g, (match) => 84 | time[formats[match]].toString().padStart(twoDigits ? 2 : 0, "0") 85 | ); 86 | } 87 | }; 88 | -------------------------------------------------------------------------------- /src/commands/Miscellaneous/shop.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | const Utils = require("../../utils/Util"); 3 | const User = require("../../database/Schemas/User"); 4 | 5 | module.exports = class Shop extends Command { 6 | constructor(client) { 7 | super(client); 8 | this.client = client; 9 | 10 | this.name = "shop"; 11 | this.category = "Miscellaneous"; 12 | this.description = "Veja seu perfil com este comando"; 13 | this.usage = "shop"; 14 | this.aliases = ["loja"]; 15 | 16 | this.enabled = true; 17 | this.guildOnly = true; 18 | } 19 | 20 | async run({ message, args, prefix, author }, t) { 21 | const doc = await this.client.database.users.findOne({ idU: message.author.id }); 22 | 23 | if (!args[0]) 24 | return message.reply( 25 | `${message.author}, você deve inserir o ID do item que deseja comprar.` 26 | ); 27 | 28 | const itens = await this.client.database.users 29 | .findOne({ idU: message.author.id }) 30 | .then((x) => Object.entries(x.shop.itens)); 31 | 32 | const infoObject = itens.filter(([, x]) => x.id === parseInt(args[0])); 33 | 34 | if (!infoObject.length) 35 | return message.reply( 36 | `${message.author}, o item de ID: **${ 37 | args[0] 38 | }** não existe. Lista dos itens que existem na minha Loja.\n\n${itens 39 | .map(([, x]) => x) 40 | .filter((x) => x != true) 41 | .map( 42 | (x) => 43 | ` > ID: **${x.id}** ( Nome: **${x.name}** )\n> Valor: **\`${x.price}\`**` 44 | ) 45 | .join("\n\n")}` 46 | ); 47 | 48 | const find = infoObject[0][1]; 49 | let size = !args[1] ? 1 : parseInt(args[1]); 50 | 51 | if (find.price > doc.bank) { 52 | return message.reply( 53 | `${message.author}, você não tem dinheiro o suficiente para comprar este item.` 54 | ); 55 | } else { 56 | const updateObject = infoObject.reduce( 57 | (o, [key]) => 58 | Object.assign(o, { 59 | [`shop.itens.${key}.price`]: find.price, 60 | [`shop.itens.${key}.size`]: !size ? 1 : size + find.size, 61 | [`shop.itens.${key}.id`]: find.id, 62 | [`shop.itens.${key}.name`]: find.name, 63 | [`shop.itens.${key}.emoji`]: find.emoji, 64 | }), 65 | {} 66 | ); 67 | 68 | await this.client.database.users.findOneAndUpdate( 69 | { idU: message.author.id }, 70 | { $set: { bank: doc.bank - find.price * size } } 71 | ); 72 | await this.client.database.users.findOneAndUpdate( 73 | { idU: message.author.id }, 74 | updateObject 75 | ); 76 | return message.reply( 77 | `${message.author}, você comprou **${size}x** itens do ID: **${args[0]}** com sucesso.` 78 | ); 79 | } 80 | } 81 | }; 82 | -------------------------------------------------------------------------------- /src/commands/Economy/steal.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | const ClientEmbed = require("../../structures/ClientEmbed"); 3 | const moment = require("moment"); 4 | require("moment-duration-format"); 5 | 6 | module.exports = class Steal extends Command { 7 | constructor(client) { 8 | super(client); 9 | this.client = client; 10 | 11 | this.name = "steal"; 12 | this.category = "Economy"; 13 | this.description = "Comando para roubar membros."; 14 | this.usage = "steal "; 15 | this.aliases = ["roubar"]; 16 | 17 | this.enabled = true; 18 | this.guildOnly = true; 19 | } 20 | 21 | async run({ message, args, prefix, author }, t) { 22 | const USER = 23 | this.client.users.cache.get(args[0]) || message.mentions.users.first(); 24 | 25 | if (!USER) 26 | return message.reply( 27 | `${message.author}, você deve mencionar quem deseja roubar primeiro.` 28 | ); 29 | 30 | if (USER.id === message.author.id) 31 | return message.reply( 32 | `${message.author}, você não pode roubar a si mesmo.` 33 | ); 34 | 35 | const cooldown = 8.64e7; 36 | const user_cd = 1.728e8; 37 | 38 | const target = await this.client.database.users.findOne({ idU: USER.id }); 39 | const doc = await this.client.database.users.findOne({ 40 | idU: message.author.id, 41 | }); 42 | 43 | if (cooldown - (Date.now() - doc.steal.time) > 0) 44 | return message.reply( 45 | `${message.author}, você deve aguardar **${moment 46 | .duration(cooldown - (Date.now() - doc.steal.time)) 47 | .format("h [horas] m [minutos] e s [segundos]") 48 | .replace("minsutos", "minutos")}** até poder roubar novamente.` 49 | ); 50 | 51 | if (user_cd - (Date.now() - target.steal.protection) > 0) 52 | return message.reply( 53 | `${message.author}, o membro está em proteção por **${moment 54 | .duration(user_cd - (Date.now() - target.steal.protection)) 55 | .format("d [dias] h [horas] m [minutos] e s [segundos]") 56 | .replace("minsutos", "minutos")}**.` 57 | ); 58 | 59 | if (target.coins <= 2000) 60 | return message.reply( 61 | `${message.author}, você não pode roubar alguém que tenha **R$2,000** ou menos na carteira.` 62 | ); 63 | 64 | const money = Math.ceil((5 / 100) * target.coins); 65 | 66 | message.reply( 67 | `${message.author}, você roubou com sucesso **R$${money}** do membro.` 68 | ); 69 | 70 | await this.client.database.users.findOneAndUpdate( 71 | { idU: message.author.id }, 72 | { $set: { coins: doc.coins + money, "steal.time": Date.now() } } 73 | ); 74 | await this.client.database.users.findOneAndUpdate( 75 | { idU: USER.id }, 76 | { $set: { coins: target.coins - money, "steal.protection": Date.now() } } 77 | ); 78 | } 79 | }; 80 | -------------------------------------------------------------------------------- /src/commands/Owner/blacklist.js: -------------------------------------------------------------------------------- 1 | const ClientS = require("../../database/Schemas/Client"); 2 | const Command = require("../../structures/Command"); 3 | const ClientEmbed = require("../../structures/ClientEmbed"); 4 | 5 | module.exports = class BlackList extends Command { 6 | constructor(client) { 7 | super(client); 8 | this.client = client; 9 | 10 | this.name = "blacklist"; 11 | this.category = "Owner"; 12 | this.description = "Comando para colocar membros em minha Lista Negra"; 13 | this.usage = "blacklist"; 14 | this.aliases = ["kickar"]; 15 | 16 | this.enabled = true; 17 | this.guildOnly = true; 18 | } 19 | 20 | async run({ message, args, prefix, author }, t) { 21 | if (message.author.id !== process.env.OWNER_ID) return; 22 | 23 | ClientS.findOne({ _id: this.client.user.id }, async (err, cliente) => { 24 | if (args[0] == "list") { 25 | if (!cliente.blacklist.length) { 26 | return message.reply( 27 | `${message.author}, não há nenhum membro em minha **\`Lista Negra\`**.` 28 | ); 29 | } else { 30 | const LIST = new ClientEmbed(author) 31 | .setAuthor( 32 | `${this.client.user.username} - Lista Negra`, 33 | this.client.user.displayAvatarURL() 34 | ) 35 | .addFields({ 36 | name: `Usuários:`, 37 | value: `${cliente.blacklist 38 | .map( 39 | (x) => 40 | `User: **\`${ 41 | this.client.users.cache.get(x).tag 42 | }\`**\nID: **\`${this.client.users.cache.get(x).id}\`**` 43 | ) 44 | .join("\n\n")}`, 45 | }); 46 | 47 | message.reply(LIST); 48 | } 49 | 50 | return; 51 | } 52 | 53 | let member = 54 | this.client.users.cache.get(args[0]) || message.mentions.users.first(); 55 | if (!member) { 56 | return message.reply( 57 | `${message.author}, você deve inserir o ID/mencionar o membro que deseja inserir em minha **\`Lista Negra\`**.` 58 | ); 59 | } else if (cliente.blacklist.find((x) => x == member.id)) { 60 | await ClientS.findOneAndUpdate( 61 | { _id: this.client.user.id }, 62 | { $pull: { blacklist: member.id } } 63 | ); 64 | return message.reply( 65 | `${message.author}, o membro **\`${member.tag}\`** já estava em minha **\`Lista Negra\`** portanto eu removi ele.` 66 | ); 67 | } else { 68 | await ClientS.findOneAndUpdate( 69 | { _id: this.client.user.id }, 70 | { $push: { blacklist: member.id } } 71 | ); 72 | message.reply( 73 | `${message.author}, o membro **\`${member.tag}\`** foi adicionado em minha **\`Lista Negra\`** com sucesso..` 74 | ); 75 | } 76 | }); 77 | } 78 | }; 79 | -------------------------------------------------------------------------------- /src/commands/Config/createCall.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | const ClientEmbed = require("../../structures/ClientEmbed"); 3 | 4 | module.exports = class createCall extends Command { 5 | constructor(client) { 6 | super(client); 7 | this.client = client; 8 | 9 | this.name = "createCall"; 10 | this.category = "Config"; 11 | this.description = "Comando para configurar o sistema de contador em chat"; 12 | this.usage = "createCall"; 13 | this.aliases = ["cc", "create-c", "createcall"]; 14 | this.subcommands = ["list", "set", "status", "info"]; 15 | 16 | this.reference = "createCall"; 17 | 18 | this.enabled = true; 19 | } 20 | async run({ message, args, prefix, author }, t) { 21 | const subs = 22 | args[0] && 23 | this.client.subcommands 24 | .get(this.reference) 25 | .find( 26 | (cmd) => 27 | cmd.name.toLowerCase() === args[0].toLowerCase() || 28 | cmd.aliases.includes(args[0].toLowerCase()) 29 | ); 30 | 31 | let subcmd; 32 | 33 | if (!subs) { 34 | let sub = "null"; 35 | this.client.subcommands 36 | .get(this.reference) 37 | .find( 38 | (cmd) => 39 | cmd.name.toLowerCase() === sub.toLowerCase() || 40 | cmd.aliases.includes(sub.toLowerCase()) 41 | ); 42 | } else subcmd = subs; 43 | 44 | if (subcmd != undefined) 45 | return subcmd.run({ message, args, prefix, author }, t); 46 | 47 | const doc = await this.client.database.guilds.findOne({ 48 | idS: message.guild.id, 49 | }); 50 | 51 | const createC = doc.createCall; 52 | 53 | const category = message.guild.channels.cache.get(createC.category); 54 | const voice = message.guild.channels.cache.get(createC.channel); 55 | 56 | const EMBED = new ClientEmbed(author) 57 | .setDescription( 58 | `> ⭐ | ${message.author}, sistema de criar call privada no servidor.` 59 | ) 60 | .addFields( 61 | { 62 | name: `・Categoria Setada`, 63 | value: !category 64 | ? "Nenhuma Categoria setada" 65 | : `**${category.name}**`, 66 | }, 67 | { 68 | name: `・Canal de Voz setado`, 69 | value: !voice ? "Nenhum Canal setado" : `<#${voice.id}>`, 70 | }, 71 | { 72 | name: `・Status do Sistema`, 73 | value: !createC.status ? "Desativado" : "Ativado", 74 | }, 75 | { 76 | name: `・Comandos do Sistema`, 77 | value: `> **${prefix}createCall list** - Lista as Calls que estão ativas no Servidor.\n> **${prefix}createCall set** - Seta o Canal aonde é criado os canais de voz.`, 78 | } 79 | ) 80 | .setThumbnail( 81 | message.guild.iconURL({ dynamic: true, format: "png", size: 2048 }) 82 | ); 83 | 84 | message.reply({ embeds: [EMBED] }); 85 | } 86 | }; 87 | -------------------------------------------------------------------------------- /src/commands/Owner/shards.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | const AsciiTable = require("ascii-table"), 3 | table = new AsciiTable(`Shards Information`), 4 | unit = ["", "K", "M", "G", "T", "P"]; 5 | const moment = require("moment"); 6 | 7 | module.exports = class Shards extends Command { 8 | constructor(client) { 9 | super(client); 10 | this.client = client; 11 | 12 | this.name = "shards"; 13 | this.category = "Owner"; 14 | this.description = "Comando para ver as informações das Shards do Bot."; 15 | this.usage = "shards"; 16 | this.aliases = []; 17 | 18 | this.enabled = true; 19 | this.guildOnly = true; 20 | } 21 | 22 | async run({ message, args, prefix, author }, t) { 23 | table.setHeading("SID", "UpTime", "Ping", "Usage", "Guilds", "Users"); 24 | 25 | table.setAlign(0, AsciiTable.CENTER); 26 | table.setAlign(1, AsciiTable.CENTER); 27 | table.setAlign(2, AsciiTable.CENTER); 28 | table.setAlign(3, AsciiTable.CENTER); 29 | table.setAlign(4, AsciiTable.CENTER); 30 | table.setAlign(5, AsciiTable.CENTER); 31 | 32 | table.setBorder("|", "-", "+", "+"); 33 | 34 | const uptime = await this.client.shard.broadcastEval("this.uptime"), 35 | ping = await this.client.shard.broadcastEval("Math.round(this.ws.ping)"), 36 | ram = await this.client.shard.broadcastEval("process.memoryUsage().rss"), 37 | guilds = await this.client.shard.broadcastEval("this.guilds.cache.size"), 38 | users = await this.client.shard.broadcastEval("this.users.cache.size"); 39 | 40 | for (let i = 0; i < this.client.shard.count; i++) { 41 | table.addRow( 42 | i, 43 | moment.duration(uptime[i]).format("d[d] h[h] m[m] s[s]"), 44 | "~" + Math.round(ping[i]) + "ms", 45 | this.bytesToSize(ram[i], 2), 46 | guilds[i].toLocaleString("pt-BR"), 47 | users[i].toLocaleString("pt-BR") 48 | ); 49 | } 50 | 51 | const botGuilds = guilds.reduce((prev, val) => prev + val), 52 | botUsers = users.reduce((prev, val) => prev + val), 53 | ramTotal = ram.reduce((prev, val) => prev + val), 54 | pingG = ping.reduce((prev, val) => prev + val), 55 | media = pingG / this.client.shard.count; 56 | 57 | table.addRow("______", "______", "______", "______", "______", "______"); 58 | 59 | table.addRow( 60 | "TOTAL", 61 | "-", 62 | "~" + Math.round(media) + "ms", 63 | this.bytesToSize(ramTotal, 2), 64 | botGuilds.toLocaleString("pt-BR"), 65 | botUsers.toLocaleString("pt-BR") 66 | ); 67 | 68 | message.reply(`\`\`\`prolog\n${table.toString()}\`\`\``); 69 | 70 | table.clearRows(); 71 | } 72 | bytesToSize = (input, precision) => { 73 | let index = Math.floor(Math.log(input) / Math.log(1024)); 74 | if (unit >= unit.length) return input + "B"; 75 | return ( 76 | (input / Math.pow(1024, index)).toFixed(precision) + 77 | " " + 78 | unit[index] + 79 | "B" 80 | ); 81 | }; 82 | }; 83 | -------------------------------------------------------------------------------- /src/modules/ReminderUtils.js: -------------------------------------------------------------------------------- 1 | const ClientEmbed = require("../structures/ClientEmbed"); 2 | 3 | module.exports = class { 4 | constructor(client) { 5 | this.client = client; 6 | } 7 | 8 | async run() { 9 | this.client.on("ready", async () => { 10 | await this.ReminderFilter(); 11 | }); 12 | } 13 | async ReminderFilter() { 14 | setInterval(async () => { 15 | const list_reminders = await require("mongoose") 16 | .connection.collection("users") 17 | .find({ "reminder.has": { $gt: 1 } }) 18 | .toArray(); 19 | 20 | if (!list_reminders) return; 21 | 22 | const list_members = Object.entries(list_reminders).filter(([, x]) => 23 | x.reminder.list.map((x) => x.time <= Date.now()) 24 | ); 25 | const LIST = list_members.map(([, x]) => x.idU); 26 | 27 | await this.ReminderRemove(LIST); 28 | }, 30000); 29 | } 30 | 31 | async ReminderRemove(LIST) { 32 | for (const lista of LIST) { 33 | const doc = await this.client.database.users.findOne({ idU: lista }); 34 | 35 | const EMBED = new ClientEmbed(this.client.user).setTitle(`Lembrete`); 36 | 37 | const list = Object.entries(doc.reminder.list).filter( 38 | ([, x]) => x.time <= Date.now() 39 | ); 40 | const user = await this.client.users.fetch(lista); 41 | 42 | if (!list) return; 43 | 44 | list.map(async ([, x]) => { 45 | // Caso queira que envie no canal que o membro usou o sistema; 46 | 47 | const channel = await this.client.channels 48 | .fetch(x.channel) 49 | .catch(async () => { 50 | return await this.Review(lista, doc, list); 51 | }); 52 | 53 | channel.send(user, EMBED.setDescription(x.lembrete)); 54 | await this.Review(lista, doc, list); 55 | 56 | //============================================================ 57 | 58 | // Caso queira que envie na DM do membro; 59 | 60 | /* 61 | 62 | user.send(EMBED.setDescription(x.lembrete)) 63 | .catch(async () => { 64 | return await this.Review(lista, doc, list); 65 | }); 66 | 67 | await this.Review(lista, doc, list); 68 | 69 | */ 70 | 71 | //============================================================ 72 | }); 73 | } 74 | } 75 | async Review(lista, doc, list) { 76 | list.map(async ([, x]) => { 77 | return await this.client.database.users 78 | .findOneAndUpdate( 79 | { idU: lista }, 80 | { 81 | $pull: { 82 | "reminder.list": doc.reminder.list.find((f) => f.time === x.time), 83 | }, 84 | } 85 | ) 86 | .then(async () => { 87 | const doc = await this.client.database.users.findOne({ idU: lista }); 88 | 89 | if (!doc.reminder.list) return; 90 | await this.client.database.users.findOneAndUpdate( 91 | { idU: lista }, 92 | { $set: { "reminder.has": 0 } } 93 | ); 94 | }); 95 | }); 96 | } 97 | }; 98 | -------------------------------------------------------------------------------- /src/database/Schemas/Guild.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | const Schema = mongoose.Schema; 3 | 4 | let guildSchema = new Schema({ 5 | idS: { type: String }, 6 | prefix: { type: String, default: "!" }, 7 | welcome: { 8 | status: { type: Boolean, default: false }, 9 | channel: { type: String, default: "null" }, 10 | msg: { type: String, default: "null" }, 11 | }, 12 | byebye: { 13 | status: { type: Boolean, default: false }, 14 | channel: { type: String, default: "null" }, 15 | msg: { type: String, default: "null" }, 16 | }, 17 | contador: { 18 | status: { type: Boolean, default: false }, 19 | channel: { type: String, default: "null" }, 20 | msg: { type: String, default: "{contador}" }, 21 | }, 22 | logs: { 23 | channel: { type: String, default: "null" }, 24 | status: { type: Boolean, default: false }, 25 | }, 26 | registrador: { 27 | role: { type: String, default: "null" }, 28 | total: { type: Number, default: 0 }, 29 | }, 30 | autorole: { 31 | status: { type: Boolean, default: false }, 32 | roles: { type: Array, default: [] }, 33 | }, 34 | cmdblock: { 35 | status: { type: Boolean, default: false }, 36 | channels: { type: Array, default: [] }, 37 | cmds: { type: Array, default: [] }, 38 | msg: { type: String, default: "Proibido usar comandos aqui!" }, 39 | }, 40 | serverstats: { 41 | status: { type: Boolean, default: false }, 42 | channels: { 43 | bot: { type: String, default: "null" }, 44 | users: { type: String, default: "null" }, 45 | total: { type: String, default: "null" }, 46 | category: { type: String, default: "null" }, 47 | }, 48 | }, 49 | notification: { 50 | role: { type: String, default: "null" }, 51 | status: { type: Boolean, default: false }, 52 | }, 53 | mutes: { 54 | list: { type: Array, default: [] }, 55 | has: { type: Number, default: 0 }, 56 | }, 57 | 58 | lang: { type: String, default: "pt-BR" }, 59 | ticket: { 60 | guild: { type: String, default: "null" }, 61 | channel: { type: String, default: "null" }, 62 | msg: { type: String, default: "null" }, 63 | size: { type: Number, default: 0 }, 64 | staff: { type: String, default: "null" }, 65 | }, 66 | antinvite: { 67 | msg: { type: String, default: "null" }, 68 | status: { type: Boolean, default: false }, 69 | channels: { type: Array, default: [] }, 70 | roles: { type: Array, default: [] }, 71 | }, 72 | antifake: { 73 | status: { type: Boolean, default: false }, 74 | days: { type: Number, default: 0 }, 75 | }, 76 | infoCall: { 77 | channels: { type: Array, default: [] }, 78 | roles: { type: Array, default: [] }, 79 | }, 80 | youtube: { type: Array, default: [] }, 81 | createCall: { 82 | status: { type: Boolean, default: false }, 83 | category: { type: String, default: "null" }, 84 | channel: { type: String, default: "null" }, 85 | users: { 86 | type: Array, 87 | default: [], 88 | }, 89 | }, 90 | }); 91 | 92 | let Guild = mongoose.model("Guilds", guildSchema); 93 | module.exports = Guild; 94 | -------------------------------------------------------------------------------- /src/commands/Information/botinfo.js: -------------------------------------------------------------------------------- 1 | const User = require("../../database/Schemas/User"); 2 | const Command = require("../../structures/Command"); 3 | const ClientEmbed = require("../../structures/ClientEmbed"); 4 | const moment = require("moment"); 5 | require("moment-duration-format"); 6 | 7 | module.exports = class BotInfo extends Command { 8 | constructor(client) { 9 | super(client); 10 | this.client = client; 11 | 12 | this.name = "botinfo"; 13 | this.category = "Information"; 14 | this.description = "Comando para olhar as informações do Bot."; 15 | this.usage = "botinfo"; 16 | this.aliases = ["b-info"]; 17 | 18 | this.enabled = true; 19 | this.guildOnly = true; 20 | } 21 | 22 | async run({ message, args, prefix, author }, t) { 23 | //===============> Imports <===============// 24 | 25 | const users = this.client.users.cache.size; 26 | const servers = this.client.guilds.cache.size; 27 | const commands = this.client.commands.size; 28 | const uptime = moment 29 | .duration(process.uptime() * 1000) 30 | .format("d[d] h[h] m[m] e s[s]"); 31 | const memory = 32 | (process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2) + "MB"; 33 | const ping = Math.ceil(this.client.ws.ping) + "ms"; 34 | const version = process.version; 35 | const owner = await this.client.users.fetch(process.env.OWNER_ID); 36 | 37 | //===============> Start Request DB <===============// 38 | 39 | const startDB = process.hrtime(); 40 | await User.findOne({ idU: message.author.id }, async (err, user) => { 41 | const coins = user.coins; 42 | }); 43 | 44 | //===============> Finish Request DB <===============// 45 | 46 | const stopDB = process.hrtime(startDB); 47 | const pingDB = Math.round((stopDB[0] * 1e9 + stopDB[1]) / 1e6) + "ms"; 48 | 49 | //===============> Finish <===============// 50 | 51 | const EMBED = new ClientEmbed(author) 52 | 53 | .setAuthor(`Minhas Informações`, this.client.user.displayAvatarURL()) 54 | .addFields( 55 | { 56 | name: "Meu Dono", 57 | value: `**${owner.tag}** || **[${owner.username}](https://github.com/zSpl1nterUS)**`, 58 | }, 59 | { 60 | name: `Informações Principais`, 61 | value: `Usuários do Bot: **${users.toLocaleString()}**\nServidores do Bot: **${servers.toLocaleString()}**\nTotal de Comandos: **${commands}**\nTempo Online: **\`${uptime}\`**`, 62 | }, 63 | { 64 | name: `Mais Informações`, 65 | value: `Ping do Bot: **${ping}**\nPing da DataBase: **${pingDB}**\nTotal de Memória sendo Usado: **${memory}**\nVersão do Node: **${version}**`, 66 | }, 67 | { 68 | name: `Meus Links`, 69 | value: `[Meu Convite](https://discord.com/oauth2/authorize?client_id=788317008050782239&permissions=20887631278&scope=bot)\n[Servidor de Suporte](https://discord.gg/zX8Fq4V)`, 70 | } 71 | ) 72 | .setThumbnail( 73 | this.client.user.displayAvatarURL({ format: "jpg", size: 2048 }) 74 | ); 75 | 76 | message.reply({embeds: [EMBED]}) 77 | } 78 | }; 79 | -------------------------------------------------------------------------------- /src/commands/Owner/manu.js: -------------------------------------------------------------------------------- 1 | const CommandC = require("../../database/Schemas/Command"), 2 | ClientS = require("../../database/Schemas/Client"); 3 | const Command = require("../../structures/Command"); 4 | 5 | module.exports = class Manu extends Command { 6 | constructor(client) { 7 | super(client); 8 | this.client = client; 9 | 10 | this.name = "manu"; 11 | this.category = "Owner"; 12 | this.description = "Comando para colocar outros comandos em manutenção"; 13 | this.usage = "eval "; 14 | this.aliases = ["manu"]; 15 | 16 | this.enabled = true; 17 | this.guildOnly = true; 18 | } 19 | 20 | async run({ message, args, prefix, author }, t) { 21 | if (message.author.id !== process.env.OWNER_ID) return; 22 | 23 | let re = args.slice(2).join(" "); 24 | 25 | let reason; 26 | if (!re) reason = "Não definido"; 27 | else reason = re; 28 | 29 | if (args[0] == "bot") { 30 | ClientS.findOne({ _id: this.client.user.id }, async (err, cliente) => { 31 | if (cliente.manutenção) { 32 | await ClientS.findOneAndUpdate( 33 | { _id: this.client.user.id }, 34 | { $set: { manutenção: false, reason: "" } } 35 | ); 36 | return message.reply( 37 | `${message.author}, fui retirado da manutenção com sucesso.` 38 | ); 39 | } else { 40 | message.reply( 41 | `${message.author}, fui colocado em manutenção com sucesso.\nMotivo: **${reason}**` 42 | ); 43 | await ClientS.findOneAndUpdate( 44 | { _id: this.client.user.id }, 45 | { $set: { manutenção: true, reason: reason } } 46 | ); 47 | } 48 | }); 49 | 50 | return; 51 | } 52 | if (args[0] == "set") { 53 | if (!args[1]) { 54 | return message.reply( 55 | `${message.author}, insira o nome do comando para prosseguir.` 56 | ); 57 | } 58 | 59 | const command = args[1].toLowerCase(); 60 | const cmd = 61 | this.client.commands.get(command) || 62 | this.client.commands.get(this.client.aliases.get(command)); 63 | 64 | const name = cmd.help.name; 65 | 66 | CommandC.findOne({ _id: name }, async (err, comando) => { 67 | if (comando) { 68 | if (comando.manutenção) { 69 | await CommandC.findOneAndUpdate( 70 | { _id: name }, 71 | { $set: { manutenção: false, reason: "" } } 72 | ); 73 | return message.reply( 74 | `${message.author}, retirei o comando **\`${name}\`** da manutenção com sucesso.` 75 | ); 76 | } else { 77 | await CommandC.findOneAndUpdate( 78 | { _id: name }, 79 | { $set: { manutenção: true, reason: reason } } 80 | ); 81 | return message.reply( 82 | `${message.author}, coloquei o comando **\`${name}\`** em manutenção com sucesso.\nMotivo: **${reason}**` 83 | ); 84 | } 85 | } else { 86 | message.reply( 87 | `${message.author}, não encontrei nenhum comando com o nome **\`${name}\`**.` 88 | ); 89 | } 90 | }); 91 | } 92 | } 93 | }; 94 | -------------------------------------------------------------------------------- /src/commands/Moderation/ban.js: -------------------------------------------------------------------------------- 1 | const Discord = require("discord.js"); 2 | const Guild = require("../../database/Schemas/Guild"); 3 | const Command = require("../../structures/Command"); 4 | const ClientEmbed = require("../../structures/ClientEmbed"); 5 | 6 | module.exports = class Ban extends Command { 7 | constructor(client) { 8 | super(client); 9 | this.client = client; 10 | 11 | this.name = "ban"; 12 | this.category = "Moderation"; 13 | this.description = "Comando para banir membros do seu servidor"; 14 | this.usage = "ban <@user> "; 15 | this.aliases = ["banir"]; 16 | 17 | this.enabled = true; 18 | this.guildOnly = true; 19 | } 20 | 21 | async run({ message, args, prefix, author }, t) { 22 | Guild.findOne({ _id: message.guild.id }, async (err, server) => { 23 | if (!message.member.permissions.has("BAN_MEMBERS")) 24 | return message.reply( 25 | `${message.author}, você não tem permissão para banir membros.` 26 | ); 27 | let member = message.guild.member( 28 | message.guild.members.cache.get(args[0]) || 29 | message.mentions.members.first() 30 | ); 31 | 32 | let reason; 33 | if (!args[1]) reason = "Não informado"; 34 | else reason = args.slice(1).join(" "); 35 | 36 | if (!member) { 37 | return message.reply( 38 | `${message.author}, você precisa mencionar/inserir o ID do membro que deseja banir.` 39 | ); 40 | } else if (!member.bannable) { 41 | return message.reply( 42 | `${message.author}, eu não consegui banir o membro, provalvemente ele tem permissões mais altas que a minha.` 43 | ); 44 | } else if (member.id == message.author.id) { 45 | return message.reply(`${message.author}, você não pode si banir.`); 46 | } else { 47 | const BAN = new ClientEmbed(author) 48 | .setAuthor( 49 | `${message.guild.name} - Membro Banido`, 50 | message.guild.iconURL({ dynamic: true }) 51 | ) 52 | .setFooter( 53 | `Comando requisitado por ${message.author.username}`, 54 | message.author.displayAvatarURL({ dynamic: true }) 55 | ) 56 | .setThumbnail( 57 | member.user.displayAvatarURL({ dynamic: true, size: 2048 }) 58 | ) 59 | .addFields( 60 | { 61 | name: "Membro", 62 | value: member.user.tag, 63 | }, 64 | { 65 | name: "ID do Membro", 66 | value: member.id, 67 | }, 68 | { 69 | name: "Author", 70 | value: message.author.tag, 71 | }, 72 | { 73 | name: "ID do Author", 74 | value: message.author.id, 75 | }, 76 | { 77 | name: "Motivo do Ban", 78 | value: reason, 79 | } 80 | ); 81 | 82 | if (!server.logs.status) { 83 | message.reply({ embeds: [BAN] }); 84 | } else { 85 | let channel = message.guild.channels.cache.get(server.logs.channel); 86 | channel.send({ embeds: [BAN] }); 87 | } 88 | 89 | member.ban({ days: 7, reason: reason }); 90 | } 91 | }); 92 | } 93 | }; 94 | -------------------------------------------------------------------------------- /src/commands/Moderation/kick.js: -------------------------------------------------------------------------------- 1 | const Discord = require("discord.js"); 2 | const Guild = require("../../database/Schemas/Guild"); 3 | const Command = require("../../structures/Command"); 4 | const ClientEmbed = require("../../structures/ClientEmbed"); 5 | 6 | module.exports = class Kick extends Command { 7 | constructor(client) { 8 | super(client); 9 | this.client = client; 10 | 11 | this.name = "kick"; 12 | this.category = "Moderation"; 13 | this.description = "Comando para kickar membros do seu servidor"; 14 | this.usage = "kick <@user> "; 15 | this.aliases = ["kickar"]; 16 | 17 | this.enabled = true; 18 | this.guildOnly = true; 19 | } 20 | 21 | async run({ message, args, prefix, author }, t) { 22 | Guild.findOne({ _id: message.guild.id }, async (err, server) => { 23 | if (!message.member.permissions.has("KICK_MEMBERS")) 24 | return message.reply( 25 | `${message.author}, você não tem permissão para kickar membros.` 26 | ); 27 | let member = message.guild.member( 28 | message.guild.members.cache.get(args[0]) || 29 | message.mentions.members.first() 30 | ); 31 | 32 | let reason; 33 | if (!args[1]) reason = "Não informado"; 34 | else reason = args.slice(1).join(" "); 35 | 36 | if (!member) { 37 | return message.reply( 38 | `${message.author}, você precisa mencionar/inserir o ID do membro que deseja kickar.` 39 | ); 40 | } else if (!member.bannable) { 41 | return message.reply( 42 | `${message.author}, eu não consegui kickar o membro, provalvemente ele tem permissões mais altas que a minha.` 43 | ); 44 | } else if (member.id == message.author.id) { 45 | return message.reply(`${message.author}, você não pode si kickar.`); 46 | } else { 47 | const KICK = new ClientEmbed(author) 48 | .setAuthor( 49 | `${message.guild.name} - Membro Kickado`, 50 | message.guild.iconURL({ dynamic: true }) 51 | ) 52 | .setFooter( 53 | `Comando requisitado por ${message.author.username}`, 54 | message.author.displayAvatarURL({ dynamic: true }) 55 | ) 56 | .setThumbnail( 57 | member.user.displayAvatarURL({ dynamic: true, size: 2048 }) 58 | ) 59 | .addFields( 60 | { 61 | name: "Membro", 62 | value: member.user.tag, 63 | }, 64 | { 65 | name: "ID do Membro", 66 | value: member.id, 67 | }, 68 | { 69 | name: "Author", 70 | value: message.author.tag, 71 | }, 72 | { 73 | name: "ID do Author", 74 | value: message.author.id, 75 | }, 76 | { 77 | name: "Motivo do Kick", 78 | value: reason, 79 | } 80 | ); 81 | 82 | if (!server.logs.status) { 83 | message.reply({ embeds: [BAN] }); 84 | } else { 85 | let channel = message.guild.channels.cache.get(server.logs.channel); 86 | channel.send({ embeds: [BAN] }); 87 | } 88 | member.kick({ days: 7, reason: reason }); 89 | } 90 | }); 91 | } 92 | }; 93 | -------------------------------------------------------------------------------- /src/client/listeningIn/guildMemberAdd.js: -------------------------------------------------------------------------------- 1 | const moment = require("moment"); 2 | 3 | function traduzir(number) { 4 | number = number.toString(); 5 | var texto = ``, 6 | numbers = { 7 | 0: "0️⃣", 8 | 1: "1️⃣", 9 | 2: "2️⃣", 10 | 3: "3️⃣", 11 | 4: "4️⃣", 12 | 5: "5️⃣", 13 | 6: "6️⃣", 14 | 7: "7️⃣", 15 | 8: "8️⃣", 16 | 0: "0️⃣", 17 | }; 18 | for (let i = 0; i < number.length; i++) 19 | texto += "" + numbers[parseInt(number[i])] + ""; 20 | return texto; 21 | } 22 | 23 | module.exports = class { 24 | constructor(client) { 25 | this.client = client; 26 | } 27 | 28 | async run(member) { 29 | try { 30 | let guild = member.guild; 31 | 32 | const server = await this.client.database.guilds.findOne({ 33 | idS: guild.id, 34 | }); 35 | 36 | if (server.antifake.status) { 37 | const timeAccount = moment(new Date()).diff( 38 | member.user.createdAt, 39 | "days" 40 | ); 41 | 42 | const minimumDays = server.antifake.days; 43 | 44 | if (timeAccount < minimumDays) { 45 | await member 46 | .kick(`Membro Kickado pelo Sistema de AntiFake`) 47 | .catch(() => {}); 48 | } 49 | } 50 | 51 | if (server.welcome.status) { 52 | this.client.channels.cache.get(server.welcome.channel).send( 53 | server.welcome.msg 54 | .replace(/{member}/g, `<@${member.id}>`) 55 | .replace(/{name}/g, `${member.user.username}`) 56 | .replace(/{total}/g, guild.memberCount) 57 | .replace(/{guildName}/g, guild.name) 58 | ); 59 | } 60 | 61 | if (server.autorole.status) { 62 | member.roles.add(server.autorole.roles, "Sistema de AutoRole"); 63 | } 64 | 65 | if (server.serverstats.status) { 66 | const st = server.serverstats; 67 | const ch = st.channels; 68 | 69 | if (ch.total != "null") { 70 | let channel = guild.channels.cache.get(ch.total); 71 | 72 | channel.setName(`Total: ${guild.memberCount.toLocaleString()}`); 73 | } 74 | 75 | if (ch.bot != "null") { 76 | let channel = guild.channels.cache.get(ch.bot); 77 | 78 | channel.setName( 79 | `Bots: ${guild.members.cache 80 | .filter((x) => x.user.bot) 81 | .size.toLocaleString()}` 82 | ); 83 | } 84 | 85 | if (ch.users != "null") { 86 | let channel = guild.channels.cache.get(ch.users); 87 | 88 | channel.setName( 89 | `Usuários: ${guild.members.cache 90 | .filter((x) => !x.user.bot) 91 | .size.toLocaleString()}` 92 | ); 93 | } 94 | } 95 | 96 | if (server.contador.status) { 97 | this.client.channels.cache 98 | .get(server.contador.channel) 99 | .setTopic( 100 | server.contador.msg.replace( 101 | /{contador}/g, 102 | traduzir(guild.memberCount) 103 | ) 104 | ); 105 | } 106 | } catch (err) { 107 | if (err) console.log(`(ERRO) - guildMemberAdd - ${err}`); 108 | } 109 | } 110 | }; 111 | -------------------------------------------------------------------------------- /src/commands/Miscellaneous/sugestion.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | const Emojis = require("../../utils/Emojis"); 3 | const ClientEmbed = require("../../structures/ClientEmbed"); 4 | const moment = require("moment"); 5 | 6 | module.exports = class Sugestion extends Command { 7 | constructor(client) { 8 | super(client); 9 | this.client = client; 10 | 11 | this.name = "sugestion"; 12 | this.category = "Miscellaneous"; 13 | this.description = "Comando para enviar sugestões."; 14 | this.usage = "sugestion "; 15 | this.aliases = ["sugestão", "sugestao", "sug"]; 16 | 17 | this.enabled = true; 18 | this.guildOnly = true; 19 | } 20 | 21 | async run({ message, args, prefix, author }, t) { 22 | const sug = args.join(" "); 23 | 24 | if (!sug) 25 | return message.reply(`${message.author}, insira a sugestão.`); 26 | 27 | if (sug.length < 20) 28 | return message.reply( 29 | `${message.author}, insira uma sugestão mais completa.` 30 | ); 31 | 32 | message.channel 33 | .send(`${message.author}, você deseja a sugestão para meu desenvolvedor?`) 34 | .then(async (msg) => { 35 | for (let emoji of [Emojis.Certo, Emojis.Errado]) await msg.react(emoji); 36 | 37 | msg 38 | .awaitReactions( 39 | (reaction, member) => 40 | member.id === message.author.id && 41 | [Emojis.Certo, Emojis.Errado].includes(reaction.emoji.name), 42 | { max: 1 } 43 | ) 44 | .then(async (collected) => { 45 | if (collected.first().emoji.name === Emojis.Certo) { 46 | message.reply( 47 | `${message.author}, sugestão enviada com sucesso.` 48 | ); 49 | 50 | const channel = await this.client.channels.fetch( 51 | "791605747980828672" 52 | ); 53 | 54 | const SUGESTION = new ClientEmbed(author) 55 | .setAuthor( 56 | `${message.author.tag} - Sugestão`, 57 | message.author.displayAvatarURL({ dynamic: true }) 58 | ) 59 | .addFields( 60 | { 61 | name: `Conteudo da Sugestão`, 62 | value: sug, 63 | }, 64 | { 65 | name: `Sugestão enviada em`, 66 | value: moment(Date.now()).format("L LT"), 67 | } 68 | ) 69 | .setTimestamp() 70 | .setThumbnail( 71 | message.author.displayAvatarURL({ 72 | dynamic: true, 73 | format: "jpg", 74 | size: 2048, 75 | }) 76 | ); 77 | 78 | channel.send({embeds: [SUGESTION]}).then((x) => { 79 | x.react(Emojis.Certo); 80 | x.react(Emojis.Errado); 81 | }); 82 | 83 | return msg.delete(); 84 | } 85 | 86 | if (collected.first().emoji.name === Emojis.Errado) { 87 | msg.delete(); 88 | 89 | return message.reply( 90 | `${message.author}, envio da sugestão cancelada..` 91 | ); 92 | } 93 | }); 94 | }); 95 | } 96 | }; 97 | -------------------------------------------------------------------------------- /src/commands/Information/serverinfo.js: -------------------------------------------------------------------------------- 1 | const Discord = require("discord.js"); 2 | const moment = require("moment"); 3 | const Command = require("../../structures/Command"); 4 | const ClientEmbed = require("../../structures/ClientEmbed"); 5 | 6 | module.exports = class ServerInfo extends Command { 7 | constructor(client) { 8 | super(client); 9 | this.client = client; 10 | 11 | this.name = "serverinfo"; 12 | this.category = "Information"; 13 | this.description = "Comando para ver informações sobre o servidor"; 14 | this.usage = "serverinfo"; 15 | this.aliases = ["si"]; 16 | 17 | this.enabled = true; 18 | this.guildOnly = true; 19 | } 20 | 21 | async run({ message, args, prefix, author }, t) { 22 | moment.locale("pt-br"); 23 | 24 | try { 25 | let boost = 26 | message.guild.premiumSubscriptionCount === 0 27 | ? "Nenhum Boost" 28 | : `${message.guild.premiumSubscriptionCount} Boost(s) ( Level Server: ${message.guild.premiumTier} )`; 29 | 30 | let channels = [ 31 | `Categoria: ${ 32 | message.guild.channels.cache.filter((x) => x.type == "category").size 33 | }`, 34 | `Texto: ${ 35 | message.guild.channels.cache.filter((x) => x.type == "text").size 36 | }`, 37 | `Voz: ${ 38 | message.guild.channels.cache.filter((x) => x.type == "voice").size 39 | }`, 40 | ].join("\n"); 41 | 42 | const SERVERINFO = new ClientEmbed(author) 43 | .setAuthor(message.guild.name, message.guild.iconURL({ dynamic: true })) 44 | .addFields( 45 | { name: "ID do Servidor:", value: message.guild.id, inline: true }, 46 | { 47 | name: "Propietário:", 48 | value: message.guild.owner.user.tag, 49 | inline: true, 50 | }, 51 | { 52 | name: "Data de Criação:", 53 | value: `${moment(message.guild.createdAt).format("L")} ( ${moment( 54 | message.guild.createdAt 55 | ) 56 | .startOf("day") 57 | .fromNow()} )`, 58 | }, 59 | { 60 | name: "Data da minha Entrada:", 61 | value: `${moment( 62 | message.guild.member(this.client.user.id).joinedAt 63 | ).format("L")} ( ${moment( 64 | message.guild.member(this.client.user.id).joinedAt 65 | ) 66 | .startOf("day") 67 | .fromNow()} )`, 68 | inline: true, 69 | }, 70 | { name: "Boosters", value: boost }, 71 | { 72 | name: "Total de Usuários:", 73 | value: message.guild.memberCount.toLocaleString(), 74 | inline: true, 75 | }, 76 | { 77 | name: "Bots:", 78 | value: message.guild.members.cache 79 | .filter((x) => x.user.bot) 80 | .size.toLocaleString(), 81 | inline: true, 82 | }, 83 | { 84 | name: `Total de Canais: ( **${message.guild.channels.cache.size}** )`, 85 | value: channels, 86 | } 87 | ) 88 | .setThumbnail(message.guild.iconURL({ dynamic: true })); 89 | 90 | message.reply({embeds: [SERVERINFO]}) 91 | } catch (err) { 92 | console.log(`ERRO NO COMANDO SERVERINFO\nERRO: ${err}`); 93 | } 94 | } 95 | }; 96 | -------------------------------------------------------------------------------- /src/commands/Fun/marry.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | const Emojis = require("../../utils/Emojis"); 3 | 4 | module.exports = class Marry extends Command { 5 | constructor(client) { 6 | super(client); 7 | this.client = client; 8 | 9 | this.name = "marry"; 10 | this.category = "Fun"; 11 | this.description = "Comando para casar."; 12 | this.usage = "marry "; 13 | this.aliases = ["casar"]; 14 | 15 | this.enabled = true; 16 | this.guildOnly = true; 17 | } 18 | 19 | async run({ message, args, prefix, author }, t) { 20 | const user = 21 | this.client.users.cache.get(args[0]) || message.mentions.users.first(); 22 | 23 | const doc = await this.client.database.users.findOne({ 24 | idU: message.author.id, 25 | }); 26 | 27 | if (user.id === message.author.id) 28 | return message.reply( 29 | `${message.author}, você não pode casar com si mesmo.` 30 | ); 31 | 32 | if (doc.marry.has) 33 | return message.reply(`${message.author}, você já está casado.`); 34 | 35 | if (!user) 36 | return message.reply( 37 | `${message.author}, você deve mencionar com quem deseja casar.` 38 | ); 39 | 40 | const target = await this.client.database.users.findOne({ idU: user.id }); 41 | 42 | if (target.marry.has) 43 | return message.reply( 44 | `${ 45 | message.author 46 | }, o(a) membro(a) já está casado com o(a) **\`${await this.client.users 47 | .fetch(taraget.marry.user) 48 | .then((x) => x.tag)}\`**.` 49 | ); 50 | 51 | const filter = (reaction, member) => { 52 | return ( 53 | member.id === user.id && 54 | [Emojis.Certo, Emojis.Errado].includes(reaction.emoji.name) 55 | ); 56 | }; 57 | message.reply(`${user}, você deseja se casar com o(a) ${message.author}?`) 58 | .then(async (msg) => { 59 | for (let emoji of [Emojis.Certo, Emojis.Errado]) await msg.react(emoji); 60 | 61 | msg.awaitReactions({ filter: filter, max: 1 }).then(async (collected) => { 62 | if (collected.first().emoji.name === Emojis.Certo) { 63 | message.reply( 64 | `${message.author}, o(a) aceitou seu pedido de casamento, parabéns.` 65 | ); 66 | 67 | await this.client.database.users.findOneAndUpdate( 68 | { idU: message.author.id }, 69 | { 70 | $set: { 71 | "marry.user": user.id, 72 | "marry.has": true, 73 | "marry.time": Date.now(), 74 | }, 75 | } 76 | ); 77 | await this.client.database.users.findOneAndUpdate( 78 | { idU: user.id }, 79 | { 80 | $set: { 81 | "marry.user": message.author.id, 82 | "marry.has": true, 83 | "marry.time": Date.now(), 84 | }, 85 | } 86 | ); 87 | 88 | return msg.delete(); 89 | } 90 | 91 | if (collected.first().emoji.name === Emojis.Errado) { 92 | msg.delete(); 93 | 94 | return message.reply( 95 | `${user}, o(a) recusou seu pedido de casamento.` 96 | ); 97 | } 98 | }); 99 | }); 100 | } 101 | }; 102 | -------------------------------------------------------------------------------- /src/commands/Economy/work.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | const moment = require("moment"); 3 | require("moment-duration-format"); 4 | 5 | module.exports = class Work extends Command { 6 | constructor(client) { 7 | super(client); 8 | this.client = client; 9 | 10 | this.name = "work"; 11 | this.category = "Economy"; 12 | this.description = "Comando para trabalhar"; 13 | this.usage = ""; 14 | this.aliases = ["trabalhar"]; 15 | this.subcommands = ["info", "name"]; 16 | this.reference = "Work"; 17 | 18 | this.enabled = true; 19 | this.guildOnly = true; 20 | } 21 | 22 | async run({ message, args, prefix, author }, t) { 23 | const subs = 24 | args[0] && 25 | this.client.subcommands 26 | .get(this.reference) 27 | .find( 28 | (cmd) => 29 | cmd.name.toLowerCase() === args[0].toLowerCase() || 30 | cmd.aliases.includes(args[0].toLowerCase()) 31 | ); 32 | 33 | let subcmd; 34 | let sub; 35 | 36 | if (!subs) { 37 | sub = "null"; 38 | this.client.subcommands 39 | .get(this.reference) 40 | .find( 41 | (cmd) => 42 | cmd.name.toLowerCase() === sub.toLowerCase() || 43 | cmd.aliases.includes(sub.toLowerCase()) 44 | ); 45 | } else subcmd = subs; 46 | 47 | if (subcmd != undefined) 48 | return subcmd.run({ message, args, prefix, author }, t); 49 | 50 | const user = await this.client.database.users.findOne({ 51 | idU: message.author.id, 52 | }); 53 | 54 | let xp = Math.floor(Math.random() * 50) + 1; 55 | let work = user.work.cooldown; 56 | let cooldown = 2.88e7; 57 | let money = Math.ceil(user.work.level * 2 * user.work.coins + 200); 58 | let nextlevel = user.work.nextLevel * user.work.level; 59 | 60 | if (work !== null && cooldown - (Date.now() - work) > 0) 61 | return message.reply( 62 | `${message.author}, você deve esperar **${moment 63 | .duration(cooldown - (Date.now() - work)) 64 | .format("h [horas], m [minutos] e s [segundos]") 65 | .replace("minsutos", "minutos")}** até poder trabalhar novamente` 66 | ); 67 | 68 | if (user.work.exp + xp > nextlevel) { 69 | message.reply( 70 | `${ 71 | message.author 72 | }, e parabéns sua empresa acaba de subir para o level **${ 73 | user.work.level + 1 74 | }**.` 75 | ); 76 | await this.client.database.users.findOneAndUpdate( 77 | { idU: message.author.id }, 78 | { 79 | $set: { 80 | "work.cooldown": Date.now(), 81 | "work.exp": 0, 82 | coins: user.coins + money, 83 | "work.level": user.work.level + 1, 84 | }, 85 | } 86 | ); 87 | } else { 88 | message.reply( 89 | `${ 90 | message.author 91 | }, você trabalhou com sucesso e obteve **${money.toLocaleString()} coins** e **${xp} de XP**.` 92 | ); 93 | await this.client.database.users.findOneAndUpdate( 94 | { idU: message.author.id }, 95 | { 96 | $set: { 97 | "work.cooldown": Date.now(), 98 | "work.exp": user.work.exp + xp > nextlevel ? 0 : user.work.exp + xp, 99 | coins: user.coins + money, 100 | }, 101 | } 102 | ); 103 | } 104 | } 105 | }; 106 | -------------------------------------------------------------------------------- /src/commands/Registrador/registrar.js: -------------------------------------------------------------------------------- 1 | const Guild = require("../../database/Schemas/Guild"); 2 | const User = require("../../database/Schemas/User"); 3 | const moment = require("moment"); 4 | const Command = require("../../structures/Command"); 5 | 6 | module.exports = class Registrar extends Command { 7 | constructor(client) { 8 | super(client); 9 | this.client = client; 10 | 11 | this.name = "registrar"; 12 | this.category = "Registrador"; 13 | this.description = "Comando para registrar membros em seu servidor."; 14 | this.usage = "registrar"; 15 | this.aliases = []; 16 | 17 | this.enabled = true; 18 | this.guildOnly = true; 19 | } 20 | 21 | async run({ message, args, prefix, author }, t) { 22 | moment.locale("pt-BR"); 23 | 24 | const USER = 25 | message.mentions.users.first() || this.client.users.cache.get(args[0]); 26 | 27 | Guild.findOne({ idS: message.guild.id }, async (err, server) => { 28 | User.findOne( 29 | { idU: message.author.id, idS: message.guild.id }, 30 | async (err, author) => { 31 | if (!message.member.roles.cache.has(server.registrador.role)) 32 | return message.reply( 33 | `${message.author}, você não é um registrador no momento.` 34 | ); 35 | 36 | if (!USER) 37 | return message.reply( 38 | `${message.author}, insira o ID/mencione o membro que deseja registrar.` 39 | ); 40 | 41 | User.findOne( 42 | { idU: USER.id, idS: message.guild.id }, 43 | async (err, user) => { 44 | if (!user) { 45 | return message.reply( 46 | `${message.author}, o membro **\`${USER.tag}\`** não está registrado em meu **Banco de Dados** no momento.` 47 | ); 48 | } else if (user.registrador.registred) { 49 | return message.reply( 50 | `${message.author}, este membro já se encontra registrado.` 51 | ); 52 | } else { 53 | message.reply( 54 | `${message.author}, você verificou o usuário **\`${ 55 | USER.tag 56 | }\`** com sucesso. ( **${ 57 | author.registrador.registreds + 1 58 | } registrados** )` 59 | ); 60 | await User.findOneAndUpdate( 61 | { idU: message.author.id, idS: message.guild.id }, 62 | { 63 | $set: { 64 | "registrador.registreds": 65 | author.registrador.registreds + 1, 66 | }, 67 | } 68 | ); 69 | await User.findOneAndUpdate( 70 | { idU: USER.id, idS: message.guild.id }, 71 | { 72 | $set: { 73 | "registrador.registredBy": message.author.id, 74 | "registrador.registredDate": Date.now(), 75 | "registrador.registred": true, 76 | }, 77 | } 78 | ); 79 | await Guild.findOneAndUpdate( 80 | { idS: message.guild.id }, 81 | { 82 | $set: { "registrador.total": server.registrador.total + 1 }, 83 | } 84 | ); 85 | } 86 | } 87 | ); 88 | } 89 | ); 90 | }); 91 | } 92 | }; 93 | -------------------------------------------------------------------------------- /src/commands/Owner/vip.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | const ms = require("ms"); 3 | const Emojis = require("../../utils/Emojis"); 4 | const moment = require("moment"); 5 | require("moment-duration-format"); 6 | 7 | module.exports = class Vip extends Command { 8 | constructor(client) { 9 | super(client); 10 | this.client = client; 11 | 12 | this.name = "vip"; 13 | this.category = "Owner"; 14 | this.description = "Comando para adicionar VIP aos usuários."; 15 | this.usage = "vip"; 16 | this.aliases = []; 17 | 18 | this.enabled = true; 19 | this.guildOnly = true; 20 | } 21 | 22 | async run({ message, args, prefix, author }, t) { 23 | moment.locale("pt-BR"); 24 | 25 | const USER = 26 | this.client.users.cache.get(args[1]) || 27 | message.mentions.users.first() || 28 | message.author; 29 | 30 | const user = await this.client.database.users.findOne({ idU: USER.id }); 31 | 32 | const vip = user.vip; 33 | 34 | if (!args[0]) { 35 | if (!vip.hasVip) { 36 | return message.reply( 37 | `${Emojis.Errado} - ${message.author}, você não possui VIP.` 38 | ); 39 | } else { 40 | if (vip.date <= Date.now()) 41 | return message.reply( 42 | `${message.author}, seu VIP expirou e será removido em instantes.` 43 | ); 44 | 45 | message.reply( 46 | `${Emojis.Certo} - ${ 47 | message.author 48 | }, você possui VIP pelo tempo dê:\n\n> **${moment 49 | .duration(vip.date - Date.now()) 50 | .format( 51 | "y [anos] M [meses] d [dias] h [horas] m [minutos] e s [segundos]" 52 | ) 53 | .replace("minsutos", "minutos")}** ( ${moment(vip.date).format( 54 | "LLL" 55 | )} )` 56 | ); 57 | } 58 | return; 59 | } 60 | 61 | if (message.author.id !== "600804786492932101") return; 62 | 63 | if (["add", "adicionar", "setar"].includes(args[0].toLowerCase())) { 64 | if (!USER) { 65 | return message.reply( 66 | `${Emojis.Errado} - ${message.author}, você deve mencionar/inserir o ID de quem deseja setar VIP.` 67 | ); 68 | } else if (!args[1]) { 69 | return message.reply( 70 | `${Emojis.Errado} - ${message.author}, você deve inserir quando tempo deseja setar de VIP no usuário.` 71 | ); 72 | } 73 | 74 | let time = ms(args[2]); 75 | 76 | if (String(time) == "undefined") { 77 | return message.reply( 78 | `${Emojis.Errado} - ${message.author}, a data inserida é inválida.` 79 | ); 80 | } else { 81 | if (vip.hasVip) { 82 | message.reply( 83 | `${Emojis.Certo} - ${message.author}, o membro já possuia VIP, portanto adicionei mais tempo ao VIP dele.` 84 | ); 85 | return await this.client.database.users.findOneAndUpdate( 86 | { idU: USER.id }, 87 | { $set: { "vip.date": vip.date + time } } 88 | ); 89 | } else { 90 | message.reply( 91 | `${Emojis.Certo} - ${message.author}, agora o membro possui VIP.` 92 | ); 93 | await this.client.database.users.findOneAndUpdate( 94 | { idU: USER.id }, 95 | { $set: { "vip.date": Date.now() + time, "vip.hasVip": true } } 96 | ); 97 | } 98 | } 99 | } 100 | } 101 | }; 102 | -------------------------------------------------------------------------------- /src/commands/Miscellaneous/upvote.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | const ClientEmbed = require("../../structures/ClientEmbed"); 3 | const moment = require("moment"); 4 | require("moment-duration-format"); 5 | 6 | module.exports = class upVote extends Command { 7 | constructor(client) { 8 | super(client); 9 | this.client = client; 10 | 11 | this.name = "upvote"; 12 | this.category = "Miscellaneous"; 13 | this.description = "Comando para votar no Bot."; 14 | this.usage = "upvote"; 15 | this.aliases = ["votar", "vote"]; 16 | 17 | this.enabled = true; 18 | this.guildOnly = true; 19 | } 20 | 21 | async run({ message, args, prefix, author }, t) { 22 | if (!args[0]) { 23 | const user = await this.client.database.users.findOne({ 24 | idU: message.author.id, 25 | }); 26 | 27 | let daily = user.upvote.cooldown; 28 | let cooldown = 8.64e7; 29 | let time = cooldown - (Date.now() - daily); 30 | let atual = user.coins; 31 | 32 | if (daily !== null && cooldown - (Date.now() - daily) > 0) { 33 | return message.reply( 34 | `${message.author}, aguarde **${moment 35 | .duration(time) 36 | .format("h [horas] m [minutos] e s [segundos]") 37 | .replace("minsutos", "minutos")}** até poder votar novamente.` 38 | ); 39 | } else { 40 | message.reply( 41 | `${ 42 | message.author 43 | } você votou no Bot com sucesso. Informações abaixo:\n\n> Quantidade de Votos que você tem no Total agora: **${ 44 | user.upvote.count + 1 45 | }**\n> Dinheiro ganho com o Voto: **R$${ 46 | (user.upvote.count + 1) * 100 47 | }**` 48 | ); 49 | 50 | await this.client.database.users.findOneAndUpdate( 51 | { idU: message.author.id }, 52 | { 53 | $set: { 54 | coins: atual + (user.upvote.count + 1) * 100, 55 | "upvote.cooldown": Date.now(), 56 | "upvote.count": user.upvote.count + 1, 57 | }, 58 | } 59 | ); 60 | } 61 | } 62 | 63 | if (["rank", "top"].includes(args[0].toLowerCase())) { 64 | const rank = await require("mongoose") 65 | .connection.collection("users") 66 | .find({ "upvote.count": { $gt: 0 } }) 67 | .toArray(); 68 | 69 | const members = []; 70 | const users = Object.entries(rank).map(([, x]) => x.idU); 71 | 72 | await this.PUSH(members, users); 73 | 74 | const votesMap = members 75 | .map((x) => x) 76 | .sort((x, f) => f.votes - x.votes) 77 | .slice(0, 10); 78 | 79 | const EMBED = new ClientEmbed(author) 80 | .setTitle(`Ranking de Votos`) 81 | .setDescription( 82 | votesMap 83 | .map( 84 | (x) => 85 | `**${x.user.tag}** - Votos: **\`${x.votes}\`**\nID: \`${x.user.id}\`` 86 | ) 87 | .join("\n\n") 88 | ); 89 | 90 | return message.reply({embeds: [EMBED]}); 91 | } 92 | } 93 | 94 | async PUSH(members, users) { 95 | for (const member of users) { 96 | const doc = await this.client.database.users.findOne({ idU: member }); 97 | 98 | members.push({ 99 | user: await this.client.users.fetch(member).then((user) => { 100 | return user; 101 | }), 102 | votes: doc.upvote.count, 103 | }); 104 | } 105 | } 106 | }; 107 | -------------------------------------------------------------------------------- /src/commands/Miscellaneous/anime.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | const malScraper = require("mal-scraper"); 3 | const translate = require("@iamtraction/google-translate"); 4 | const moment = require("moment"); 5 | const ClientEmbed = require("../../structures/ClientEmbed"); 6 | 7 | module.exports = class Anime extends Command { 8 | constructor(client) { 9 | super(client); 10 | this.client = client; 11 | 12 | this.name = "anime"; 13 | this.category = "Miscellaneous"; 14 | this.description = "Faça uma pesquisa sobre o Anime desejado."; 15 | this.usage = "anime "; 16 | this.aliases = []; 17 | 18 | this.enabled = true; 19 | this.guildOnly = true; 20 | } 21 | 22 | async run({ message, args, prefix, author, language }, t) { 23 | const search = args.join(" "); 24 | 25 | if (!search) 26 | return message.reply( 27 | `${message.author}, insira o nome do anime que deseja pesquisar.` 28 | ); 29 | 30 | const data = await malScraper.getInfoFromName(search); 31 | 32 | const trad = await translate(data.synopsis, { 33 | to: language.slice(0, 2), 34 | }); 35 | 36 | const date = data.aired.split(" to ").map((x) => x.replace(",", "")); 37 | 38 | const ANIME = new ClientEmbed(author) 39 | .setDescription( 40 | `**[${data.title}](${data.url})**\n${ 41 | trad.text.length > 900 ? trad.text.slice(0, 900) + "..." : trad.text 42 | }` 43 | ) 44 | .setThumbnail(data.picture) 45 | .addFields( 46 | { 47 | name: `Episódios`, 48 | value: data.episodes.toLocaleString(), 49 | inline: true, 50 | }, 51 | { 52 | name: `Tipo do Anime`, 53 | value: data.type, 54 | inline: true, 55 | }, 56 | { 57 | name: `Rank do Anime`, 58 | value: data.ranked, 59 | inline: true, 60 | }, 61 | { 62 | name: `Popularidade do Anime`, 63 | value: data.popularity, 64 | inline: true, 65 | }, 66 | { 67 | name: `Status do Anime`, 68 | value: data.status 69 | .replace("Finished Airing", "Finalizado") 70 | .replace("Currently Airing", "Finalizado"), 71 | inline: true, 72 | }, 73 | { 74 | name: `Categoria do Anime`, 75 | value: data.source, 76 | inline: true, 77 | }, 78 | { 79 | name: `Informações sobre Lançamento`, 80 | value: 81 | date[1] == "?" || !date[1] 82 | ? `**${moment(new Date(date[0])).format("L")}**` 83 | : `**${moment(new Date(date[0])).format("L")}** - **${moment( 84 | new Date(date[1]) 85 | ).format("L")}**`, 86 | inline: true, 87 | }, 88 | { 89 | name: `Duração por Episódio`, 90 | value: data.duration.replace(". per ep", ""), 91 | inline: true, 92 | }, 93 | { 94 | name: `Gêneros do Anime`, 95 | value: data.genres.map((x) => x).join(", "), 96 | inline: false, 97 | }, 98 | { 99 | name: `Avaliação do Anime`, 100 | value: data.score, 101 | inline: true, 102 | } 103 | ); 104 | 105 | if (data.trailer != undefined) 106 | ANIME.addField( 107 | `Trailer do Anime`, 108 | `**[Clique Aqui](${data.trailer})**`, 109 | true 110 | ); 111 | 112 | message.reply({embeds: [ANIME]}).catch((err) => { 113 | console.log(err); 114 | return message.reply(`${message.author}, anime não encontrado.`); 115 | }); 116 | } 117 | }; 118 | -------------------------------------------------------------------------------- /src/commands/Config/notification.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed, Message } = require("discord.js"); 2 | const Command = require("../../structures/Command"); 3 | 4 | module.exports = class Notification extends Command { 5 | constructor(client) { 6 | super(client); 7 | this.client = client; 8 | 9 | this.name = "notification"; 10 | this.category = "Config"; 11 | this.description = "Sistema de Notificação do Bot"; 12 | this.usage = "notification"; 13 | this.aliases = ["notificação", "notf"]; 14 | 15 | this.enabled = true; 16 | this.guildOnly = true; 17 | } 18 | 19 | async run({ message, args, prefix, author }, t) { 20 | const doc = await this.client.database.guilds.findOne({ idS: message.guild.id }); 21 | 22 | if (!args[0]) { 23 | if (!doc.notification.status) { 24 | return message.reply( 25 | `${message.author}, este sistema não se encontra ativado no servidor.` 26 | ); 27 | } else if (message.member.roles.cache.has(doc.notification.role)) { 28 | message.reply( 29 | `${message.author}, você já tinha este cargo, portanto eu removi ele.` 30 | ); 31 | return message.member.roles.remove(doc.notification.role); 32 | } else { 33 | message.reply( 34 | `${message.author}, cargo adicionado com sucesso..` 35 | ); 36 | return message.member.roles.add(doc.notification.role); 37 | } 38 | } 39 | 40 | if (["setar", "set", "cargo", "role"].includes(args[0].toLowerCase())) { 41 | const role = 42 | message.mentions.roles.first() || 43 | message.guild.roles.cache.get(args[1]); 44 | 45 | if (!role) { 46 | return message.reply( 47 | `${message.author}, você deve mencionar qual cargo deseja setar.` 48 | ); 49 | } else if (role.id == doc.notification.role) { 50 | message.reply( 51 | `${message.author}, o cargo inserido é o mesmo setado atualmente, portanto eu removi ele.` 52 | ); 53 | return await this.client.database.guilds.findOneAndUpdate( 54 | { idS: message.guild.id }, 55 | { 56 | $set: { "notification.role": "null", "notification.status": false }, 57 | } 58 | ); 59 | } else { 60 | message.reply( 61 | `${message.author}, ok, cargo alterado com sucesso.` 62 | ); 63 | await this.client.database.guilds.findOneAndUpdate( 64 | { idS: message.guild.id }, 65 | { 66 | $set: { "notification.role": role.id, "notification.status": true }, 67 | } 68 | ); 69 | } 70 | } 71 | 72 | if (args[0] == "on") { 73 | if (doc.notification.status) { 74 | return message.reply( 75 | `${message.author}, o sistema já se encontra ativado.` 76 | ); 77 | } else { 78 | message.reply( 79 | `${message.author}, sistema de notificação ativado com sucesso.` 80 | ); 81 | await this.client.database.guilds.findOneAndUpdate( 82 | { idS: message.guild.id }, 83 | { $set: { "notification.status": true } } 84 | ); 85 | } 86 | return; 87 | } 88 | 89 | if (args[0] == "off") { 90 | if (!doc.notification.status) { 91 | return message.reply( 92 | `${message.author}, o sistema já se encontra desativado.` 93 | ); 94 | } else { 95 | message.reply( 96 | `${message.author}, sistema de notificação desativado com sucesso.` 97 | ); 98 | await this.client.database.guilds.findOneAndUpdate( 99 | { idS: message.guild.id }, 100 | { $set: { "notification.status": false } } 101 | ); 102 | } 103 | return; 104 | } 105 | } 106 | }; 107 | -------------------------------------------------------------------------------- /src/commands/Information/help.js: -------------------------------------------------------------------------------- 1 | const Guild = require("../../database/Schemas/Guild"), 2 | CommandC = require("../../database/Schemas/Command"); 3 | const Command = require("../../structures/Command"); 4 | const ClientEmbed = require("../../structures/ClientEmbed"); 5 | 6 | module.exports = class Help extends Command { 7 | constructor(client) { 8 | super(client); 9 | this.client = client; 10 | 11 | this.name = "help"; 12 | this.category = "Information"; 13 | this.description = "Comando para ver informações dos comandos do bot"; 14 | this.usage = "help"; 15 | this.aliases = ["ajuda"]; 16 | 17 | this.enabled = true; 18 | this.guildOnly = true; 19 | } 20 | 21 | async run({ message, args, prefix, author }, t) { 22 | const { commands } = message.client; 23 | 24 | const AJUDA = new ClientEmbed(author) 25 | .setAuthor( 26 | `${t("commands:help.title")}`, 27 | this.client.user.displayAvatarURL({ size: 2048 }) 28 | ) 29 | .setFooter( 30 | `Comando requisitado por ${message.author.username}`, 31 | message.author.displayAvatarURL({ dynamic: true }) 32 | ) 33 | .setThumbnail(this.client.user.displayAvatarURL({ size: 2048 })); 34 | 35 | if (args[0]) { 36 | CommandC.findOne({ _id: args[0].toLowerCase() }, async (err, cmd) => { 37 | const name = args[0].toLowerCase(); 38 | const comando = 39 | commands.get(name) || 40 | commands.find((cmd) => cmd.aliases && cmd.aliases.includes(name)); 41 | 42 | if (!comando) { 43 | return message.reply( 44 | `${message.author}, não achei nenhum comando com o nome/aliases **\`${name}\`**.` 45 | ); 46 | } 47 | 48 | AJUDA.addField(`Comando:`, comando.name); 49 | 50 | if (comando.aliases) 51 | AJUDA.addField( 52 | `Aliases`, 53 | !comando.aliases.length 54 | ? "Não tem Aliases" 55 | : comando.aliases.join(", ") 56 | ); 57 | if (comando.description) 58 | AJUDA.addField( 59 | `Descrição`, 60 | !comando.description.length 61 | ? "Não tem Descrição" 62 | : comando.description 63 | ); 64 | AJUDA.addField( 65 | `Usos`, 66 | !cmd 67 | ? "Comando não registrado" 68 | : cmd.usages == 0 69 | ? "Nenhum Uso" 70 | : cmd.usages 71 | ); 72 | if (comando.usage) AJUDA.addField(`Modo de Uso`, comando.usage); 73 | 74 | message.reply(AJUDA); 75 | }); 76 | } else { 77 | const HELP = new ClientEmbed(author) 78 | .setAuthor( 79 | `Central de Ajuda do Bot`, 80 | this.client.user.displayAvatarURL({ size: 2048 }) 81 | ) 82 | .setDescription( 83 | `**${message.author.username}**, lista de todos os meus comandos.\nCaso queira saber mais sobre algum use **${prefix}help **.\nTotal de **${this.client.commands.size}** comandos.` 84 | ) 85 | .setFooter( 86 | `Comando requisitado por ${message.author.username}`, 87 | message.author.displayAvatarURL({ dynamic: true }) 88 | ) 89 | .setThumbnail(this.client.user.displayAvatarURL({ size: 2048 })); 90 | 91 | const categories = commands 92 | .map((x) => x.category) 93 | .filter((x, f, y) => y.indexOf(x) === f); 94 | 95 | categories.forEach(async (category) => { 96 | const comandos = commands 97 | .filter((x) => x.category === category) 98 | .sort((a, b) => a.name.localeCompare(b.name)) 99 | .map((f) => `\`${f.name}\``) 100 | .join("**, **"); 101 | 102 | HELP.addField(category, comandos || `Nenhum Comando`, false); 103 | }); 104 | 105 | message.reply({embeds: [HELP]}) 106 | } 107 | } 108 | }; 109 | -------------------------------------------------------------------------------- /src/commands/Config/antifake.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | const ClientEmbed = require("../../structures/ClientEmbed"); 3 | 4 | module.exports = class AntiFake extends Command { 5 | constructor(client) { 6 | super(client); 7 | this.client = client; 8 | 9 | this.name = "antifake"; 10 | this.category = "Config"; 11 | this.description = "Comando para configurar o sistema de AntiFake do Bot."; 12 | this.usage = "antifake"; 13 | this.aliases = ["a-fake", "ant-f", "af"]; 14 | 15 | this.enabled = true; 16 | this.guildOnly = true; 17 | } 18 | 19 | async run({ message, args, prefix, author }, t) { 20 | const doc = await this.client.database.guilds.findOne({ 21 | idS: message.guild.id, 22 | }); 23 | 24 | if (!message.member.permissions.has("MANAGE_GUILD")) 25 | return message.reply( 26 | `${message.author}, você não tem permissão de executar este comando.` 27 | ); 28 | 29 | const anti = doc.antifake; 30 | 31 | const EMBED = new ClientEmbed(author) 32 | .setAuthor( 33 | `${message.guild.name} | AntiFake`, 34 | message.guild.iconURL({ dynamic: true }) 35 | ) 36 | .addFields( 37 | { 38 | name: `Status do Sistema`, 39 | value: `O sistema se encontra **${ 40 | !anti.status ? "DESATIVADO" : "ATIVADO" 41 | }**`, 42 | }, 43 | { 44 | name: `Dias de criação para Kickar`, 45 | value: anti.days <= 0 ? "Não Inserido" : `**${anti.days}** dias.`, 46 | } 47 | ); 48 | 49 | if (!args[0]) return message.reply({embeds: [EMBED]}) // message.reply({embeds: [EMBED]}); 50 | 51 | if (["dias", "days", "setar"].includes(args[0].toLowerCase())) { 52 | const days = parseInt(args[1]); 53 | 54 | if (!args[1] || isNaN(args[1])) 55 | return message.reply( 56 | `${message.author}, insira quantos dias deseja para eu kickar contas com o tempo de criação menor que o mesmo inserido.` 57 | ); 58 | 59 | if (days < 1 || days > 30) 60 | return message.reply( 61 | `${message.author}, você não pode inserir dias menos que 1 e maiores que 30!` 62 | ); 63 | 64 | if (anti.days === days) 65 | return message.reply( 66 | `${message.author}, a quantidade de dias inserido é o mesmo setado atualmente.` 67 | ); 68 | 69 | message.reply( 70 | `${message.author}, quantidade de dias alterado com sucesso.` 71 | ); 72 | 73 | await this.client.database.guilds.findOneAndUpdate( 74 | { idS: message.guild.id }, 75 | { $set: { "antifake.days": days } } 76 | ); 77 | 78 | return; 79 | } 80 | 81 | if (["on", "ligar", "ativar"].includes(args[0].toLowerCase())) { 82 | if (anti.days <= 1) 83 | return message.reply( 84 | `${message.author}, não é possível ativar o sistema sem a quantidade de dias estar setado.` 85 | ); 86 | 87 | if (anti.status) 88 | return message.reply( 89 | `${message.author}, o sistema já se encontrado ativado.` 90 | ); 91 | 92 | message.reply( 93 | `${message.author}, o sistema foi ativado com sucesso.` 94 | ); 95 | await this.client.database.guilds.findOneAndUpdate( 96 | { idS: message.guild.id }, 97 | { $set: { "antifake.status": true } } 98 | ); 99 | 100 | return; 101 | } 102 | 103 | if (["off", "desligar", "desativar"].includes(args[0].toLowerCase())) { 104 | if (!anti.status) 105 | return message.reply( 106 | `${message.author}, o sistema já se encontrado desativado.` 107 | ); 108 | 109 | message.reply( 110 | `${message.author}, o sistema foi desativado com sucesso.` 111 | ); 112 | await this.client.database.guilds.findOneAndUpdate( 113 | { idS: message.guild.id }, 114 | { $set: { "antifake.status": false } } 115 | ); 116 | 117 | return; 118 | } 119 | } 120 | }; 121 | -------------------------------------------------------------------------------- /src/commands/Miscellaneous/infoCall.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | const ClientEmbed = require("../../structures/ClientEmbed"); 3 | const moment = require("moment"); 4 | require("moment-duration-format"); 5 | const Collection = require("../../services/Collection"); 6 | const Emojis = require("../../utils/Emojis"); 7 | 8 | module.exports = class infoCall extends Command { 9 | constructor(client) { 10 | super(client); 11 | this.client = client; 12 | 13 | this.name = "infoCall"; 14 | this.category = "Miscellaneous"; 15 | this.description = 16 | "Configure e Veja suas informações do contador de tempo em Call"; 17 | this.usage = "infocall"; 18 | this.aliases = ["info-call", "i-c", "i-call", "info-c", "ic"]; 19 | 20 | this.enabled = true; 21 | this.guildOnly = true; 22 | } 23 | 24 | async run({ message, args, prefix, author }, t) { 25 | const USER = 26 | this.client.users.cache.get(args[0]) || 27 | message.mentions.users.first() || 28 | message.author; 29 | 30 | const doc = await this.client.database.users.findOne({ 31 | idU: USER.id, 32 | }); 33 | 34 | if (args[0] == "status" || args[0] == "stts") { 35 | const doc1 = await this.client.database.users.findOne({ 36 | idU: message.author.id, 37 | }); 38 | 39 | if (doc1.infoCall.status) { 40 | message.reply( 41 | `${message.author}, o sistema estava ligado na sua conta portanto eu desativei.` 42 | ); 43 | await this.client.database.users.findOneAndUpdate( 44 | { idU: message.author.id }, 45 | { $set: { "infoCall.status": false } } 46 | ); 47 | } else { 48 | message.reply( 49 | `${message.author}, o sistema estava desligado na sua conta portanto eu ativei.` 50 | ); 51 | await this.client.database.users.findOneAndUpdate( 52 | { idU: message.author.id }, 53 | { $set: { "infoCall.status": true } } 54 | ); 55 | } 56 | 57 | return; 58 | } 59 | 60 | 61 | if (doc.infoCall.lastRegister <= 0) 62 | return message.reply( 63 | `${message.author}, o membro nunca ficou em call.` 64 | ); 65 | 66 | const EMBED = new ClientEmbed(USER) 67 | .setAuthor( 68 | `${USER.tag} - Contador de Tempo em Call`, 69 | USER.displayAvatarURL({ dynamic: true }) 70 | ) 71 | .setThumbnail( 72 | USER.displayAvatarURL({ dynamic: true, format: "jpg", size: 2048 }) 73 | ) 74 | .setDescription( 75 | `${message.author}, você está vendo as informações da conta **${USER.tag}**.` 76 | ) 77 | .addFields( 78 | { 79 | name: `Status do Sistema na Conta`, 80 | value: `O Sistema se encontrado **${ 81 | doc.infoCall.status ? "ATIVADO" : "DESATIVADO" 82 | }** na conta do Membro.`, 83 | }, 84 | { 85 | name: `Tempo na Última Call`, 86 | value: `**${moment 87 | .duration(doc.infoCall.lastRegister) 88 | .format("d [dias] h [horas] m [minutos] e s [segundos]") 89 | .replace("minsutos", "minutos")}**`, 90 | }, 91 | { 92 | name: `Tempo total nas Calls`, 93 | value: `**${moment 94 | .duration(doc.infoCall.totalCall) 95 | .format("M [meses] d [dias] h [horas] m [minutos] e s [segundos]") 96 | .replace("minsutos", "minutos")}**`, 97 | }, 98 | { 99 | name: `Como Ativar/Desativar o Sistema`, 100 | value: `> Para Ativar ou Desativar o Sistema na sua Conta use **${prefix}info-call status**.`, 101 | } 102 | ); 103 | 104 | message.reply({embeds: [EMBED]}) 105 | } 106 | async PUSH(call, members) { 107 | for (const member of call) { 108 | const doc = await this.client.database.users.findOne({ idU: member }); 109 | 110 | members.push({ 111 | user: await this.client.users.fetch(member).then((user) => { 112 | return user; 113 | }), 114 | callTime: doc.infoCall.totalCall, 115 | }); 116 | } 117 | } 118 | }; 119 | -------------------------------------------------------------------------------- /src/commands/Config/logs.js: -------------------------------------------------------------------------------- 1 | const Guild = require("../../database/Schemas/Guild"); 2 | const { MessageEmbed, Message } = require("discord.js"); 3 | const Emojis = require("../../utils/Emojis"); 4 | const Command = require("../../structures/Command"); 5 | 6 | module.exports = class Logs extends Command { 7 | constructor(client) { 8 | super(client); 9 | this.client = client; 10 | 11 | this.name = "logs"; 12 | this.category = "Config"; 13 | this.description = "Comando para configurar o canal de logs do servidor"; 14 | this.usage = "logs <#channel>"; 15 | this.aliases = ["log"]; 16 | 17 | this.enabled = true; 18 | this.guildOnly = true; 19 | } 20 | 21 | async run({ message, args, prefix, author }, t) { 22 | const server = await this.client.database.guilds.findOne({ 23 | idS: message.guild.id, 24 | }); 25 | const channel = 26 | message.guild.channels.cache.get((x) => x.id == args[1]) || 27 | message.mentions.channels.first(); 28 | 29 | if (args[0] == "set") { 30 | if (!channel) { 31 | return message.reply( 32 | `${Emojis.Errado} - ${message.author}, você não inseriu um ID/mencionou um canal para eu setar como canal de logs.` 33 | ); 34 | } else if (channel.id == server.logs.channel) { 35 | return message.reply( 36 | `${Emojis.Errado} - ${message.author}, o canal inserido é o mesmo setado atualmente, tente novamente.` 37 | ); 38 | } else { 39 | message.reply( 40 | `${Emojis.Certo} - ${message.author}, o canal de logs foi alterado para **<#${channel.id}>** com sucesso.` 41 | ); 42 | await Guild.findOneAndUpdate( 43 | { idS: message.guild.id }, 44 | { $set: { "logs.channel": channel.id } } 45 | ); 46 | } 47 | return; 48 | } 49 | 50 | if (args[0] == "on") { 51 | if (server.logs.channel == "null") { 52 | return message.reply( 53 | `${Emojis.Errado} - ${message.author}, para ativar seu sitema de logs, sete um canal primeiro.` 54 | ); 55 | } else if (server.logs.status) { 56 | return message.reply( 57 | `${Emojis.Errado} - ${message.author}, o sistema já se encontra ativado.` 58 | ); 59 | } else { 60 | message.reply( 61 | `${Emojis.Certo} - ${message.author}, sistema ativado com sucesso.` 62 | ); 63 | await Guild.findOneAndUpdate( 64 | { idS: message.guild.id }, 65 | { $set: { "logs.status": true } } 66 | ); 67 | } 68 | return; 69 | } 70 | 71 | if (args[0] == "off") { 72 | if (!server.logs.status) { 73 | return message.reply( 74 | `${Emojis.Errado} - ${message.author}, o sistema já se encontra desativado.` 75 | ); 76 | } else { 77 | message.reply( 78 | `${Emojis.Certo} - ${message.author}, sistema desativado com sucesso.` 79 | ); 80 | await Guild.findOneAndUpdate( 81 | { idS: message.guild.id }, 82 | { $set: { "logs.status": false } } 83 | ); 84 | } 85 | return; 86 | } 87 | 88 | const HELP = new MessageEmbed() 89 | .setColor(process.env.EMBED_COLOR) 90 | .setTimestamp() 91 | .setFooter( 92 | `Comando requisitado por ${message.author.username}`, 93 | message.author.displayAvatarURL({ dynamic: true }) 94 | ) 95 | .setThumbnail(this.client.user.displayAvatarURL({ size: 2048 })) 96 | .setAuthor( 97 | `Sistema de Logs - ${message.guild.name}`, 98 | this.client.user.displayAvatarURL() 99 | ) 100 | .addFields( 101 | { 102 | name: `Canal Setado`, 103 | value: 104 | server.logs.channel == "null" 105 | ? "Nenhum Canal Setado" 106 | : `<#${server.logs.channel}>`, 107 | }, 108 | { 109 | name: "Status do Sistema", 110 | value: `No momento o sistema se encontra **${ 111 | server.logs.status ? `ativado` : "desativado" 112 | }**`, 113 | } 114 | ); 115 | 116 | message.reply({embeds: [HELP]}) 117 | } 118 | }; 119 | -------------------------------------------------------------------------------- /src/database/Schemas/User.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | const Schema = mongoose.Schema; 3 | 4 | let userSchema = new Schema({ 5 | idU: { type: String }, 6 | idS: { type: String }, 7 | coins: { type: Number, default: 0 }, 8 | daily: { type: Number, default: 0 }, 9 | bank: { type: Number, default: 0 }, 10 | Exp: { 11 | xp: { type: Number, default: 1 }, 12 | level: { type: Number, default: 1 }, 13 | nextLevel: { type: Number, default: 100 }, 14 | id: { type: String, default: "null" }, 15 | user: { type: String, default: "null" }, 16 | }, 17 | registrador: { 18 | registredBy: { type: String, default: "null" }, 19 | registredDate: { type: String, default: "null" }, 20 | registred: { type: Boolean, default: false }, 21 | registreds: { type: Number, default: 0 }, 22 | }, 23 | work: { 24 | exp: { type: Number, default: 1 }, 25 | level: { type: Number, default: 1 }, 26 | nextLevel: { type: Number, default: 250 }, 27 | cooldown: { type: Number, default: 0 }, 28 | coins: { type: Number, default: 200 }, 29 | name: { type: String, default: "null" }, 30 | }, 31 | vip: { 32 | hasVip: { type: Boolean, default: false }, 33 | date: { type: Number, default: 0 }, 34 | }, 35 | shop: { 36 | itens: { 37 | pickaxe: { 38 | type: Object, 39 | default: { id: 1, size: 0, price: 3000, name: "Picareta", emoji: "❤️" }, 40 | }, 41 | axe: { 42 | type: Object, 43 | default: { id: 2, size: 0, price: 5000, name: "Machado", emoji: "❤️" }, 44 | }, 45 | hoe: { 46 | type: Object, 47 | default: { id: 3, size: 0, price: 6000, name: "Enxada", emoji: "❤️" }, 48 | }, 49 | sword: { 50 | type: Object, 51 | default: { id: 4, size: 0, price: 7000, name: "Espada", emoji: "❤️" }, 52 | }, 53 | shovel: { 54 | type: Object, 55 | default: { id: 5, size: 0, price: 8000, name: "Pá", emoji: "❤️" }, 56 | }, 57 | }, 58 | }, 59 | factory: { 60 | name: { type: String, default: "null" }, 61 | exp: { type: Number, default: 0 }, 62 | level: { type: Number, default: 1 }, 63 | nextLevel: { type: Number, default: 500 }, 64 | owner: { type: String, default: "null" }, 65 | employers: { type: Array, default: [] }, 66 | hasFactory: { type: Boolean, default: false }, 67 | createFactory: { type: Boolean, default: false }, 68 | lastWork: { type: Number, default: 0 }, 69 | }, 70 | about: { type: String, default: "null" }, 71 | reps: { 72 | size: { type: Number, default: 0 }, 73 | lastRep: { type: String, default: "null" }, 74 | lastSend: { type: String, default: "null" }, 75 | time: { type: Number, default: 0 }, 76 | }, 77 | reminder: { 78 | list: { type: Array, default: [] }, 79 | has: { type: Number, default: 0 }, 80 | }, 81 | ticket: { 82 | have: { type: Boolean, default: false }, 83 | channel: { type: String, default: "null" }, 84 | created: { type: String, default: "null" }, 85 | }, 86 | marry: { 87 | time: { type: Number, default: 0 }, 88 | user: { type: String, default: "null" }, 89 | has: { type: Boolean, default: false }, 90 | }, 91 | steal: { 92 | time: { type: Number, default: 0 }, 93 | protection: { type: Number, default: 0 }, 94 | }, 95 | upvote: { 96 | count: { type: Number, default: 0 }, 97 | cooldown: { type: Number, default: 0 }, 98 | }, 99 | infoCall: { 100 | lastCall: { type: Number, default: 0 }, 101 | totalCall: { type: Number, default: 0 }, 102 | lastRegister: { type: Number, default: 0 }, 103 | status: { type: Boolean, default: true }, 104 | }, 105 | backgrounds: { 106 | has: { type: Array, default: [] }, 107 | active: { type: Number, default: 0 }, 108 | }, 109 | crates: { 110 | normal: { 111 | size: { type: Number, default: 0 }, 112 | id: { type: Number, default: 1 }, 113 | }, 114 | legendary: { 115 | size: { type: Number, default: 0 }, 116 | id: { type: Number, default: 2 }, 117 | }, 118 | }, 119 | }); 120 | 121 | const User = mongoose.model("Users", userSchema); 122 | module.exports = User; 123 | -------------------------------------------------------------------------------- /src/commands/Config/createCall/set.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../../structures/Command"); 2 | const Emojis = require("../../../utils/Emojis"); 3 | const { MessageActionRow, MessageButton } = require("discord.js"); 4 | 5 | module.exports = class Set extends Command { 6 | constructor(client) { 7 | super(client); 8 | this.client = client; 9 | 10 | this.name = "set"; 11 | this.category = "Configuration"; 12 | this.description = "Comando para setar o canal"; 13 | this.usage = ""; 14 | this.aliases = ["setar"]; 15 | this.reference = "createCall"; 16 | 17 | this.enabled = true; 18 | this.isSub = true; 19 | } 20 | 21 | async run({ message, args, prefix, author }, t) { 22 | const doc = await this.client.database.guilds.findOne({ 23 | idS: message.guild.id, 24 | }); 25 | 26 | const CHANNEL = 27 | message.guild.channels.cache.get(args[1]) || 28 | message.guild.channels.cache.find( 29 | (x) => x.name.toLowerCase() == args[1].toLowerCase() 30 | ); 31 | 32 | if (!CHANNEL) 33 | return message.reply( 34 | `${Emojis.Errado} | ${message.author}, canal de voz não encontrado.` 35 | ); 36 | 37 | if (CHANNEL.type != "GUILD_VOICE") 38 | return message.reply( 39 | `${Emojis.Errado} | ${message.author}, o canal deve ser um canal de voz.` 40 | ); 41 | 42 | if (!CHANNEL.parentId) 43 | return message.reply( 44 | `${Emojis.Errado} | ${message.author}, o canal deve estar dentro de uma categoria.` 45 | ); 46 | 47 | if (CHANNEL.id == doc.createCall.channel) 48 | return message.reply( 49 | `${Emojis.Errado} | ${message.author}, o canal inserido é o mesmo setado atualmente.` 50 | ); 51 | 52 | let row = new MessageActionRow().addComponents( 53 | new MessageButton() 54 | .setCustomId("yes") 55 | .setLabel("Sim") 56 | .setStyle("SUCCESS") 57 | .setDisabled(false), 58 | 59 | new MessageButton() 60 | .setCustomId("no") 61 | .setLabel("Não") 62 | .setStyle("DANGER") 63 | .setDisabled(false) 64 | ); 65 | 66 | const changeChannel = async () => { 67 | await this.client.database.guilds.findOneAndUpdate( 68 | { idS: message.guild.id }, 69 | { 70 | $set: { 71 | "createCall.category": CHANNEL.parentId, 72 | "createCall.status": true, 73 | "createCall.channel": CHANNEL.id, 74 | }, 75 | } 76 | ); 77 | }; 78 | 79 | if (doc.createCall.channel != "null") { 80 | const msg = await message.reply({ 81 | content: `${Emojis.Help} | ${message.author}, você deseja trocar o canal atual de criação de call pelo canal **${CHANNEL.name}**?`, 82 | components: [row], 83 | }); 84 | 85 | const filter = (interaction) => { 86 | return interaction.isButton() && interaction.message.id === msg.id; 87 | }; 88 | 89 | const collector = msg.createMessageComponentCollector({ 90 | filter: filter, 91 | time: 60000, 92 | }); 93 | 94 | collector.on("end", async (r, reason) => { 95 | if (reason != "time") return; 96 | 97 | msg.delete(); 98 | }); 99 | 100 | collector.on("collect", async (x) => { 101 | if (x.user.id != message.author.id) 102 | return x.reply({ 103 | content: `${x.user}, você não executou o comando para poder usar os botões.`, 104 | ephemeral: true, 105 | }); 106 | 107 | switch (x.customId) { 108 | case "yes": { 109 | message.reply( 110 | `${Emojis.Certo} | ${message.author}, canal alterado com sucesso.` 111 | ); 112 | 113 | await changeChannel(); 114 | msg.delete(); 115 | break; 116 | } 117 | 118 | case "no": { 119 | msg.delete(); 120 | 121 | return message.reply( 122 | `${Emojis.Errado} | ${message.author}, ação cancelada com sucesso.` 123 | ); 124 | } 125 | } 126 | }); 127 | return; 128 | } 129 | 130 | message.reply( 131 | `${Emojis.Certo} | ${message.author}, canal alterado com sucesso.` 132 | ); 133 | await changeChannel(); 134 | } 135 | }; 136 | -------------------------------------------------------------------------------- /src/commands/Music/play.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | const ClientEmbed = require("../../structures/ClientEmbed"); 3 | 4 | module.exports = class Play extends Command { 5 | constructor(client) { 6 | super(client); 7 | this.client = client; 8 | 9 | this.name = "play"; 10 | this.category = "Music"; 11 | this.description = "Comando para tocar música em seu servidor."; 12 | this.usage = "play "; 13 | this.aliases = ["p"]; 14 | 15 | this.enabled = true; 16 | this.guildOnly = true; 17 | } 18 | 19 | async run({ message, args, author }) { 20 | const player2 = this.client.music.players.get(message.guild.id); 21 | 22 | try { 23 | if (player2) { 24 | if (message.member.voice.channelId != message.guild.me.voice.channelid) 25 | return message.reply( 26 | `${message.author}, você deve estar no mesmo canal de voz que eu.` 27 | ); 28 | } 29 | 30 | if (!message.member.voice.channel) 31 | return message.reply( 32 | `${message.author}, você não está em nenhum canal de voz.` 33 | ); 34 | const music = args.join(" "); 35 | 36 | if (!music) 37 | return message.reply( 38 | `${message.author}, você deve inserir o nome da música/url.` 39 | ); 40 | 41 | const result = await this.client.music.search(music, message.author); 42 | 43 | if (result.loadType === "LOAD_FAILED") 44 | return message.reply( 45 | `${message.author}, não consegui tocar essa música.` 46 | ); 47 | if (result.loadType === "NO_MATCHES") 48 | return message.reply( 49 | `${message.author}, não encontrei nenhum resultado para essa pesquisa.` 50 | ); 51 | 52 | message.reply(`${message.author}, pesquisando **\`${music}\`**.`); 53 | 54 | const player = this.client.music.create({ 55 | guild: message.guild.id, 56 | voiceChannel: message.member.voice.channel.id, 57 | textChannel: message.channel.id, 58 | }); 59 | 60 | if (player.state === "DISCONNECTED") player.connect(); 61 | 62 | if (result.loadType === "PLAYLIST_LOADED") { 63 | const playlist = result.playlist; 64 | 65 | for (const track of result.tracks) player.queue.add(track); 66 | 67 | if (!player.playing) player.play(); 68 | 69 | const EMBED = new ClientEmbed(message.author) 70 | .setTitle(`PlayList Adicionada`) 71 | .addFields( 72 | { 73 | name: `Nome da PlayList`, 74 | value: playlist?.name, 75 | inline: false, 76 | }, 77 | { 78 | name: `Quantidade de Músicas`, 79 | value: result.tracks.length, 80 | inline: true, 81 | }, 82 | { 83 | name: `Duração`, 84 | value: this.formatTime( 85 | this.convertMilliseconds(result.playlist.duration), 86 | "hh:mm:ss" 87 | ), 88 | inline: true, 89 | } 90 | ); 91 | 92 | message.reply({ embeds: [EMBED] }); 93 | } else { 94 | const tracks = result.tracks; 95 | 96 | player.queue.add(tracks[0]); 97 | 98 | if (player2) { 99 | message.reply( 100 | `${message.author}, música **${tracks[0].title}** adicionada a PlayList.` 101 | ); 102 | } 103 | 104 | if (!player.playing) player.play(); 105 | } 106 | } catch (err) { 107 | if (err) console.log(err); 108 | return message.reply(`${message.author}, erro ao usar o comando.`); 109 | } 110 | } 111 | convertMilliseconds(ms) { 112 | const seconds = ~~(ms / 1000); 113 | const minutes = ~~(seconds / 60); 114 | const hours = ~~(minutes / 60); 115 | 116 | return { hours: hours % 24, minutes: minutes % 60, seconds: seconds % 60 }; 117 | } 118 | 119 | formatTime(time, format, twoDigits = true) { 120 | const formats = { 121 | dd: "days", 122 | hh: "hours", 123 | mm: "minutes", 124 | ss: "seconds", 125 | }; 126 | 127 | return format.replace(/dd|hh|mm|ss/g, (match) => 128 | time[formats[match]].toString().padStart(twoDigits ? 2 : 0, "0") 129 | ); 130 | } 131 | }; 132 | -------------------------------------------------------------------------------- /src/commands/Economy/pay.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../structures/Command"); 2 | const Emojis = require("../../utils/Emojis"); 3 | const Util = require("../../utils/Util"); 4 | const { MessageButton, MessageActionRow } = require("discord.js"); 5 | 6 | module.exports = class Pay extends Command { 7 | constructor(client) { 8 | super(client); 9 | this.client = client; 10 | 11 | this.name = "pay"; 12 | this.category = "Economy"; 13 | this.description = "Comando para enviar dinheiro."; 14 | this.usage = "pay "; 15 | this.aliases = ["pagar", "enviar"]; 16 | 17 | this.enabled = true; 18 | this.guildOnly = true; 19 | } 20 | 21 | async run({ message, args, prefix, author }, t) { 22 | const user = 23 | this.client.users.cache.get(args[0]) || message.mentions.users.first(); 24 | 25 | const doc = await this.client.database.users.findOne({ 26 | idU: message.author.id, 27 | }); 28 | 29 | if (!user) 30 | return message.reply( 31 | `${message.author}, você deve mencionar para quem deseja enviar dinheiro.` 32 | ); 33 | 34 | if (!args[1]) 35 | return message.reply( 36 | `${message.author}, você deve inserir quanto deseja enviar.` 37 | ); 38 | 39 | const money = await Util.notAbbrev(args[1]); 40 | 41 | if (String(money) === "NaN") 42 | return message.reply(`${message.author}, dinheiro inválido.`); 43 | 44 | if (money <= 0) 45 | return message.reply(`${message.author}, dinheiro menor ou igual a 0`); 46 | 47 | if (user.id === message.author.id) 48 | return message.reply( 49 | `${message.author}, você não pode enviar dinheiro para si mesmo.` 50 | ); 51 | 52 | if (money > doc.bank) 53 | return message.reply( 54 | `${message.author}, você não inseriu a quantidade de dinheiro que deseja enviar ou colocou mais do que você tem.` 55 | ); 56 | 57 | const target = await this.client.database.users.findOne({ idU: user.id }); 58 | 59 | const row = new MessageActionRow(); 60 | 61 | const yesButton = new MessageButton() 62 | .setCustomId("yes") 63 | .setLabel("Enviar") 64 | .setStyle("SUCCESS") 65 | .setDisabled(false); 66 | 67 | const noButton = new MessageButton() 68 | .setCustomId("no") 69 | .setLabel("Cancelar") 70 | .setStyle("DANGER") 71 | .setDisabled(false); 72 | 73 | row.addComponents([yesButton, noButton]); 74 | 75 | const msg = await message.reply({ 76 | content: `${message.author}, você deseja enviar **R$${Util.toAbbrev( 77 | money 78 | )}** para o(a) ${user}?!`, 79 | components: [row], 80 | }); 81 | 82 | let collect; 83 | 84 | const filter = (interaction) => { 85 | return interaction.isButton() && interaction.message.id === msg.id; 86 | }; 87 | 88 | const collector = msg.createMessageComponentCollector({ 89 | filter: filter, 90 | time: 60000, 91 | }); 92 | 93 | collector.on("collect", async (x) => { 94 | if (x.user.id != message.author.id) 95 | return x.reply({ 96 | content: `Você não executou o comando para poder usar os botões.`, 97 | ephemeral: true, 98 | }); 99 | 100 | collect = x; 101 | 102 | switch (x.customId) { 103 | case "yes": { 104 | message.reply(`${message.author}, dinheiro enviado com sucesso.`); 105 | 106 | await this.client.database.users.findOneAndUpdate( 107 | { idU: message.author.id }, 108 | { 109 | $set: { 110 | bank: doc.bank - money, 111 | }, 112 | } 113 | ); 114 | await this.client.database.users.findOneAndUpdate( 115 | { idU: user.id }, 116 | { 117 | $set: { 118 | bank: target.bank + money, 119 | }, 120 | } 121 | ); 122 | 123 | msg.delete(); 124 | break; 125 | } 126 | 127 | case "no": { 128 | msg.delete(); 129 | 130 | return message.reply( 131 | `${message.author}, envio de dinheiro cancelado.` 132 | ); 133 | } 134 | } 135 | }); 136 | 137 | collector.on("end", (x) => { 138 | if (collect) return; 139 | //x.update({ components: [] }); 140 | }); 141 | } 142 | }; 143 | -------------------------------------------------------------------------------- /src/commands/Config/contador.js: -------------------------------------------------------------------------------- 1 | const Guild = require("../../database/Schemas/Guild"); 2 | const Discord = require("discord.js"); 3 | const Command = require("../../structures/Command"); 4 | 5 | module.exports = class Contador extends Command { 6 | constructor(client) { 7 | super(client); 8 | this.client = client; 9 | 10 | this.name = "contador"; 11 | this.category = "Config"; 12 | this.description = "Comando para configurar o sistema de contador em chat"; 13 | this.usage = "contador"; 14 | this.aliases = []; 15 | 16 | this.enabled = true; 17 | this.guildOnly = true; 18 | } 19 | async run({ message, args, prefix, author }, t) { 20 | Guild.findOne({ idS: message.guild.id }, async function (err, server) { 21 | if (!message.member.permissions.has("MANAGE_GUILD")) 22 | return message.reply( 23 | `${message.author} você não tem permissão de executar este comando.` 24 | ); 25 | 26 | if (args[0] == "channel") { 27 | let channel = 28 | message.guild.channels.cache.get(args[1]) || 29 | message.mentions.channels.first(); 30 | 31 | if (!channel) { 32 | return message.reply( 33 | `${message.author}, você deve mencionar o canal/inserir o ID que deseja setar o contador de membros.` 34 | ); 35 | } else if (channel.id == server.contador.channel) { 36 | return message.reply( 37 | `${message.author}, o canal inserido já é o mesmo setado atualmente, escolha outro e tente novamente.` 38 | ); 39 | } else { 40 | message.reply( 41 | `${message.author}, o canal de contador foi setado no canal de ID: **${channel.id} ( <#${channel.id}> ) ** com sucesso.` 42 | ); 43 | await Guild.findOneAndUpdate( 44 | { idS: message.guild.id }, 45 | { $set: { "contador.channel": channel.id } } 46 | ); 47 | } 48 | return; 49 | } 50 | 51 | if (args[0] == "msg") { 52 | let msg = args.slice(1).join(" "); 53 | 54 | if (!msg) { 55 | return message.reply(`${message.author}, você não escreveu nada.`); 56 | } else if (msg == server.contador.msg) { 57 | return message.reply( 58 | `${message.author}, a mensagem inserida é a mesma setada atualmente, tente novamente.` 59 | ); 60 | } else if (msg.length > 50) { 61 | return message.reply( 62 | `${message.author}, a mensagem inserida tem mais de **50 caracteres**, tente novamente.` 63 | ); 64 | } else { 65 | message.reply( 66 | `${message.author}, a mensagem foi alterada com sucesso!` 67 | ); 68 | await Guild.findOneAndUpdate( 69 | { idS: message.guild.id }, 70 | { $set: { "contador.msg": msg, "contador.status": true } } 71 | ); 72 | } 73 | return; 74 | } 75 | 76 | if (args[0] == "help") { 77 | const HELP = new Discord.MessageEmbed() 78 | .setAuthor( 79 | `${message.guild.name} - Sistema de Contador`, 80 | message.guild.iconURL({ dynamic: true }) 81 | ) 82 | .setColor(process.env.EMBED_COLOR) 83 | .setFooter( 84 | `Comando requisitado por ${message.author.username}`, 85 | message.author.displayAvatarURL({ dynamic: true }) 86 | ) 87 | .setThumbnail(message.guild.iconURL({ dynamic: true })) 88 | .setTimestamp() 89 | .addFields( 90 | { 91 | name: "Canal setado atualmente", 92 | value: 93 | server.contador.channel == "null" 94 | ? "Nenhum canal setado atualmente" 95 | : `<#${server.contador.channel}>`, 96 | }, 97 | { 98 | name: "Mensagem setada", 99 | value: `${ 100 | server.contador.msg == "{{contador}}" 101 | ? "Nenhuma mensagem setada" 102 | : `\`\`\`diff\n- ${server.contador.msg}\`\`\`` 103 | }`, 104 | }, 105 | { 106 | name: "Necessário", 107 | value: `Para setar em EMOJI é necessário usar **{{contador}}** na mensagem do sistema.`, 108 | }, 109 | { 110 | name: "Status do Sistema", 111 | value: `No momento o sistema se encontra **${ 112 | server.contador.status == true ? "ativado" : "desativado" 113 | }**`, 114 | } 115 | ); 116 | 117 | message.reply({embeds: [HELP]}) 118 | 119 | return; 120 | } 121 | }); 122 | } 123 | }; 124 | --------------------------------------------------------------------------------