From 5f9ce2fbd02a01b6883158bd8557b3349c6f6c7d Mon Sep 17 00:00:00 2001 From: "Glitch (sweetless)" Date: Wed, 19 Aug 2020 09:36:02 +0000 Subject: [PATCH 01/12] =?UTF-8?q?=F0=9F=8C=8C=F0=9F=91=93=20Updated=20with?= =?UTF-8?q?=20Glitch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .glitch-assets | 6 + README.md | 32 +- commands/Action/feed.js | 34 + commands/Action/module.json | 4 + commands/Action/slap.js | 34 + commands/Developer/eval.js | 69 ++ commands/Developer/module.json | 4 + commands/Economy/balance.js | 42 + commands/Economy/daily.js | 44 ++ commands/Economy/gamble.js | 49 ++ commands/Economy/module.json | 4 + commands/Economy/transfer.js | 43 + commands/Economy/work.js | 49 ++ commands/Fun/8ball.js | 44 ++ commands/Fun/module.json | 4 + commands/General/avatar.js | 38 + commands/General/clear.js | 25 + commands/General/module.json | 4 + commands/General/snipe.js | 30 + commands/Image/art.js | 43 + commands/Image/cat.js | 43 + commands/Image/dog.js | 43 + commands/Image/meme.js | 43 + commands/Image/module.json | 4 + commands/Information/corona.js | 42 + commands/Information/guilds.js | 20 + commands/Information/help.js | 66 ++ commands/Information/info.js | 28 + commands/Information/module.json | 4 + commands/Information/ping.js | 27 + commands/Information/serverinfo.js | 80 ++ commands/Information/spotify.js | 57 ++ commands/Information/stats.js | 85 ++ commands/Information/userinfo.js | 79 ++ commands/Moderate/kick.js | 33 + commands/Moderate/module.json | 4 + commands/Search/anime.js | 47 ++ commands/Search/module.json | 4 + commands/Search/wikipedia.js | 35 + commands/Setting/afk.js | 31 + commands/Setting/module.json | 4 + commands/Setting/resetnick.js | 28 + commands/Setting/setnick.js | 31 + commands/Setting/slowmode.js | 43 + commands/Utility/module.json | 4 + commands/Utility/ytstat.js | 38 + config.json | 5 + events/experience.js | 48 ++ events/message.js | 95 +++ events/messageDelete.js | 26 + events/ready.js | 16 + handler/ClientBuilder.js | 14 + handler/Event.js | 12 + handler/LevelingUtil.js | 18 + handler/module.js | 47 ++ json.sqlite | Bin 0 -> 12288 bytes notepad | 310 ++++++++ package.json | 38 + server.js | 12 + shrinkwrap.yaml | 1185 ++++++++++++++++++++++++++++ subtitle | 18 + uptime.js | 16 + watch.json | 10 + 63 files changed, 3393 insertions(+), 2 deletions(-) create mode 100644 .glitch-assets create mode 100644 commands/Action/feed.js create mode 100644 commands/Action/module.json create mode 100644 commands/Action/slap.js create mode 100644 commands/Developer/eval.js create mode 100644 commands/Developer/module.json create mode 100644 commands/Economy/balance.js create mode 100644 commands/Economy/daily.js create mode 100644 commands/Economy/gamble.js create mode 100644 commands/Economy/module.json create mode 100644 commands/Economy/transfer.js create mode 100644 commands/Economy/work.js create mode 100644 commands/Fun/8ball.js create mode 100644 commands/Fun/module.json create mode 100644 commands/General/avatar.js create mode 100644 commands/General/clear.js create mode 100644 commands/General/module.json create mode 100644 commands/General/snipe.js create mode 100644 commands/Image/art.js create mode 100644 commands/Image/cat.js create mode 100644 commands/Image/dog.js create mode 100644 commands/Image/meme.js create mode 100644 commands/Image/module.json create mode 100644 commands/Information/corona.js create mode 100644 commands/Information/guilds.js create mode 100644 commands/Information/help.js create mode 100644 commands/Information/info.js create mode 100644 commands/Information/module.json create mode 100644 commands/Information/ping.js create mode 100644 commands/Information/serverinfo.js create mode 100644 commands/Information/spotify.js create mode 100644 commands/Information/stats.js create mode 100644 commands/Information/userinfo.js create mode 100644 commands/Moderate/kick.js create mode 100644 commands/Moderate/module.json create mode 100644 commands/Search/anime.js create mode 100644 commands/Search/module.json create mode 100644 commands/Search/wikipedia.js create mode 100644 commands/Setting/afk.js create mode 100644 commands/Setting/module.json create mode 100644 commands/Setting/resetnick.js create mode 100644 commands/Setting/setnick.js create mode 100644 commands/Setting/slowmode.js create mode 100644 commands/Utility/module.json create mode 100644 commands/Utility/ytstat.js create mode 100644 config.json create mode 100644 events/experience.js create mode 100644 events/message.js create mode 100644 events/messageDelete.js create mode 100644 events/ready.js create mode 100644 handler/ClientBuilder.js create mode 100644 handler/Event.js create mode 100644 handler/LevelingUtil.js create mode 100644 handler/module.js create mode 100644 json.sqlite create mode 100644 notepad create mode 100644 package.json create mode 100644 server.js create mode 100644 shrinkwrap.yaml create mode 100644 subtitle create mode 100644 uptime.js create mode 100644 watch.json diff --git a/.glitch-assets b/.glitch-assets new file mode 100644 index 0000000..954626f --- /dev/null +++ b/.glitch-assets @@ -0,0 +1,6 @@ +{"name":"drag-in-files.svg","date":"2016-10-22T16:17:49.954Z","url":"https://cdn.hyperdev.com/drag-in-files.svg","type":"image/svg","size":7646,"imageWidth":276,"imageHeight":276,"thumbnail":"https://cdn.hyperdev.com/drag-in-files.svg","thumbnailWidth":276,"thumbnailHeight":276,"dominantColor":"rgb(102, 153, 205)","uuid":"adSBq97hhhpFNUna"} +{"name":"click-me.svg","date":"2016-10-23T16:17:49.954Z","url":"https://cdn.hyperdev.com/click-me.svg","type":"image/svg","size":7116,"imageWidth":276,"imageHeight":276,"thumbnail":"https://cdn.hyperdev.com/click-me.svg","thumbnailWidth":276,"thumbnailHeight":276,"dominantColor":"rgb(243, 185, 186)","uuid":"adSBq97hhhpFNUnb"} +{"name":"paste-me.svg","date":"2016-10-24T16:17:49.954Z","url":"https://cdn.hyperdev.com/paste-me.svg","type":"image/svg","size":7242,"imageWidth":276,"imageHeight":276,"thumbnail":"https://cdn.hyperdev.com/paste-me.svg","thumbnailWidth":276,"thumbnailHeight":276,"dominantColor":"rgb(42, 179, 185)","uuid":"adSBq97hhhpFNUnc"} +{"uuid":"adSBq97hhhpFNUna","deleted":true} +{"uuid":"adSBq97hhhpFNUnb","deleted":true} +{"uuid":"adSBq97hhhpFNUnc","deleted":true} diff --git a/README.md b/README.md index 5b75704..887720b 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,30 @@ -# Sweetless -Hello? +# hello-express + +A server that serves a webpage, its resources, and some data + + +## Your Project + +On the front-end, + +- Edit `views/index.html` to change the content of the webpage +- `public/client.js` is the javacript that runs when you load the webpage +- `public/style.css` is the styles for `views/index.html` +- Drag in `assets`, like images or music, to add them to your project + +On the back-end, + +- your app starts at `server.js` +- add frameworks and packages in `package.json` +- safely store app secrets in `.env` (nobody can see this but you and people you invite) + +Click `Show` in the header to see your app live. Updates to your code will instantly deploy. + + +## Made by [Glitch](https://glitch.com/) + +**Glitch** is the friendly community where you'll build the app of your dreams. Glitch lets you instantly create, remix, edit, and host an app, bot or site, and you can invite collaborators or helpers to simultaneously edit code with you. + +Find out more [about Glitch](https://glitch.com/about). + +( ᵔ ᴥ ᵔ ) \ No newline at end of file diff --git a/commands/Action/feed.js b/commands/Action/feed.js new file mode 100644 index 0000000..df4176f --- /dev/null +++ b/commands/Action/feed.js @@ -0,0 +1,34 @@ +const Discord = require("discord.js"); +const superagent = require("superagent"); + +exports.run = async (client, message, args) => { + const user = message.mentions.users.first(); + + let mention; + + if (!message.mentions.users.first()) { + mention = `${message.author.username} feeds ${client.user.username}`; + } else { + mention = `${message.author.username} feeds ${user.username}`; + } + + const { body } = await superagent.get("https://nekos.life/api/v2/img/feed"); + + const feed = new Discord.MessageEmbed() + .setColor("RANDOM") + .setAuthor(mention, message.author.displayAvatarURL({ format: "png", dynamic: true, size: 64 })) + .setImage(body.url) + return message.channel.send(feed); +} + +exports.help = { + name: "feed", + description: "Feed someone.", + usage: ["feed", "feed <@user>"], + example: ["feed", "feed @Vii_Rakk#5424"] +} + +exports.conf = { + aliases: [], + cooldown: 3 +} \ No newline at end of file diff --git a/commands/Action/module.json b/commands/Action/module.json new file mode 100644 index 0000000..7075b81 --- /dev/null +++ b/commands/Action/module.json @@ -0,0 +1,4 @@ +{ + "name": "Action", + "hide": false +} \ No newline at end of file diff --git a/commands/Action/slap.js b/commands/Action/slap.js new file mode 100644 index 0000000..5c8b8b9 --- /dev/null +++ b/commands/Action/slap.js @@ -0,0 +1,34 @@ +const Discord = require("discord.js"); +const superagent = require("superagent"); + +exports.run = async (client, message, args) => { + const user = message.mentions.users.first(); + + let mention; + + if (!message.mentions.users.first()) { + mention = `${message.author.username} slap ${client.user.username}`; + } else { + mention = `${message.author.username} slap ${user.username}`; + } + + const { body } = await superagent.get("https://nekos.life/api/v2/img/slap"); + + const slap = new Discord.MessageEmbed() + .setColor("RANDOM") + .setAuthor(mention, message.author.displayAvatarURL({ format: "png", dynamic: true, size: 64 })) + .setImage(body.url) + return message.channel.send(slap); +} + +exports.help = { + name: "slap", + description: "slap someone.", + usage: ["slap", "slap <@user>"], + example: ["slap", "slap @Vii_Rakk#5424"] +} + +exports.conf = { + aliases: [], + cooldown: 3 +} \ No newline at end of file diff --git a/commands/Developer/eval.js b/commands/Developer/eval.js new file mode 100644 index 0000000..95aa57d --- /dev/null +++ b/commands/Developer/eval.js @@ -0,0 +1,69 @@ +const Discord = require("discord.js"), + { post } = require("node-superfetch"); + +exports.run = async (client, message, args) => { + // This command is super frickin' dangerous. Make it only visible and usable for you only, or give it to someone you trust. + if (!client.config.owners.includes(message.author.id)) return; + + const embed = new Discord.MessageEmbed() + .addField(":inbox_tray: Input", "```js\n" + args.join(" ") + "```"); + + try { + const code = args.join(" "); + if (!code) return message.channel.send("Please include the code."); + let evaled; + + // This method is to prevent someone that you trust, open the secret shit here. + if (code.includes(`secret`) || code.includes(`token`) || code.includes("process.env")) { + evaled = "No, shut up, what will you do it with the token?"; + } else { + evaled = eval(code); + } + + if (typeof evaled !== "string") evaled = require("util").inspect(evaled, {depth: 0}); + + let output = clean(evaled); + if (output.length > 1024) { + // If the output was more than 1024 characters, we're gonna export them into the hastebin. + const {body} = await post("https://hastebin.com/documents").send(output); + embed.addField(":outbox_tray: Output", `https://hastebin.com/${body.key}.js`).setColor(0x7289DA); + // Sometimes, the body.key will turn into undefined. It might be the API is under maintenance or broken. + } else { + embed.addField(":outbox_tray: Output", "```js\n" + output + "```").setColor(0x7289DA) + } + + message.channel.send(embed); + + } catch (error) { + let err = clean(error); + if (err.length > 1024) { + // Do the same like above if the error output was more than 1024 characters. + const {body} = await post("https://hastebin.com/documents").send(err); + embed.addField(":outbox_tray: Output", `https://hastebin.com/${body.key}.js`).setColor("RED"); + } else { + embed.addField(":outbox_tray: Output", "```js\n" + err + "```").setColor("RED"); + } + + message.channel.send(embed); + } +} + +exports.help = { + name: "eval", + description: "Evaluate some code.", + usage: "eval ", + example: "eval client.commands" +} + +exports.conf = { + aliases: ["ev"] +} + +function clean(string) { + if (typeof text === "string") { + return string.replace(/`/g, "`" + String.fromCharCode(8203)) + .replace(/@/g, "@" + String.fromCharCode(8203)) + } else { + return string; + } +} \ No newline at end of file diff --git a/commands/Developer/module.json b/commands/Developer/module.json new file mode 100644 index 0000000..c5fc77d --- /dev/null +++ b/commands/Developer/module.json @@ -0,0 +1,4 @@ +{ + "name": "developer", + "hide": true +} \ No newline at end of file diff --git a/commands/Economy/balance.js b/commands/Economy/balance.js new file mode 100644 index 0000000..c7e293f --- /dev/null +++ b/commands/Economy/balance.js @@ -0,0 +1,42 @@ +const Discord = require("discord.js"); +const db = require("quick.db"); + +exports.run = async (client, message, args) => { + let user; + if (message.mentions.users.first()) { + user = message.mentions.users.first(); + } else if (args[0]) { + user = message.guild.members.cache.get(args[0]).user; + } else { + user = message.author; + } + + if (user.bot || user === client.user) { + return message.channel.send("This user is a bot."); + // If the user was a bot, ignore it. + } + + let balance = db.get(`account.${user.id}.balance`); + if (!balance) balance = 0; + else balance = balance; + + const embed = new Discord.MessageEmbed() + .setColor(0x7289DA) + .setTitle(`Balance of ${user.tag}`) + .addField("Balance", `$${(balance).toLocaleString()}`) + .setThumbnail(user.displayAvatarURL({size: 4096, dynamic: true})) + .setTimestamp(new Date) // Optional :) + return message.channel.send(embed); +} + +exports.help = { + name: "balance", + description: "Checking yours, or other members money.", + usage: "balance [@user | user ID]", + example: "balance \nbalance @Vii_Rakk#5424" +} + +exports.conf = { + aliases: ["bal", "coin", "money", "credit"], + cooldown: 5 +} \ No newline at end of file diff --git a/commands/Economy/daily.js b/commands/Economy/daily.js new file mode 100644 index 0000000..ee50899 --- /dev/null +++ b/commands/Economy/daily.js @@ -0,0 +1,44 @@ +const Discord = require("discord.js"); +const db = require("quick.db"); +const ms = require("parse-ms"); + +exports.run = async (client, message, args) => { + let pad_zero = num => (num < 10 ? '0' : '') + num; + let cooldown = 8.64e+7; // 24 Hours in ms. + let amount = 500; // How much user will get it in their dailies. + + let lastDaily = await db.get(`lastDaily.${message.author.id}`); + let buck = await db.get(`account.${message.author.id}.balance`); + + try { + + if (lastDaily !== null && cooldown - (Date.now() - lastDaily) > 0) { + let timeObj = ms(cooldown - (Date.now() - lastDaily)); + + let hours = pad_zero(timeObj.hours).padStart(2, "0"), + mins = pad_zero(timeObj.minutes).padStart(2, "0"), + secs = pad_zero(timeObj.seconds).padStart(2, "0"); + + let finalTime = `**${hours}:${mins}:${secs}**`; + return message.channel.send(`Sorry, you cannot collect your dailies too early. Please wait until ${finalTime}.`); + } else { + db.set(`lastDaily.${message.author.id}`, Date.now()); + db.add(`account.${message.author.id}.balance`, amount); + return message.channel.send(`Great **${message.author.tag}!** You've been received 500 dollars!`); + } + + } catch (error) { + console.log(error); + return message.channel.send(`Oopsie, unknown error I guess: ${error}`); + } +} + +exports.help = { + name: "daily", + description: "Collect the daily credits." +} + +exports.conf = { + aliases: ["dailies"], + cooldown: 10 +} \ No newline at end of file diff --git a/commands/Economy/gamble.js b/commands/Economy/gamble.js new file mode 100644 index 0000000..e33906a --- /dev/null +++ b/commands/Economy/gamble.js @@ -0,0 +1,49 @@ +const Discord = require("discord.js"); +const db = require("quick.db"); +const ms = require("parse-ms"); + +exports.run = async (client, message, args) => { + const amount = parseInt(args[0]); + const result = Math.floor(Math.random() * 10); + const balance = db.get(`account.${message.author.id}.balance`); + + if (!amount) return message.channel.send("Please insert an amount first."); + if (isNaN(amount)) return message.channel.send("The amount was not a number."); + if (amount > balance || !balance || balance === 0) return message.channel.send("You don't have enough money."); + + // Optional: + if (amount < 200) return message.channel.send("You don't have enough money for gambling. The minimum was $200."); + + let cooldown = 25000; // 25 Seconds. + let pad_zero = num => (num < 10 ? '0' : '') + num; + let lastGamble = await db.get(`lastGamble.${message.author.id}`); + + if (lastGamble !== null && cooldown - (Date.now() - lastGamble) > 0) { + let timeObj = ms(cooldown - (Date.now() - lastGamble)); + let second = pad_zero(timeObj.seconds).padStart(2, "0"); + return message.channel.send(`Wooo that is too fast. You need to wait **${second}** second(s) before you can gambling again.`); + } + + // 50:50 + if (result < 5) { + await db.set(`lastGamble.${message.author.id}`, Date.now()); + await db.subtract(`account.${message.author.id}.balance`, amount); + return message.channel.send(`Ahh, no. You lose $${amount}. Good luck next time.`); + } else if (result > 5) { + await db.set(`lastGamble.${message.author.id}`, Date.now()); + await db.add(`account.${message.author.id}.balance`, amount); + return message.channel.send(`Woohoo! You won $${amount}! Good luck, have fun!`); + } +} + +exports.help = { + name: "gamble", + description: "An efficient way to double your money.", + usage: "gamble ", + example: "gamble 500" +} + +exports.conf = { + aliases: ["gambling"], + cooldown: 5 +} \ No newline at end of file diff --git a/commands/Economy/module.json b/commands/Economy/module.json new file mode 100644 index 0000000..cfe03f7 --- /dev/null +++ b/commands/Economy/module.json @@ -0,0 +1,4 @@ +{ + "name": "Economy", + "hide": false +} \ No newline at end of file diff --git a/commands/Economy/transfer.js b/commands/Economy/transfer.js new file mode 100644 index 0000000..379f2a7 --- /dev/null +++ b/commands/Economy/transfer.js @@ -0,0 +1,43 @@ +const Discord = require("discord.js"); +const db = require("quick.db"); + +exports.run = async (client, message, args) => { + let user; + if (message.mentions.users.first()) { + user = message.mentions.users.first(); + } else if (args[0]) { + user = message.guild.members.cache.get(args[0]).user; + } + + let balance = db.get(`account.${message.author.id}.balance`); + + if (!user) return message.channel.send("Please mention the user or input the user ID."); + if (user.bot || user === client.user) return message.channel.send("This user is a bot."); + if (user.id === message.author.id || user === message.author) return message.channel.send("Why you want to transfer a credit to yourself?"); + + let amount = parseInt(args[1]); + if (!amount) return message.channel.send("Please input a credits that you want to transfer it."); + if (isNaN(amount)) return message.channel.send("Please input a valid number."); + // isNaN = is Not a Number. + + if (!balance || balance == 0) return message.channel.send("Your wallet is empty."); + if (amount > balance) return message.channel.send("You don't have an enough credits to transfer. That is way too much."); + if (amount === 0) return message.channel.send("You transfer, nothing? No. You cannot."); + + await db.add(`account.${user.id}.balance`, amount); + await db.subtract(`account.${message.author.id}.balance`, amount); + + return message.channel.send(`You've been transferred to your friends (${user.tag}) $${amount} credits!`); +} + +exports.help = { + name: "transfer", + description: "Transfer a credits to the user.", + usage: "transfer <@user | user ID> ", + example: "transfer @Vii_Rakk#5424 1000" +} + +exports.conf = { + aliases: ["tf"], + cooldown: 15 +} \ No newline at end of file diff --git a/commands/Economy/work.js b/commands/Economy/work.js new file mode 100644 index 0000000..776e3b0 --- /dev/null +++ b/commands/Economy/work.js @@ -0,0 +1,49 @@ +const Discord = require("discord.js"); +const db = require("quick.db"); +let ms = require("parse-ms"); + +exports.run = async (bot, message, args) => { + let randomCoin = getRandomInt(750, 1500); + let pad_zero = num => (num < 10 ? '0' : '') + num; + let cooldown = 2.16e+7; + + let lastWork = await db.get(`lastWork.${message.guild.id}.${message.author.id}`); + let buck = await db.get(`account.${message.guild.id}.${message.author.id}.balance`); + + try { + if (lastWork !== null && cooldown - (Date.now() - lastWork) > 0) { + let timeObj = ms(cooldown - (Date.now() - lastWork)); + + let hours = pad_zero(timeObj.hours).padStart(2, "0"), + mins = pad_zero(timeObj.minutes).padStart(2, "0"), + secs = pad_zero(timeObj.seconds).padStart(2, "0"); + + let finalTime = `**${hours} hours, ${mins} minutes, and ${secs} seconds**`; + return message.channel.send(`**${message.author.username}**, you already came to work today! please come again tomorrow`); + } else { + db.set(`lastWork.${message.guild.id}.${message.author.id}`, Date.now()); + db.add(`account.${message.guild.id}.${message.author.id}.balance`, randomCoin); + return message.channel.send(`**${message.author.username}**, you have earned <:Coin:742557027313909771>${randomCoin} from your work`); + } + } catch (error) { + console.log(error); + } +} + +exports.help = { + name: "work", + description: "Work and earn coin.", + usage: ["work"], + example: ["work"] +} + +exports.conf = { + aliases: [], + cooldown: 10 +} + +function getRandomInt(min, max) { + min = Math.ceil(min); + max = Math.floor(max); + return Math.floor(Math.random() * (max - min + 1)) + min; +} \ No newline at end of file diff --git a/commands/Fun/8ball.js b/commands/Fun/8ball.js new file mode 100644 index 0000000..b098e58 --- /dev/null +++ b/commands/Fun/8ball.js @@ -0,0 +1,44 @@ +const Discord = require('discord.js'); + +exports.run = async (client, message, args) => { + let userArray = message.content.split(" "); + let userArgs = userArray.slice(1); + let args1 = message.content.substring(message.content.indexOf(' ')+1); + let replies = [ + "Yes?", + "No?", + "As I see it, yes.", + "Most likely.", + "Yes – definitely.", + "My reply is no.", + "Better not tell you now.", + "Ask again later." + ]; + + if(!args1) { + return message.channel.send('What is the question? My Friend.') + } + + let result = replies[Math.floor(Math.random()*(replies.length))] + + const embed = new Discord.MessageEmbed() + .setTitle(':8ball:') + .setDescription(`**${message.author.tag} Question:**\n${args1}\n**My Answer:**\n${result}`) + .setColor("RANDOM") + .setTimestamp() + + message.channel.send(embed); +} + + +exports.help = { + name: "8ball", + description: "Ask Magic 8ball questions", + usage: "8ball [question]", + example: "8ball am i gay?\n8ball am i a simp?" +} + +exports.conf = { + aliases: [], + cooldown: 5 +} \ No newline at end of file diff --git a/commands/Fun/module.json b/commands/Fun/module.json new file mode 100644 index 0000000..d423759 --- /dev/null +++ b/commands/Fun/module.json @@ -0,0 +1,4 @@ +{ + "name": "Fun", + "hide": false +} \ No newline at end of file diff --git a/commands/General/avatar.js b/commands/General/avatar.js new file mode 100644 index 0000000..7d0a4e6 --- /dev/null +++ b/commands/General/avatar.js @@ -0,0 +1,38 @@ +const Discord = require("discord.js"); + +exports.run = async (client, message, args) => { + let user; + + if (message.mentions.users.first()) { + user = message.mentions.users.first(); + } else if (args[0]) { + user = message.guild.members.cache.get(args[0]).user; + } else { + user = message.author; + } + + let avatar = user.displayAvatarURL({size: 4096, dynamic: true}); + // 4096 is the new biggest size of the avatar. + // Enabling the dynamic, when the user avatar was animated/GIF, it will result as a GIF format. + // If it's not animated, it will result as a normal image format. + + const embed = new Discord.MessageEmbed() + .setTitle(`${user.tag} avatar`) + .setDescription(`[Avatar URL of **${user.tag}**](${avatar})`) + .setColor(0x1d1d1d) + .setImage(avatar) + + return message.channel.send(embed); +} + +exports.help = { + name: "avatar", + description: "Display a user avatar", + usage: "avatar [@user | user ID]", + example: "avatar @Vii_Rakk#5424 \navatar" +} + +exports.conf = { + aliases: ["icon", "pfp", "ava"], + cooldown: 5 +} \ No newline at end of file diff --git a/commands/General/clear.js b/commands/General/clear.js new file mode 100644 index 0000000..082ff87 --- /dev/null +++ b/commands/General/clear.js @@ -0,0 +1,25 @@ +const Discord = require("discord.js"); + +exports.run = async (client, message, args) => { + if (!message.member.hasPermission("MANAGE_MESSAGES") || !message.member.hasPermission("ADMINISTRATOR")) return message.channel.send("You don't have a permissions to do this."); + if (isNaN(args[0])) return message.channel.send("Please input a valid number.") // isNaN = is Not a Number. (case sensitive, write it right) + if (args[0] > 100) return message.channel.send("Insert the number less than 100.") // Discord limited purge number into 100. + if (args[0] < 2) return message.channel.send("Insert the number more than 1.") + + await message.delete() + await message.channel.bulkDelete(args[0]) + .then(messages => message.channel.send(`Deleted ${messages.size}/${args[0]} messages.`)).then(d => d.delete({timeout: 10000})) // How long this message will be deleted (in ms) + .catch(() => message.channel.send("Something went wrong, while deleting messages.")) // This error will be displayed when the bot doesn't have an access to do it. + } + +exports.help = { + name: "clear", + description: "Clear the useless message away", + usage: "clear [amount]", + example: "clear 10\nclear 50" +} + +exports.conf = { + aliases: ["purge"], + cooldown: 5 +} \ No newline at end of file diff --git a/commands/General/module.json b/commands/General/module.json new file mode 100644 index 0000000..01ef4c6 --- /dev/null +++ b/commands/General/module.json @@ -0,0 +1,4 @@ +{ + "name": "General", + "hide": false +} \ No newline at end of file diff --git a/commands/General/snipe.js b/commands/General/snipe.js new file mode 100644 index 0000000..8bbc9c2 --- /dev/null +++ b/commands/General/snipe.js @@ -0,0 +1,30 @@ +const Discord = require('discord.js'), + db = require("quick.db"); + +exports.run = async (client, message, args) => { + let data = db.get(`snipe.${message.guild.id}`); + if (!data) return message.channel.send("I don't see any stored deleted message here."); + + let content = data.content, + user = data.user, + channel = data.channel; + + const embed = new Discord.MessageEmbed() + .setColor("RANDOM") + .setTimestamp() + .setTitle("Sniped Message") + .setDescription(`I got a deleted message from **${user}** in **<#${channel}>** \n> ${content}`) + message.channel.send(embed); +} + +exports.help = { + name: "snipe", + description: "Shows the last deleted message.", + usage: "/snipe", + example: "/snipe" +}; + +exports.conf = { + aliases: [], + cooldown: 10 +} \ No newline at end of file diff --git a/commands/Image/art.js b/commands/Image/art.js new file mode 100644 index 0000000..5854f83 --- /dev/null +++ b/commands/Image/art.js @@ -0,0 +1,43 @@ +const Discord = require('discord.js'); +const fetch = require("node-fetch"); + +exports.run = async (client, message, args) => { + let loadingEmbed = new Discord.MessageEmbed() + .setColor("RANDOM") + .setDescription(` Generating a art!...`) + let msg = await message.channel + .send(loadingEmbed) + .then(m => m.delete({ timeout: 2000 })); + + fetch("https://www.reddit.com/r/art/.json?sort=top&t=daily") + .then(res => res.json()) + .then(body => { + if (!body) return message.reply("I broke, try again!"); + + const allowed = message.channel.nsfw ? body.data.children : body.data.children.filter(post => !post.data.over_18); + if (!allowed.length) return message.channel.send('Hmm looks like an error to me...'); + const randomnumber = Math.floor(Math.random() * allowed.length) + + let url = `https://www.reddit.com${allowed[randomnumber].data.permalink}` + let embed = new Discord.MessageEmbed() + .setTitle(allowed[randomnumber].data.title) + .setURL(url) + .setImage(allowed[randomnumber].data.url) + .setFooter(`👍Likes: ${allowed[randomnumber].data.ups} | 💬Comments: ${allowed[randomnumber].data.num_comments}`) + .setColor("RANDOM") + + return message.channel.send(embed); + }) + } + +exports.help = { + name: "art", + description: "Look art", + usage: "art", + example: "art" +} + +exports.conf = { + aliases: [], + cooldown: 3 +} \ No newline at end of file diff --git a/commands/Image/cat.js b/commands/Image/cat.js new file mode 100644 index 0000000..d25cb39 --- /dev/null +++ b/commands/Image/cat.js @@ -0,0 +1,43 @@ +const Discord = require('discord.js'); +const fetch = require("node-fetch"); + +exports.run = async (client, message, args) => { + let loadingEmbed = new Discord.MessageEmbed() + .setColor("RANDOM") + .setDescription(` Generating a cat!...`) + let msg = await message.channel + .send(loadingEmbed) + .then(m => m.delete({ timeout: 2000 })); + + fetch("https://www.reddit.com/r/cat/.json?sort=top&t=daily") + .then(res => res.json()) + .then(body => { + if (!body) return message.reply("I broke, try again!"); + + const allowed = message.channel.nsfw ? body.data.children : body.data.children.filter(post => !post.data.over_18); + if (!allowed.length) return message.channel.send('Hmm looks like an error to me...'); + const randomnumber = Math.floor(Math.random() * allowed.length) + + let url = `https://www.reddit.com${allowed[randomnumber].data.permalink}` + let embed = new Discord.MessageEmbed() + .setTitle(allowed[randomnumber].data.title) + .setURL(url) + .setImage(allowed[randomnumber].data.url) + .setFooter(`👍Likes: ${allowed[randomnumber].data.ups} | 💬Comments: ${allowed[randomnumber].data.num_comments}`) + .setColor("RANDOM") + + return message.channel.send(embed); + }) + } + +exports.help = { + name: "cat", + description: "Look cats", + usage: "cat", + example: "cat" +} + +exports.conf = { + aliases: [], + cooldown: 3 +} \ No newline at end of file diff --git a/commands/Image/dog.js b/commands/Image/dog.js new file mode 100644 index 0000000..75b158b --- /dev/null +++ b/commands/Image/dog.js @@ -0,0 +1,43 @@ +const Discord = require("discord.js"); +const fetch = require("node-fetch"); + +exports.run = async (client, message, args) => { + let loadingEmbed = new Discord.MessageEmbed() + .setColor("RANDOM") + .setDescription(` Generating a dog!...`) + let msg = await message.channel + .send(loadingEmbed) + .then(m => m.delete({ timeout: 2000 })); + + fetch("https://www.reddit.com/r/DOG/.json?sort=top&t=daily") + .then(res => res.json()) + .then(body => { + if (!body) return message.reply("I broke, try again!"); + + const allowed = message.channel.nsfw ? body.data.children : body.data.children.filter(post => !post.data.over_18); + if (!allowed.length) return message.channel.send('Hmm looks like an error to me...'); + const randomnumber = Math.floor(Math.random() * allowed.length) + + let url = `https://www.reddit.com${allowed[randomnumber].data.permalink}` + let embed = new Discord.MessageEmbed() + .setTitle(allowed[randomnumber].data.title) + .setURL(url) + .setImage(allowed[randomnumber].data.url) + .setFooter(`👍Likes: ${allowed[randomnumber].data.ups} | 💬Comments: ${allowed[randomnumber].data.num_comments}`) + .setColor("RANDOM") + + return message.channel.send(embed); + }) + } + +exports.help = { + name: "dog", + description: "Look dogs", + usage: "dog", + example: "dog" +}; + +exports.conf = { + aliases: [], + cooldown: 3 +}; diff --git a/commands/Image/meme.js b/commands/Image/meme.js new file mode 100644 index 0000000..af74662 --- /dev/null +++ b/commands/Image/meme.js @@ -0,0 +1,43 @@ +const Discord = require('discord.js'); +const fetch = require("node-fetch"); + +exports.run = async (client, message, args) => { + let loadingEmbed = new Discord.MessageEmbed() + .setColor("RANDOM") + .setDescription(` Generating a meme!...`) + let msg = await message.channel + .send(loadingEmbed) + .then(m => m.delete({ timeout: 2000 })); + + fetch("https://www.reddit.com/r/Memes.json?sort=top&t=daily") + .then(res => res.json()) + .then(body => { + if (!body) return message.reply("I broke, try again!"); + + const allowed = message.channel.nsfw ? body.data.children : body.data.children.filter(post => !post.data.over_18); + if (!allowed.length) return message.channel.send('Hmm looks like an error to me...'); + const randomnumber = Math.floor(Math.random() * allowed.length) + + let url = `https://www.reddit.com${allowed[randomnumber].data.permalink}` + let embed = new Discord.MessageEmbed() + .setTitle(allowed[randomnumber].data.title) + .setURL(url) + .setImage(allowed[randomnumber].data.url) + .setFooter(`👍Likes: ${allowed[randomnumber].data.ups} | 💬Comments: ${allowed[randomnumber].data.num_comments}`) + .setColor("RANDOM") + + return message.channel.send(embed); + }); + } + +exports.help = { + name: "meme", + description: "Look memes", + usage: "meme", + example: "meme" +} + +exports.conf = { + aliases: [], + cooldown: 3 +} \ No newline at end of file diff --git a/commands/Image/module.json b/commands/Image/module.json new file mode 100644 index 0000000..5fb3ed1 --- /dev/null +++ b/commands/Image/module.json @@ -0,0 +1,4 @@ +{ + "name": "Art", + "hide": false +} \ No newline at end of file diff --git a/commands/Information/corona.js b/commands/Information/corona.js new file mode 100644 index 0000000..ba2cdbb --- /dev/null +++ b/commands/Information/corona.js @@ -0,0 +1,42 @@ +const Discord = require("discord.js") ; +const fetch = require("node-fetch"); + +exports.run = async (client, message, args) => { + let countries = args[0] + + fetch(`https://corona.lmao.ninja/v2/countries/${countries}`) + .then(res => res.json()) + .then(data => { + let country = data.country; + let flag = data.countryInfo.flag; // Turns out -> Link. + let confirmed = data.cases.toLocaleString(); + let todayconfirmed = data.todayCases.toLocaleString(); + let deaths = data.deaths.toLocaleString(); + let todaydeaths = data.todayDeaths.toLocaleString(); + let recovered = data.recovered.toLocaleString(); + let critical = data.critical.toLocaleString(); + let active = data.active.toLocaleString(); + // Add .toLocaleString() if you wanna separate 3 numbers with commas. + + const embed = new Discord.MessageEmbed() + .setColor("RANDOM") + .setTimestamp(new Date()) + .setAuthor("Coronavirus Statistics", flag) + .addField(`Data for: ${country}`, `Confirmed: (Total: **${confirmed}** | Daily: **${todayconfirmed}**) \nDeaths: (Total: **${deaths}** | Daily: **${todaydeaths}**) \nRecovered: **${recovered}** \nCritical: **${critical}** \nActive: **${data.active}**`) // Sorry a little bit more complex. + + message.channel.send(embed); + // Let's test it out! + }) + } + +exports.help = { + name: "corona", + description: "Corona Virus informaton", + usage: "corona [country]", + example: "corona Cambodia\ncorona Indonesia" +} + +exports.conf = { + aliases: ["covid"], + cooldown: 5 +} \ No newline at end of file diff --git a/commands/Information/guilds.js b/commands/Information/guilds.js new file mode 100644 index 0000000..38db1ae --- /dev/null +++ b/commands/Information/guilds.js @@ -0,0 +1,20 @@ +const Discord = require("discord.js"); + +exports.run = async (client, message, args) => { + const guilds = new Discord.MessageEmbed() + .setColor("RANDOM") + .addField(`**Guild Count [${client.guilds.cache.size}]:**`, `${client.guilds.cache.map(g => g.name).join("\n ")}`); + return message.channel.send(guilds); +}; + +exports.help = { + name: "guilds", + description: "Look how many servers/guilds that the bot in", + usage: "guilds", + example: "guilds" +}; + +exports.conf = { + aliases: ["servers"], + cooldown: 5 +}; diff --git a/commands/Information/help.js b/commands/Information/help.js new file mode 100644 index 0000000..a375e14 --- /dev/null +++ b/commands/Information/help.js @@ -0,0 +1,66 @@ +const Discord = require("discord.js"); + +exports.run = async (client, message, args) => { + let prefix = client.config.prefix; + + if (!args[0]) { + // This will turn the folder (category) into array. + let module = client.helps.array(); + + // This will hide a folder from display that includes "hide: true" in their module.json + if (!client.config.owners.includes(message.author.id)) module = client.helps.array().filter(x => !x.hide); + const embed = new Discord.MessageEmbed() + .setColor("RANDOM") + .setTimestamp(new Date()) + .setDescription(`Type \`${prefix}help [command]\` to get more specific information about a command.`) + .setTitle("Help Menu") + + for (const mod of module) { + // You can change the .join(" | ") to commas, dots or every symbol. + embed.addField(`${mod.name}`, mod.cmds.map(x => `\`${x}\``).join(" | ")); + } + + return message.channel.send(embed); + } else { + let cmd = args[0]; + + // If the user type the [command], also with the aliases. + if (client.commands.has(cmd) || client.commands.get(client.aliases.get(cmd))) { + let command = client.commands.get(cmd) || client.commands.get(client.aliases.get(cmd)); + let name = command.help.name; // The command name. + let desc = command.help.description; // The command description. + let cooldown = command.conf.cooldown + " second(s)"; // The command cooldown. + let aliases = command.conf.aliases.join(", ") ? command.conf.aliases.join(", ") : "No aliases provided."; + let usage = command.help.usage ? command.help.usage : "No usage provided."; + let example = command.help.example ? command.help.example : "No example provided."; + + let embed = new Discord.MessageEmbed() + .setColor(0x7289DA) + .setTitle(name) + .setDescription(desc) + .setThumbnail(client.user.displayAvatarURL()) + .setFooter("[] optional, <> required. Don't includes these things while typing a command.") + .addField("Cooldown", cooldown) + .addField("Aliases", aliases, true) + .addField("Usage", usage, true) + .addField("Example", example, true) + + return message.channel.send(embed); + } else { + // If the user type the wrong command. + return message.channel.send({embed: {color: "RED", description: "Unknown command."}}); + } + } +} + +exports.help = { + name: "help", + description: "Show a command list.", + usage: "help [command]", + example: ".help verify" +} + +exports.conf = { + aliases: ["?"], + cooldown: 5 +} \ No newline at end of file diff --git a/commands/Information/info.js b/commands/Information/info.js new file mode 100644 index 0000000..116e742 --- /dev/null +++ b/commands/Information/info.js @@ -0,0 +1,28 @@ +const Discord = require('discord.js'); + +exports.run = async (client, message, args) => { + const embed = new Discord.MessageEmbed() + .setTitle("<:mdHelp:568466408548335650> Information Centre") + .setColor("RANDOM") + .setDescription("This is a quite easy to use which contains: **Moderate** | **Information** | **Fun** & more systems.") + .addField("Invite", `[Click Here](https://discord.com/api/oauth2/authorize?client_id=727448017799479296&permissions=271968370&scope=bot)`, true) + .addField("Support", `[Click Here](https://discord.gg/XYbcPBr)`, true) + .addField("Teammate", `<@725968708358373477> <@529493423556919296>`, true) + .addField("Goal", `<:Bot_Developer_Badge:742556995323822130>`, true) + .setTimestamp() + .setFooter(`Requested by ${message.author.tag}`, message.author.displayAvatarURL()) + + message.channel.send(embed); +} + +exports.help = { + name: "info", + description: "Information of the bot", + usage: "info", + example: "info" +} + +exports.conf = { + aliases: [], + cooldown: 5 +} \ No newline at end of file diff --git a/commands/Information/module.json b/commands/Information/module.json new file mode 100644 index 0000000..cf3706a --- /dev/null +++ b/commands/Information/module.json @@ -0,0 +1,4 @@ +{ + "name": "Information", + "hide": false +} \ No newline at end of file diff --git a/commands/Information/ping.js b/commands/Information/ping.js new file mode 100644 index 0000000..7908538 --- /dev/null +++ b/commands/Information/ping.js @@ -0,0 +1,27 @@ +const Discord = require('discord.js') + +exports.run = async (client, message, args) => { + try { + const m = await message.channel.send("Pinging..."); // Make sure the async is written, top of the client.on("message", ...) + const embed = new Discord.MessageEmbed() + .setColor("RANDOM") // Tired of choosing the embed colors? Just type "RANDOM" on it! + .addField("⌛ Latency", `**${m.createdTimestamp - message.createdTimestamp}ms**`) + .addField("💓 API", `**${Math.floor(client.ws.ping)}ms**`) // Use "client.ping" if your Discord.js is < 1.15.1 --- Use "client.ws.ping" if your Discord.js is > 12.0.0 + return m.edit(`🏓 Pong!`, embed); + } catch (error) { + return message.channel.send(`Something went wrong: ${error.message}`); + // Restart the bot as usual. + } + } + +exports.help = { + name: "ping", + description: "Check out the `ms`", + usage: "ping", + example: "ping" +} + +exports.conf = { + aliases: ["ms"], + cooldown: 5 +} \ No newline at end of file diff --git a/commands/Information/serverinfo.js b/commands/Information/serverinfo.js new file mode 100644 index 0000000..d4881d4 --- /dev/null +++ b/commands/Information/serverinfo.js @@ -0,0 +1,80 @@ +const Discord = require("discord.js"), + { post } = require("node-superfetch"); +const dateformat = require("dateformat"); +const moment = require("moment"); + +exports.run = async (bot, message, args) => { + const created = moment.utc(message.guild.createdAt).format("dddd, MMMM Do YYYY at h:mm:ss a"); + + const verify = { + NONE: "None", + LOW: "Low", + MEDIUM: "Medium", + HIGH: "High", + VERY_HIGH: "Highest" + } + + const region = { + brazil: ":flag_br: Brazil", + "eu-central": ":flag_eu: Central Europe", + singapore: ":flag_sg: Singapore", + "us-central": ":flag_us: U.S. Central", + sydney: ":flag_au: Sydney", + "us-east": ":flag_us: U.S. East", + "us-south": ":flag_us: U.S. South", + "us-west": ":flag_us: U.S. West", + "eu-west": ":flag_eu: Western Europe", + "vip-us-east": ":flag_us: VIP U.S. East", + london: ":flag_gb: London", + amsterdam: ":flag_nl: Amsterdam", + hongkong: ":flag_hk: Hong Kong", + russia: ":flag_ru: Russia", + japan: ":flag_jp: Japan", + southafrica: ":flag_za: South Africa" + } + + const contentFilterLevels = { + DISABLED: "Don't scan any media content.", + MEMBERS_WITHOUT_ROLES: "Scan media content from members without role.", + ALL_MEMBERS: "Scan media content from all members." + } + + const server = new Discord.MessageEmbed() + .setColor(0xd15994) + .setAuthor(message.guild.name, message.guild.iconURL({ format: "png", dynamic: true, size: 64 })) + .setThumbnail(message.guild.iconURL({ format: "png", dynamic: true, size: 1024 })) + .addField("**Server Name:**", `${message.guild.name}`, true) + .addField("**Server Region:**", `${region[message.guild.region]}`, true) + .addField("**Verification Level:**", `${verify[message.guild.verificationLevel]}`, true) + .addField("**Server ID:**", `${message.guild.id}`) + .addField("**Server Owner:**", `${message.guild.owner} <:Owner:742557045898739882>`) + .addField("**Explicit Filter:**", `${contentFilterLevels[message.guild.explicitContentFilter]}`) + .addField("**Server Created:**", `${created}`) + .addField("**Roles:**", `${message.guild.roles.cache.sort((a, b) => b.position - a.position).filter(r => r.id !== message.guild.id).map(r => `\`${r.name}\``).length}`) + .addField("**Statuses:**", `<:online:742557148730359819> Online: ${message.guild.members.cache.filter(s => s.user.presence.status === "online").size}\n<:idle:742557093432655905> Idle: ${message.guild.members.cache.filter(s => s.user.presence.status === "idle").size}\n<:dnd:742557115876638762> Do Not Disturb: ${message.guild.members.cache.filter(s => s.user.presence.status === "dnd").size}\n<:offline:742557131026464768> Offline: ${message.guild.members.cache.filter(s => s.user.presence.status === "offline").size}`) + .addField(`**Channels [${message.guild.channels.cache.filter(c => c.type === "text" || c.type === "voice").size}]:**`, `<:channel:745264480946225252> Text: ${message.guild.channels.cache.filter(c => c.type === "text").size}\n<:voice:745264517017108540> Voice: ${message.guild.channels.cache.filter(c => c.type === "voice").size}\n<:category:745264504157503498> Category: ${message.guild.channels.cache.filter(c => c.type === "category").size}`, true) + .addField(`**Members [${message.guild.memberCount}]:**`, `Humans: ${message.guild.members.cache.filter(m => !m.user.bot).size}\nBots: ${message.guild.members.cache.filter(m => m.user.bot).size}`, true) + .addField(`**Booster [${message.guild.premiumSubscriptionCount}]:**`, `Level: ${message.guild.premiumTier ? message.guild.premiumTier : "None"}`, true) + .addField(`**Emojis [${message.guild.emojis.cache.size}]:**`, `Normal: ${message.guild.emojis.cache.filter(e => !e.animated).size}\nAnimated: ${message.guild.emojis.cache.filter(e => e.animated).size}`, true) + .addField("**Inactive Timeout:**", `${message.guild.afkTimeout / 60} minutes`, true) + .addField("**Inactive Channel:**", `${message.guild.afkChannel ? message.guild.afkChannel.name : "No AFK Channel"}`, true) + .setTimestamp(new Date()) + .setFooter(message.author.username, message.author.displayAvatarURL({ format: "png", dynmaic: true, size: 64 })); + return message.channel.send(server); +} + +exports.help = { + name: "serverinfo", + description: "Show server information.", + usage: ["serverinfo"], + example: ["serverinfo"] +}; + +exports.conf = { + aliases: ["guildinfo"], + cooldown: 5 +}; + +function truncate(str, n){ + return (str.length > n) ? str.substr(0, n) + "..." : str; +} \ No newline at end of file diff --git a/commands/Information/spotify.js b/commands/Information/spotify.js new file mode 100644 index 0000000..672c674 --- /dev/null +++ b/commands/Information/spotify.js @@ -0,0 +1,57 @@ +const Discord = require("discord.js"); +const convert = require("parse-ms"); + +exports.run = async (client, message, args) => { + let user; + if (message.mentions.users.first()) { + user = message.mentions.users.first(); + } else { + user = message.author; + } + + let status; + if (user.presence.activities.length === 1) status = user.presence.activities[0]; + else if (user.presence.activities.length > 1) status = user.presence.activities[1]; + + if (user.presence.activities.length === 0 || status.name !== "Spotify" && status.type !== "LISTENING") { + return message.channel.send("This user isn't listening to Spotify."); + } + + if (status !== null && status.type === "LISTENING" && status.name === "Spotify" && status.assets !== null) { + let image = `https://i.scdn.co/image/${status.assets.largeImage.slice(8)}`, + url = `https:/open.spotify.com/track/${status.syncID}`, + name = status.details, + artist = status.state, + album = status.assets.largeText, + timeStart = status.timestamps.start, + timeEnd = status.timestamps.end, + timeConvert = convert(timeEnd - timeStart); + + let minutes = timeConvert.minutes < 10 ? `0${timeConvert.minutes}` : timeConvert.minutes; + let seconds = timeConvert.seconds < 10 ? `0${timeConvert.seconds}` : timeConvert.seconds; + let time = `${minutes}:${seconds}`; + + const embed = new Discord.MessageEmbed() + .setAuthor("Spotify Track Information", "https://image.flaticon.com/icons/svg/2111/2111624.svg") + .setColor(0x1ED768) + .setThumbnail(image) + .addField("Name:", name, true) + .addField("Album:", album, true) + .addField("Artist:", artist, true) + .addField("Duration:", time, false) + .addField("Listen now on Spotify!", `[\`${artist} - ${name}\`](${url})`, false) + return message.channel.send(embed) + } +} + +exports.help = { + name: "spotify", + description: "Show a Listening Spotify user status.", + usage: "spotify [@user]", + example: "spotify @Vii_Rakk#5424" + }; + + exports.conf = { + aliases: [], + cooldown: 5 + } \ No newline at end of file diff --git a/commands/Information/stats.js b/commands/Information/stats.js new file mode 100644 index 0000000..04468e6 --- /dev/null +++ b/commands/Information/stats.js @@ -0,0 +1,85 @@ +const Discord = require("discord.js"); + +exports.run = async (client, message, args) => { + let m = require('moment-duration-format'), + os = require('os'), + cpuStat = require('cpu-stat'), + ms = require('ms'), + moment = require('moment'), + fetch = require('node-fetch') + + cpuStat.usagePercent(function (error, percent, seconds) { + if (error) { + return console.error(error) + } + + const cores = os.cpus().length + const cpuModel = os.cpus()[0].model + const guild = client.guilds.cache.size.toLocaleString() + const user = client.users.cache.size.toLocaleString() + const channel = client.channels.cache.size.toLocaleString() + const usage = formatBytes(process.memoryUsage().heapUsed) // Your memory usage. + const Node = process.version // Your node version. + const CPU = percent.toFixed(2) // Your CPU usage. + + const embed = new Discord.MessageEmbed() + embed.addField('Bot Statistics:', `Server: ${guild} \nUser: ${user} \nChannel: ${channel} \nUsage: ${usage} \nNode: ${Node} \nCPU Usage: ${CPU}%`) // Use Grave accent or `` + embed.addField('Physical Statistics:', `CPU: ${cores} - ${cpuModel} \nUptime: **${parseDur(client.uptime)}**`) + + message.channel.send(embed) + }) +} + +exports.help = { + name: "stats", + description: "Information of the bot", + usage: "stats", + example: "stats" +}; + +exports.conf = { + aliases: [], + cooldown: 5 +}; + +function formatBytes (a, b) { + if (0 == a) return "0 Bytes"; + let c = 1024, + d = b || 2, + e = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], + f = Math.floor(Math.log(a) / Math.log(c)); + + return parseFloat((a / Math.pow(c, f)).toFixed(d)) + " " + e[f] +} + +function formatBytes (a, b) { + if (0 == a) return "0 Bytes"; + let c = 1024, + d = b || 2, + e = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], + f = Math.floor(Math.log(a) / Math.log(c)); + + return parseFloat((a / Math.pow(c, f)).toFixed(d)) + " " + e[f] +} // Create MB, KB, TB or something in the back of your memory counters. + +function parseDur(ms) { + let seconds = ms / 1000, + days = parseInt(seconds / 86400); + seconds = seconds % 86400 + + let hours = parseInt(seconds / 3600); + seconds = seconds % 3600 + + let minutes = parseInt(seconds / 60); + seconds = parseInt(seconds % 60) + + if (days) { + return `${days} day, ${hours} hours, ${minutes} minutes` + } else if (hours) { + return `${hours} hours, ${minutes} minutes, ${seconds} seconds` + } else if (minutes) { + return `${minutes} minutes, ${seconds} seconds` + } + + return `${seconds} second(s)` +} // Uptime bot. \ No newline at end of file diff --git a/commands/Information/userinfo.js b/commands/Information/userinfo.js new file mode 100644 index 0000000..05066fd --- /dev/null +++ b/commands/Information/userinfo.js @@ -0,0 +1,79 @@ +const Discord = require("discord.js"); +const moment = require("moment"); + +exports.run = async (client, message, args) => { + const user = message.mentions.users.first() || message.author; + const member = message.guild.member(user); + const nickname = member.nickname !== undefined && member.nickname !== null ? member.nickname : "None"; + const createdate = moment.utc(user.createdAt).format("dddd, MMMM Do YYYY at h:mm:ss a"); + const joindate = moment.utc(member.joinedAt).format("dddd, MMMM Do YYYY at h:mm:ss a"); + + const status = { + online: "<:online:742557148730359819> Online", + idle: "<:idle:742557093432655905> Idle", + dnd: "<:dnd:742557115876638762> DND", + offline: "<:offline:742557131026464768> Offline" + } + + const flags = { + DISCORD_EMPLOYEE: "<:Discord_Employee:745480143346335865> Discord Employee", + DISCORD_PARTNER: "<:Discord_Partner:745480206424473730> Discord Partner", + BUGHUNTER_LEVEL_1: "<:Bug_Hunter_1:745480035477094523> Bug Hunter (Level 1)", + BUGHUNTER_LEVEL_2: "<:Bug_Hunter_2:745480098051784755> Bug Hunter (Level 2)", + HYPESQUAD_EVENTS: "<:HypeSquad_Event:745478653739270225> HypeSquad Events", + HOUSE_BRAVERY: "<:House_of_Bravery:745475037305372694> House of Bravery", + HOUSE_BRILLIANCE: "<:House_of_Brilliance:745475049082847232> House of Brilliance", + HOUSE_BALANCE: "<:House_of_Balance:745475028828554080> House of Balance", + EARLY_SUPPORTER: "<:Early_Supporter:745480247339909190> Early Supporter", + TEAM_USER: "Team User", + SYSTEM: "System", + VERIFIED_BOT: "<:Discord_Verified:745473650186256415> Verified Bot", + VERIFIED_DEVELOPER: "<:Bot_Developer_Badge:742556995323822130> Verified Bot Developer" + } + + const bots = { + true: "<:tick:699481911587897416> Yes", + false: "<:wrong:699481910765944902> No" + } + + const userFlags = member.user.flags.toArray(); + + const Mapping = { + web: "<:mdGlobe:568466408137031691> Browser", + desktop: ":desktop: Desktop", + mobile: ":iphone: Mobile", + } + + const client2 = Object.entries(message.member.presence.clientStatus || {}).map(entry => entry[0]).map(entry => Mapping[entry]).join("\n") || "No Client"; + + const info = new Discord.MessageEmbed() + .setColor("RANDOM") + .setAuthor(user.tag, user.displayAvatarURL({ format: "png", dynamic: true, size: 64 })) + .setThumbnail(user.displayAvatarURL({ format: "png", dynamic: true, size: 1024 })) + .addField("**Username:**", `${user.username}`, true) + .addField("**Nickname:**", `${nickname}`, true) + .addField("**Status:**", `${status[user.presence.status]}`, true) + .addField("**Account ID:**", `${user.id}`) + .addField("**Account Created:**", `${createdate}`) + .addField("**Join Date:**", `${joindate}`) + .addField("**Badges:**", `${userFlags.length ? userFlags.map(flag => flags[flag]).join("\n") : "No Badges"}`) + .addField("**Activity:**", `${member.user.presence.activities.length > 0 ? member.user.presence.activities.join("\n") : "No Activity"}`, true) + .addField("**Client Status:**", `${client}`, true) + .addField("**Bot:**", `${bots[member.user.bot]}`, true) + .addField(`**Roles [${member.roles.cache.sort((a, b) => b.position - a.position).filter(r => r.id !== message.guild.id).map(roles => `\`${roles.name}\``).length}]:**`, `Highest: ${member.roles.highest ? member.roles.highest : "None"}\nList: ${member.roles.cache.sort((a, b) => b.position - a.position).filter(r => r.id !== message.guild.id).map(r => `${r}`).join(", ") || "No Roles"}`) + .setTimestamp(new Date()) + .setFooter(user.username, user.displayAvatarURL({ format: "png", dynamic: true, size: 64 })) + return message.channel.send(info); +} + +exports.help = { + name: "userinfo", + description: "Information of the user", + usage: "userinfo [@user]", + example: "userinfo @Vii_Rakk#5424" +}; + +exports.conf = { + aliases: [], + cooldown: 5 +}; \ No newline at end of file diff --git a/commands/Moderate/kick.js b/commands/Moderate/kick.js new file mode 100644 index 0000000..518256b --- /dev/null +++ b/commands/Moderate/kick.js @@ -0,0 +1,33 @@ +const Discord = require("discord.js"); + +exports.run = async (client, message, args) => { + if (!message.member.hasPermission("KICK_MEMBERS") || !message.member.hasPermission("ADMINISTRATOR")) return message.channel.send("You don't have a permissions to do this."); + let user = message.mentions.users.first(); + + let member = message.guild.member(user); + let reason = args.slice(1).join(" "); + + if (!user) return message.channel.send("Please mention the user."); + if (user.id === message.author.id) return message.channel.send("You can't kick yourself."); + if (user.id === client.user.id) return message.channel.send("You can't kick me."); + + if (!reason) reason = "No reason provided"; + + member.kick(reason).then(() => { + message.channel.send(`Successfully kicked **${user.tag}**`); + }).catch(err => { + message.reply("I was unable to kick the member."); + }) + } + +exports.help = { + name: "kick", + description: "Kick some noobs away", + usage: "kick [@user] [reason]", + example: "kick @Vii_Rakk#5424 idiot" +} + +exports.conf = { + aliases: [], + cooldown: 5 +} \ No newline at end of file diff --git a/commands/Moderate/module.json b/commands/Moderate/module.json new file mode 100644 index 0000000..78cee9e --- /dev/null +++ b/commands/Moderate/module.json @@ -0,0 +1,4 @@ +{ + "name": "Moderate", + "hide": false +} \ No newline at end of file diff --git a/commands/Search/anime.js b/commands/Search/anime.js new file mode 100644 index 0000000..79cbaca --- /dev/null +++ b/commands/Search/anime.js @@ -0,0 +1,47 @@ +const Discord = require("discord.js"); +const Kitsu = require("kitsu.js"); +const kitsu = new Kitsu(); + +exports.run = async (bot, message, args) => { + if (!args[0]) return message.channel.send(`**${message.author.username}**, enter the name of anime you are looking for!`); + + const search = args.join(" "); + + kitsu.searchAnime(search).then(async result => { + const anime = result[0]; + + if (result.length === 0) return message.channel.send(`**${message.author.username}**, there is no result called **${search}**.`); + + const info = new Discord.MessageEmbed() + .setColor("RANDOM") + .setAuthor("Kitsu", "https://kitsu.io/favicon-194x194-2f4dbec5ffe82b8f61a3c6d28a77bc6e.png") + .setTitle(`**${anime.titles.romaji ? anime.titles.romaji : "Unknown"}**`) + .setURL(anime.url) + .setDescription(`**Synopsis:**\n> ${anime.synopsis.replace(/<[^>]*>/g, "").split("\n")[0]}`) + .setThumbnail(anime.posterImage.original) + .addField("**Japanese:**", `${anime.titles.japanese ? anime.titles.japanese : "Unknown"}`, true) + .addField("**English:**", `${anime.titles.english ? anime.titles.english : "Unknown"}`, true) + .addField("**Rating:**", `${anime.averageRating ? anime.averageRating : "Unknown"}`, true) + .addField("**Start Date:**", `${anime.startDate ? anime.startDate : "Unknown"}`, true) + .addField("**End Date:**", `${anime.endDate ? anime.endDate : "Unknown"}`, true) + .addField("**Type:**", `${anime.showType ? anime.showType : "Unknown"}`, true) + .addField("**Episodes:**", `${anime.episodeCount ? anime.episodeCount : "Unknown"}`, true) + .addField("**Duration:**", `${anime.episodeLength ? anime.episodeLength : "??"} minutes`, true) + .addField("**Rank:**", `${anime.ratingRank ? anime.ratingRank : "Unknwon"}`, true) + .setTimestamp(new Date) + .setFooter(message.author.username, message.author.displayAvatarURL({ format: "png", dynamic: true, size: 64 })); + return message.channel.send(info); + }) +} + +exports.help = { + name: "anime", + description: "Show anime information.", + usage: ["anime "], + example: ["anime <Fairy Tail>"] +} + +exports.conf = { + aliases: [], + cooldown: 10 +} \ No newline at end of file diff --git a/commands/Search/module.json b/commands/Search/module.json new file mode 100644 index 0000000..9d7d699 --- /dev/null +++ b/commands/Search/module.json @@ -0,0 +1,4 @@ +{ + "name": "Search", + "hide": false +} \ No newline at end of file diff --git a/commands/Search/wikipedia.js b/commands/Search/wikipedia.js new file mode 100644 index 0000000..cccaa65 --- /dev/null +++ b/commands/Search/wikipedia.js @@ -0,0 +1,35 @@ +const Discord = require('discord.js'); +const axios = require("axios"); + +exports.run = async (client, message, args) => { + const query = args.join(" ").trim(); + if (!query) return message.channel.send(`<:no:736498705972068442> **|** __**${message.author.username}**__, Masukan judul artikel yang akan dicari!`); + + const headers = { 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36' }; + axios.get(`https://en.wikipedia.org/api/rest_v1/page/summary/${encodeURIComponent(query)}`, { headers }).then(res => { + const article = res.data; + + const wikipedia = new Discord.MessageEmbed() + .setColor(0xd15994) + .setAuthor("Wikipedia", "https://i.imgur.com/a4eeEhh.png") + .setTitle(`**${article.title}**`) + .setURL(article.content_urls.desktop.page) + .setDescription(`> ${article.extract}`) + .setThumbnail(article.originalimage ? article.originalimage.source : null) + .setTimestamp(new Date()) + .setFooter(message.author.username, message.author.displayAvatarURL({ format: "png", dynamic: true, size: 64 })) + return message.channel.send(wikipedia); + }).catch(() => message.channel.send(`**${message.author.username}**, there is no result called **${query}**.`)); +} + +exports.help = { + name: "wikipedia", + description: "Searches Wikipedia for something.", + usage: ["wikipedia <title>"], + example: ["wikipedia One Piece"] +}; + +exports.conf = { + aliases: ["wiki"], + cooldown: 10 +}; \ No newline at end of file diff --git a/commands/Setting/afk.js b/commands/Setting/afk.js new file mode 100644 index 0000000..e1f1c8b --- /dev/null +++ b/commands/Setting/afk.js @@ -0,0 +1,31 @@ +const Discord = require("discord.js"); +const db = require("quick.db"); + +exports.run = async (client, message, args) => { + const status = new db.table("AFKs"); + let afk = await status.fetch(message.author.id); + const embed = new Discord.MessageEmbed().setColor("RANDOM") + + if (!afk) { + embed.setDescription(`**${message.author.tag}** now AFK.`) + embed.setFooter(`Reason: ${args.join(" ") ? args.join(" ") : "AFK"}`) + status.set(message.author.id, args.join(" ") || `AFK`); + } else { + embed.setDescription("You are no longer AFK."); + status.delete(message.author.id); + } + + message.channel.send(embed) +} + +exports.help = { + name: "afk", + description: "AFK", + usage: ["afk <reason>"], + example: ["afk go to poop\n afk go to pee"] +} + +exports.conf = { + aliases: [], + cooldown: 5 +} \ No newline at end of file diff --git a/commands/Setting/module.json b/commands/Setting/module.json new file mode 100644 index 0000000..b2050ae --- /dev/null +++ b/commands/Setting/module.json @@ -0,0 +1,4 @@ +{ + "name": "Setting", + "hide": false +} \ No newline at end of file diff --git a/commands/Setting/resetnick.js b/commands/Setting/resetnick.js new file mode 100644 index 0000000..c7a8a91 --- /dev/null +++ b/commands/Setting/resetnick.js @@ -0,0 +1,28 @@ +const Discord = require("discord.js"); + +exports.run = async (bot, message, args) => { + if (!message.member.hasPermission("MANAGE_NICKNAMES")) return message.channel.send(`**${message.author.username}**, please check your permssion again!`); + + let user = message.mentions.users.first(); + if (!user) return message.channel.send(`**${message.author.username}**, please mention a user`); + + let member = message.guild.members.cache.get(user.id); + + await member.setNickname(null).then(() => { + return message.channel.send(`**Completed**, Nickname of **${user.tag}** has been reset to default`); + }).catch(err => { + return message.channel.send(`**Error**, failed to reset nickname from **${user.tag}**. \nMake sure role **${bot.user.username}** is higher than members roles.`); + }); +} + +exports.help = { + name: "resetnick", + description: "Reset a user nickname.", + usage: ["resetnick <@user>"], + example: ["resetnick @Vii_Rakk#5424"] +} + +exports.conf = { + aliases: ["resetnickname"], + cooldown: 5 +} \ No newline at end of file diff --git a/commands/Setting/setnick.js b/commands/Setting/setnick.js new file mode 100644 index 0000000..028b910 --- /dev/null +++ b/commands/Setting/setnick.js @@ -0,0 +1,31 @@ +const Discord = require("discord.js"); + +exports.run = async (bot, message, args) => { + if (!message.member.hasPermission("MANAGE_NICKNAMES")) return message.channel.send(`**${message.author.username}**, please check your permssion again!`); + + let user = message.mentions.users.first(); + if (!user) return message.channel.send(`**${message.author.username}**, please mention a user`); + + let nick = args.slice(1).join(" "); + if (!nick) return message.channel.send(`**${message.author.username}**, please enter the name that you want to put for that user`); + + let member = message.guild.members.cache.get(user.id); + + await member.setNickname(nick).then(() => { + return message.channel.send(`**Completed**, Nickname of **${user.tag}** has been changed to **${nick}**.`); + }).catch(err => { + return message.channel.send(`**Error**, failed to change nickname from **${user.tag}**. \nMake sure role **${bot.user.username}** is higher than members role.`); + }); +} + +exports.help = { + name: "setnick", + description: "Set a user nickname.", + usage: ["setnick `<@user>` `<nickname>`"], + example: ["setnick `@Vii_Rakk#5424` `Virak`"] +} + +exports.conf = { + aliases: ["setnickname"], + cooldown: 5 +} \ No newline at end of file diff --git a/commands/Setting/slowmode.js b/commands/Setting/slowmode.js new file mode 100644 index 0000000..f198af0 --- /dev/null +++ b/commands/Setting/slowmode.js @@ -0,0 +1,43 @@ +const ms = require("ms"); + +exports.run = async (client, message, args) => { + if (!message.member.permissions.any(["ADMINISTRATOR", "MANAGE_CHANNELS"])) { + return message.channel.send("Oopsie, you don't have any rights to do this."); + } + + let channel = message.mentions.channels.first(), + time = args.slice(1).join(" "); + + if (!channel) time = args.join(" "), channel = message.channel; + // If the user doesn't includes the channel. + + if (message.flags[0] === "off") { + channel.setRateLimitPerUser(0); + return message.channel.send(`<#${channel.id}> slowmode has been deactivated.`); + } + + if (!time) return message.channel.send("Please includes the time format."); + + let convert = ms(time); // This will results the milliseconds. + let toSecond = Math.floor(convert / 1000); // This will convert the ms to s. (seconds) + + if (!toSecond || toSecond == undefined) return message.channel.send("Please insert the valid time format!"); + + if (toSecond > 21600) return message.channel.send("Timer should be less than or equal to 6 hours."); + else if (toSecond < 1) return message.channel.send("Timer should be more than or equal to 1 second."); + + await channel.setRateLimitPerUser(toSecond); + return message.channel.send(`This channel: <#${channel.id}> has been slowing down for **${ms(ms(time), {long: true})}**.`); +} + +exports.help = { + name: "slowmode", + description: "Slowing down the channel.", + usage: "slowmode [channel] <time>", + example: "slowmode #general 5s \nslowmode 5.25 hrs" +} + +exports.conf = { + aliases: ["slow"], + cooldown: 10 +} \ No newline at end of file diff --git a/commands/Utility/module.json b/commands/Utility/module.json new file mode 100644 index 0000000..9e09775 --- /dev/null +++ b/commands/Utility/module.json @@ -0,0 +1,4 @@ +{ + "name": "Utility", + "hide": false +} \ No newline at end of file diff --git a/commands/Utility/ytstat.js b/commands/Utility/ytstat.js new file mode 100644 index 0000000..d8950b5 --- /dev/null +++ b/commands/Utility/ytstat.js @@ -0,0 +1,38 @@ +const fetch = require("node-superfetch"); // npm install node-superfetch +const Discord = require("discord.js"); + +exports.run = async (client, message, args) => { + let name = args.join(" "); + if (!name) return message.channel.send("Unknown channel name."); + + const channel = await fetch.get(`https://www.googleapis.com/youtube/v3/search?part=snippet&q=${name}&key=${client.config.google}&maxResults=1&type=channel`) + .catch(() => message.channel.send("Unknown channel error.")); + + if (!channel.body.items[0]) return message.channel.send("No channel result. Try again."); + + const data = await fetch.get(`https://www.googleapis.com/youtube/v3/channels?part=snippet,contentDetails,statistics,brandingSettings&id=${channel.body.items[0].id.channelId}&key=${client.config.google}`) + .catch(() => message.channel.send("Unknown channel data error.")); + + const embed = new Discord.MessageEmbed() + .setColor(0x7289DA) + .setThumbnail(channel.body.items[0].snippet.thumbnails.high.url) + .setTimestamp(new Date()) + .addField("Channel Name", channel.body.items[0].snippet.channelTitle, true) + .addField("Channel Description", channel.body.items[0].snippet.description, true) + .addField("Subscribers Count", parseInt(data.body.items[0].statistics.subscriberCount).toLocaleString(), true) + .addField("Total Views", parseInt(data.body.items[0].statistics.viewCount).toLocaleString(), true) + .addField("Total Video(s)", parseInt(data.body.items[0].statistics.videoCount).toLocaleString(), true) + .addField("Date Created", new Date(channel.body.items[0].snippet.publishedAt).toDateString(), true) + .addField("Link", `[${channel.body.items[0].snippet.channelTitle}](https://www.youtube.com/channel/${channel.body.items[0].id.channelId})`, true) + return message.channel.send(embed); +} + +exports.help = { + name: "ytstat", + description: "Display a YouTube user information." +} + +exports.conf = { + aliases: ["yts", 'youtube'], + cooldown: 10 +} \ No newline at end of file diff --git a/config.json b/config.json new file mode 100644 index 0000000..5a0dc98 --- /dev/null +++ b/config.json @@ -0,0 +1,5 @@ +{ + "owners": ["725968708358373477", "529493423556919296"], + "prefix": ".", + "google": "AIzaSyBzgTW3ILZ2YaQd4VAp0UJC6fIwQWj067s" +} \ No newline at end of file diff --git a/events/experience.js b/events/experience.js new file mode 100644 index 0000000..244559a --- /dev/null +++ b/events/experience.js @@ -0,0 +1,48 @@ +const Discord = require("discord.js"); +const db = require("quick.db"); + +module.exports = async (client, message) => { + let recent = client.recent; // new Set(); + + // Ignore the bot. + if (message.author.bot || message.author === client.user) return; + + // If the user has an exp. cooldown, ignore it. + if (recent.has(message.author.id)) return; + + // Get the leveling database. + // This is global leveling. If you want the leveling per server, do this: + // let userprof = db.get(`leveling.${message.guild.id}.${message.author.id}`); + let userprof = db.get(`leveling.${message.author.id}`); + + // If the user doesn't have any leveling stats at all, set it up. + if (!userprof) return db.set(`leveling.${message.author.id}`, {xp: 0, level: 0}); + + // Give them an EXP. + await db.add(`leveling.${message.author.id}.xp`, client.leveling.gainedXp()); + + // Notice them if the user has leveled/ranked up. + if (client.leveling.getLevel(userprof.xp) > userprof.level) { + await db.add(`leveling.${message.author.id}.level`, 1); + userprof.level = client.leveling.getLevel(userprof.xp); + message.channel.send(`**${message.author.tag}** reached level **${userprof.level}!** Congratulations!`); + }; + + // Generate a random timer. (2) + let randomTimer = getRandomInt(60000, 75000); // Around 60 - 75 seconds. You can change it. + + // Add the user into the Set() + recent.add(message.author.id); + + // Remove the user when it's time to stop the cooldown. + client.setTimeout(() => { + recent.delete(message.author.id) + }, randomTimer); +} + +// Generate a random timer. +function getRandomInt(min, max) { + min = Math.ceil(min); + max = Math.floor(max); + return Math.floor(Math.random() * (max - min + 1)) + min; +} \ No newline at end of file diff --git a/events/message.js b/events/message.js new file mode 100644 index 0000000..fc4fe66 --- /dev/null +++ b/events/message.js @@ -0,0 +1,95 @@ +const Discord = require("discord.js"), cooldowns = new Discord.Collection(), db = require("quick.db"); +// cooldowns will store the user when they are still in the cooldown mode. + +module.exports = async (client, message) => { + // Prevent any chit-chats with other bots, or by himself. + if (message.author.bot || message.author === client.user) return; + + let prefix = client.config.prefix; + + let inviteLink = ["discord.gg/", "discord.com/invite", "discordapp.com/invite"]; + + if (inviteLink.some(word => message.content.toLowerCase().includes(word))) { + await message.delete(); + return message.channel.send("Bro, you can't promote your server here!") + .then(m => m.delete({timeout: 10000})) // Add this if you want the message automatically deleted. + } + + client.emit('experience', message); + + let afk = new db.table("AFKs"), + authorStatus = await afk.fetch(message.author.id), + mentioned = message.mentions.members.first(); + + if (mentioned) { + let status = await afk.fetch(mentioned.id); + + if (status) { + const embed = new Discord.MessageEmbed() + .setColor("RANDOM") + .setDescription(`This user (${mentioned.user.tag}) is AFK: **${status}**`) + message.channel.send(embed).then(i => i.delete({timeout: 5000})); + } + } + + if (authorStatus) { + const embed = new Discord.MessageEmbed() + .setColor("RANDOM") + .setDescription(`**${message.author.tag}** is no longer AFK.`) + message.channel.send(embed).then(i => i.delete({timeout: 5000})); + afk.delete(message.author.id) + } + + // If the user doesn't doing any to the bot, return it. + if (!message.content.startsWith(prefix)) return; + + let args = message.content.slice(prefix.length).trim().split(/ +/g); + let msg = message.content.toLowerCase(); + let cmd = args.shift().toLowerCase(); + let sender = message.author; + + // Many people don't know what is message.flags. + // We've already seen a bot who has a message.flags or they would called, parameter things. + message.flags = [] + while (args[0] && args[0][0] === "-") { + message.flags.push(args.shift().slice(1)); // Example: /play -soundcloud UP pice + } + + let commandFile = client.commands.get(cmd) || client.commands.get(client.aliases.get(cmd)); + if (!commandFile) return; // If the commands doesn't exist, ignore it. Don't send any warning on this. + + // This will set a cooldown to a user after typing a command. + if (!cooldowns.has(commandFile.help.name)) cooldowns.set(commandFile.help.name, new Discord.Collection()); + + const member = message.member, + now = Date.now(), + timestamps = cooldowns.get(commandFile.help.name), + cooldownAmount = (commandFile.conf.cooldown || 3) * 1000; + + if (!timestamps.has(member.id)) { + if (!client.config.owners.includes(message.author.id)) { + // If the user wasn't you or other owners that stored in config.json + timestamps.set(member.id, now); + } + } else { + const expirationTime = timestamps.get(member.id) + cooldownAmount; + + if (now < expirationTime) { + const timeLeft = (expirationTime - now) / 1000; + return message.channel.send(`Calm down dude, please wait **${timeLeft.toFixed(1)}** seconds to try the command again.`); + } + + timestamps.set(member.id, now); + setTimeout(() => timestamps.delete(member.id), cooldownAmount); // This will delete the cooldown from the user by itself. + } + + try { + if (!commandFile) return; + commandFile.run(client, message, args); + } catch (error) { + console.log(error.message); + } finally { + // If you want to really know, who is typing or using your bot right now. + console.log(`${sender.tag} (${sender.id}) ran a command: ${cmd}`); + } +} \ No newline at end of file diff --git a/events/messageDelete.js b/events/messageDelete.js new file mode 100644 index 0000000..6a23975 --- /dev/null +++ b/events/messageDelete.js @@ -0,0 +1,26 @@ +const db = require("quick.db"); // v7.1.1 + +module.exports = async (client, message) => { + if (message.partial) await message.fetch(); + // Uncached message can be fetched. + + // If the system are doing in DM, return it. + if (!message.guild || message.channel.type === "dm") return; + + // If the user was a robot, return. + if (message.author.bot || message.author === client.user) return; + + // Save the content. + db.set(`snipe.${message.guild.id}.content`, message.content); + + // Save the user tag. + db.set(`snipe.${message.guild.id}.user`, message.author.tag); + + // Save the channel. + db.set(`snipe.${message.guild.id}.channel`, message.channel.id); + + // Reset the snipe database every minute. + setTimeout(function() { + db.delete(`snipe.${message.guild.id}`); + }, 60000) // 60 seconds in milliseconds. +} diff --git a/events/ready.js b/events/ready.js new file mode 100644 index 0000000..ba68aa3 --- /dev/null +++ b/events/ready.js @@ -0,0 +1,16 @@ +const Discord = require("discord.js"); + +module.exports = client => { + console.log(`Ready as ${client.user.tag} to serve in ${client.channels.cache.size} channels on ${client.guilds.cache.size} servers, for a total of ${client.users.cache.size} users.`); + function randomStatus() { + let status = [`on ${client.guilds.cache.size} guild(s) || Type .help`, `with ${client.users.cache.size} online(s) || Type .help`] // You can change it whatever you want. + let rstatus = Math.floor(Math.random() * status.length); + + // client.user.setActivity(status[rstatus], {type: "WATCHING"}); + // You can change the "WATCHING" into STREAMING, LISTENING, and PLAYING. + // Example: streaming + + client.user.setActivity(status[rstatus], {type: "STREAMING", url: "https://www.twitch.tv/vii_rakk"}); + } + setInterval(randomStatus, 30000); // Time in ms. 30000ms = 30 seconds. Min: 20 seconds, to avoid ratelimit. +} \ No newline at end of file diff --git a/handler/ClientBuilder.js b/handler/ClientBuilder.js new file mode 100644 index 0000000..a3bba36 --- /dev/null +++ b/handler/ClientBuilder.js @@ -0,0 +1,14 @@ +const {Client, Collection} = require("discord.js"); + +module.exports = class TutorialBot extends Client { + constructor(options) { + super(options) + + this.commands = new Collection(); // This will store your commands. + this.cooldowns = new Collection(); // This will store your commands with cooldowns. + this.aliases = new Collection(); // This will store your alternative commands. Example: /server -> /serverinfo, /guild, /guildinfo + this.config = require('../config.json'); + this.recent = new Set(); + this.leveling = require("./LevelingUtil.js") + } +} \ No newline at end of file diff --git a/handler/Event.js b/handler/Event.js new file mode 100644 index 0000000..cee8da4 --- /dev/null +++ b/handler/Event.js @@ -0,0 +1,12 @@ +// In here, we're can add some events in /events folder, so we don't need to fill it up the server.js with all these events. + +const { readdirSync } = require("fs"); // You don't need to install this again. + +module.exports = client => { + const events = readdirSync("./events/"); + for (let event of events) { + let file = require(`../events/${event}`); + client.on(event.split(".")[0], (...args) => file(client, ...args)); + // This will remove the .js and only with the name of the event. + } +} \ No newline at end of file diff --git a/handler/LevelingUtil.js b/handler/LevelingUtil.js new file mode 100644 index 0000000..d84aed6 --- /dev/null +++ b/handler/LevelingUtil.js @@ -0,0 +1,18 @@ +const moment = require("moment"); + +this.getLevel = (xp) => { + return Math.floor(0.177 * Math.sqrt(xp)) + 1; +} + +this.getLevelBounds = (level) => { + // Example: getLevelBounds(1) + // Results: lowerBound: 1, upperBound: 32 + const lowerBound = Math.ceil(((level - 1) / 0.177) ** 2); + const upperBound = Math.ceil((level / 0.177) ** 2); + return { lowerBound, upperBound }; +} + +this.gainedXp = () => { + // Generates a random XP amount. From range 3 - 9. + return Math.ceil(Math.random() * 9) + 3; +} \ No newline at end of file diff --git a/handler/module.js b/handler/module.js new file mode 100644 index 0000000..805b293 --- /dev/null +++ b/handler/module.js @@ -0,0 +1,47 @@ +const Discord = require("discord.js"), + fs = require("fs"); + +// Please be careful, this code will makes you confusing and it will risks an error if you don't try to focus it. + +module.exports = client => { + client.commands = new Discord.Collection(); + client.aliases = new Discord.Collection(); + client.helps = new Discord.Collection(); + + fs.readdir("./commands/", (err, categories) => { + if (err) console.log(err); // it will send you an error, if there was something went wrong. + console.log(`Found total ${categories.length} categories.`); + + categories.forEach(category => { + let moduleConf = require(`../commands/${category}/module.json`); + moduleConf.path = `./commands/${category}`; + moduleConf.cmds = []; + if (!moduleConf) return; // If there was no module.json in the folder, return. + client.helps.set(category, moduleConf); + + fs.readdir(`./commands/${category}`, (err, files) => { + // Example: Found total 19 command(s) from admin. + console.log( + `Found total ${files.length - 1} command(s) from ${category}.` + ); + if (err) console.log(err); + let commands = new Array(); + + files.forEach(file => { + if (!file.endsWith(".js")) return; // If the file wasn't ended with .js, ignore it. + let prop = require(`../commands/${category}/${file}`); + let cmdName = file.split(".")[0]; + + client.commands.set(prop.help.name, prop); + + prop.conf.aliases.forEach(alias => { + client.aliases.set(alias, prop.help.name); + }); + + client.helps.get(category).cmds.push(prop.help.name); + // This will push the data into Collection, which is includes name of the file, aliases, and many. + }); + }); + }); + }); +}; diff --git a/json.sqlite b/json.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..6c23c72216cc1b31741934eb5b305e3c14d16dc6 GIT binary patch literal 12288 zcmeI1O=~1o6o#um%tA70T?~VSU{4965QcNlxu3mIqlqHUMr~1HT=ayVA!D0_q?H*$ zEs~Y!etyaP0&%5#!Igi-_qNonRP4qP6qLCI)qT_b);ae)=i>(Y;}35i%%{V9M<-uR z=0ho7C_0_ut>LgJy1k+(;$2@|Ec*2yc<)?VuUNvytv7$YhHtxrZ;Qc?c*$2LkO^c0 znLs9x31kA9Kqin0WCEE$Ch!as7<JcfT)*D=d_K85o9?{(!D+mE?|ihkGu|7Hciz6e zH;kVQUweOdINtkgyghtydUUv0zCP+)dNzI>?{4eag?QPs*Vcb7*4CaBgW1Ml<EOPJ z>lf=^Ji}?op=Sb_Kqin0{D%pA|7yR#^>}AC{bo8lIJ|#WIyS+2M_!B<C)&AkbXGn* zE=S(;cDWFiBU^2kmWZ8&S}{58Np!7L!6v0dW$>cC^InTltXZ3+WS^7_rHEpf)LN{B zph$DAWRawdHVp?IM6(!Ug9;pMtrVSvDw^~@1Sf3a+X{A>0^-mT+F*imL|T*53h$w| zXq&*}CXHqV_sSb~3M-oe*X?MG*35<^XopC=vQ%4Cu2IHl;`iDb3BrM#<KSzhX@t?Y zwT=u?@WDGpR#fuM)QZN5wX9$Ysd0vaX?(YZ+89t51}8G&m6F=EaxIIf3Q=A=q{Xo% zZB;F7b97`iVpbM9@-9#^*f=JHqMZTp;DU(9W`j#HE7fvrjHAGWG?FpeAgbE2YI`<f zjWrrEfVT6@$zt2HRhEM&i!2*Z2gzixDco2)v0_B9HN1PkX$-b&%qa~zUPxJwS5m2L zuk6q%4lcq$W>7uCO(^Y{bs%75A%~JgnnP-tb|@14q7npkW;H6K@yyL07nQ?CB0q=N z6_E1^i|7%8PzV-1DNssqnl^}VPy|Xbk^|Vt4K`d0+jZl_2Wu@*lSZ#vYG_}o*|<fm zjcBEXph34Pn>z4HML5AcL6dlPOn}++v}siiipF7oV%Rw2jkPIe-)<{b8g1o`A;uU$ z|EFnUo3RtOh=$j|hqjOHsxAfH_Ka2`i&1JUCJ#I3QWGfCWO^~kP_zLhMvPpNLHNrs zR<Eq}UfMZ6nch2i7>6{5F8~-OX4p5_Zh5P$-g~aUb>5pzPUoK<oqV}mw|vAa6EG+M z2(eRDZT!;N-TLm)(;N$6keDxq{mNs(H{H4@$d#wUl`*>dP*9EQMZ2y%6Ry<HKX4}K zE3W^1CY<|jfAix0WPktY>%;kS>}TcO$!v1CKP^X^;!s?c*}r@gGh0=7c=?H(JYYIN zwER#?A{=~G^?a{)<Hgg%gX8I0HTa=;ym_(pv|;?=<lhdX8h83HpKr!W-<=%H9xX?- zC~6X8Srck+8J;Nd7@ykVOt0{d+8cG;So0@;$3Yc;o5zp-#o)KN$X6zi31kA9Kqin0 kWCEE$CXfka0+~Q2kO}-h3EaH7<mZt)<#>8Jzf+dK1FbWJ4FCWD literal 0 HcmV?d00001 diff --git a/notepad b/notepad new file mode 100644 index 0000000..4e7cd29 --- /dev/null +++ b/notepad @@ -0,0 +1,310 @@ +const Discord = require('discord.js'); +const client = new Discord.Client + +let m = require('moment-duration-format'), + os = require('os'), + cpuStat = require('cpu-stat'), + ms = require('ms'), + moment = require('moment'), + fetch = require('node-fetch'), + db = require('quick.db') + +require('./uptime.js'); + +client.on("ready", () => { + function randomStatus() { + let status = ["Discord Bot", "YouTube", "Discord", "Glitch", "Node.js"] // You can change it whatever you want. + let rstatus = Math.floor(Math.random() * status.length); + + // client.user.setActivity(status[rstatus], {type: "WATCHING"}); + // You can change the "WATCHING" into STREAMING, LISTENING, and PLAYING. + // Example: streaming + + client.user.setActivity(status[rstatus], {type: "STREAMING", url: "https://www.twitch.tv/chilledcow"}); + }; setInterval(randomStatus, 30000) // Time in ms. 30000ms = 30 seconds. Min: 20 seconds, to avoid ratelimit. + + console.log('Online.') +}) + +client.on('message', async message => { + if (message.author.bot) return; + + let pref = db.get(`prefix.${message.guild.id}`); + let prefix; + + if (!pref) { + prefix = "/"; // If the server doesn't have any custom prefix, return default. + } else { + prefix = pref; + } + + let afk = new db.table("AFKs"), + authorStatus = await afk.fetch(message.author.id), + mentioned = message.mentions.members.first(); + + if (mentioned) { + let status = await afk.fetch(mentioned.id); + + if (status) { + const embed = new Discord.MessageEmbed() + .setColor("RANDOM") + .setDescription(`This user (${mentioned.user.tag}) is AFK: **${status}**`) + message.channel.send(embed).then(i => i.delete({timeout: 5000})); + } + } + + if (authorStatus) { + const embed = new Discord.MessageEmbed() + .setColor("RANDOM") + .setDescription(`**${message.author.tag}** is no longer AFK.`) + message.channel.send(embed).then(i => i.delete({timeout: 5000})); + afk.delete(message.author.id) + } + + if (!message.content.startsWith(prefix)) return; + + let args = message.content.slice(prefix.length).trim().split(/ +/g); + let msg = message.content.toLowerCase(); + let cmd = args.shift().toLowerCase(); + + if (msg.startsWith(prefix + "prefix")) { + if (!message.member.hasPermission("MANAGE_GUILD")) return message.channel.send("You don't have any permissions to do this!"); + let data = db.get(`prefix.${message.guild.id}`); + if (message.flags[0] === "default") { + await db.delete(`prefix.${message.guild.id}`); + return message.channel.send("The server prefix has been changed into default."); + } + + let symbol = args.join(" "); + if (!symbol) return message.channel.send("Please input the prefix."); + + db.set(`prefix.${message.guild.id}`, symbol); + return message.channel.send(`The server prefix has been changed to **${symbol}**`); + } + + if (msg.startsWith(prefix + 'afk')) { + const status = new db.table("AFKs"); + let afk = await status.fetch(message.author.id); + const embed = new Discord.MessageEmbed().setColor("RANDOM") + + if (!afk) { + embed.setDescription(`**${message.author.tag}** now AFK.`) + embed.setFooter(`Reason: ${args.join(" ") ? args.join(" ") : "AFK"}`) + status.set(message.author.id, args.join(" ") || `AFK`); + } else { + embed.setDescription("You are no longer AFK."); + status.delete(message.author.id); + } + + message.channel.send(embed) + } + + if (msg.startsWith(prefix + 'ping')) { + message.channel.send('pong.'); + } + + if (msg.startsWith(prefix + 'hello')) { + message.channel.send('hewwo') + } + + if (msg.startsWith(prefix + 'stats')) { + cpuStat.usagePercent(function (error, percent, seconds) { + if (error) { + return console.error(error) + } + + const cores = os.cpus().length + const cpuModel = os.cpus()[0].model + const guild = client.guilds.cache.size.toLocaleString() + const user = client.users.cache.size.toLocaleString() + const channel = client.channels.cache.size.toLocaleString() + const usage = formatBytes(process.memoryUsage().heapUsed) // Your memory usage. + const Node = process.version // Your node version. + const CPU = percent.toFixed(2) // Your CPU usage. + + const embed = new Discord.MessageEmbed() + embed.addField('Bot Statistics:', `Server: ${guild} \nUser: ${user} \nChannel: ${channel} \nUsage: ${usage} \nNode: ${Node} \nCPU Usage: ${CPU}%`) // Use Grave accent or `` + embed.addField('Physical Statistics:', `CPU: ${cores} - ${cpuModel} \nUptime: **${parseDur(client.uptime)}**`) + + message.channel.send(embed) + }) + } + + if (msg.startsWith(prefix + "corona")) { + let countries = args[0] + + fetch(`https://corona.lmao.ninja/v2/countries/${countries}`) + .then(res => res.json()) + .then(data => { + let country = data.country; + let flag = data.countryInfo.flag; // Turns out -> Link. + let confirmed = data.cases.toLocaleString(); + let todayconfirmed = data.todayCases.toLocaleString(); + let deaths = data.deaths.toLocaleString(); + let todaydeaths = data.todayDeaths.toLocaleString(); + let recovered = data.recovered.toLocaleString(); + let critical = data.critical.toLocaleString(); + let active = data.active.toLocaleString(); + // Add .toLocaleString() if you wanna separate 3 numbers with commas. + + const embed = new Discord.MessageEmbed() + .setColor("RANDOM") + .setTimestamp(new Date()) + .setAuthor("Coronavirus Statistics", flag) + .addField(`Data for: ${country}`, `Confirmed: (Total: **${confirmed}** | Daily: **${todayconfirmed}**) \nDeaths: (Total: **${deaths}** | Daily: **${todaydeaths}**) \nRecovered: **${recovered}** \nCritical: **${critical}** \nActive: **${data.active}**`) // Sorry a little bit more complex. + + message.channel.send(embed); + // Let's test it out! + }) + } + + if (msg.startsWith(prefix + "clear") || msg.startsWith(prefix + "clear")) { // You can make an aliases. Just like that. + if (!message.member.hasPermission("MANAGE_MESSAGES") || !message.member.hasPermission("ADMINISTRATOR")) return message.channel.send("You don't have a permissions to do this."); + if (isNaN(args[0])) return message.channel.send("Please input a valid number.") // isNaN = is Not a Number. (case sensitive, write it right) + if (args[0] > 100) return message.channel.send("Insert the number less than 100.") // Discord limited purge number into 100. + if (args[0] < 2) return message.channel.send("Insert the number more than 1.") + + await message.delete() + await message.channel.bulkDelete(args[0]) + .then(messages => message.channel.send(`Deleted ${messages.size}/${args[0]} messages.`)).then(d => d.delete({timeout: 10000})) // How long this message will be deleted (in ms) + .catch(() => message.channel.send("Something went wrong, while deleting messages.")) // This error will be displayed when the bot doesn't have an access to do it. + } + + if (msg.startsWith(prefix + "kick")) { + if (!message.member.hasPermission("KICK_MEMBERS") || !message.member.hasPermission("ADMINISTRATOR")) return message.channel.send("You don't have a permissions to do this."); + let user = message.mentions.users.first(); + + let member = message.guild.member(user); + let reason = args.slice(1).join(" "); + + if (!user) return message.channel.send("Please mention the user."); + if (user.id === message.author.id) return message.channel.send("You can't kick yourself."); + if (user.id === client.user.id) return message.channel.send("You can't kick me."); + + if (!reason) reason = "No reason provided"; + + member.kick(reason).then(() => { + message.channel.send(`Successfully kicked **${user.tag}**`); + }).catch(err => { + message.reply("I was unable to kick the member."); + }) + } + + if (msg.startsWith(prefix + "ban")) { + if (!message.member.hasPermission("BAN_MEMBERS") || !message.member.hasPermission("ADMINISTRATOR")) return message.channel.send("You don't have a permissions to do this."); + let user = message.mentions.users.first(); + + let member = message.guild.member(user); + let reason = args.slice(22).join(" "); + + if (!user) return message.channel.send("Please mention the user."); + if (user.id === message.author.id) return message.channel.send("You can't ban yourself."); + if (user.id === client.user.id) return message.channel.send("You can't ban me."); + + if (!reason) reason = "No reason provided"; + member.ban(reason).then(() => { + message.channel.send(`Successfully banned **${user.tag}**`); + }).catch(err => { + message.reply("I was unable to ban the member."); + }) + } + + if (msg.startsWith(prefix + "mute")) { + if (!message.member.hasPermission("MANAGE_MESSAGES") || !message.member.hasPermission("MUTE_MEMBERS") || !message.member.hasPermission("ADMINISTRATOR")) { + return message.channel.send("You don't have any permissions to do this: Manage Messages/Mute Members/Admin"); + } + + let user = message.guild.member(message.mentions.users.first()) || message.guild.members.cache.get(args[0]); + if (!user) return message.channel.send("You need to mention the user."); + // Optional: + // if (user.id === client.user.id) return message.channel.send("You can't mute me."); + // if (user.id === message.author.id) return message.channel.send("You can't mute yourself."); + let role = message.guild.roles.cache.find(r => r.name === "Muted"); + let bot = message.guild.members.cache.get(client.user.id).roles.highest; + + if (!role) return message.channel.send("Couldn't find the mute role."); + if (role.position > bot.position) return message.channel.send("The role is higher than me."); + + let time = args[1]; + + if (!time) { + if (user.roles.cache.has(role.id)) return message.channel.send("The user is still muted."); + await (user.roles.add(role.id).catch(err => message.channel.send(`Something went wrong: ${err}`))) + return message.channel.send(`${user.user.tag} is now muted.`); + } else { + if (user.roles.cache.has(role.id)) return message.channel.send("The user is still muted."); + await (user.roles.add(role.id).catch(err => message.channel.send(`Something went wrong: ${err}`))) + + let timer = setTimeout(function() { + user.roles.remove(role.id).catch(err => message.channel.send(`Something went wrong: ${err}`)); + message.channel.send(`${user.user.tag} is now unmuted.`); + }, ms(time)) + + client.mute.set(user.user.id, timer); + message.channel.send(`${user.user.tag} is now muted for **${ms(ms(time), {long: true})}**`); + } + } + + if (msg.startsWith(prefix + "unmute")) { + if (!message.member.hasPermission("MANAGE_MESSAGES") || !message.member.hasPermission("MUTE_MEMBERS") || !message.member.hasPermission("ADMINISTRATOR")) { + return message.channel.send("You don't have any permissions to do this: Manage Messages/Mute Members/Admin"); + } + + let user = message.guild.member(message.mentions.users.first()) || message.guild.members.cache.get(args[0]); + if (!user) return message.channel.send("You need to mention the user."); + + let role = message.guild.roles.cache.find(r => r.name === "Muted"); + if (!role) return message.channel.send("Couldn't find the mute role."); + + if (!user.roles.cache.find(r => r.name === "Muted")) return message.channel.send("The user doesn't get muted."); + + await user.roles.remove(role.id).catch(err => message.channel.send(`Something went wrong: ${err}`)); + await clearTimeout(client.mute.get(user.user.id)); + await client.mute.delete(user.user.id); + await message.channel.send(`${user.user.tag} is now unmuted.`); + } +}); + +client.login(process.env.TOKEN); + +function formatBytes (a, b) { + if (0 == a) return "0 Bytes"; + let c = 1024, + d = b || 2, + e = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], + f = Math.floor(Math.log(a) / Math.log(c)); + + return parseFloat((a / Math.pow(c, f)).toFixed(d)) + " " + e[f] +} + +function formatBytes (a, b) { + if (0 == a) return "0 Bytes"; + let c = 1024, + d = b || 2, + e = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], + f = Math.floor(Math.log(a) / Math.log(c)); + + return parseFloat((a / Math.pow(c, f)).toFixed(d)) + " " + e[f] +} // Create MB, KB, TB or something in the back of your memory counters. + +function parseDur(ms) { + let seconds = ms / 1000, + days = parseInt(seconds / 86400); + seconds = seconds % 86400 + + let hours = parseInt(seconds / 3600); + seconds = seconds % 3600 + + let minutes = parseInt(seconds / 60); + seconds = parseInt(seconds % 60) + + if (days) { + return `${days} day, ${hours} hours, ${minutes} minutes` + } else if (hours) { + return `${hours} hours, ${minutes} minutes, ${seconds} seconds` + } else if (minutes) { + return `${minutes} minutes, ${seconds} seconds` + } + + return `${seconds} second(s)` +} // Uptime bot. \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..d727247 --- /dev/null +++ b/package.json @@ -0,0 +1,38 @@ +{ + "name": "hello-express", + "version": "0.0.1", + "description": "A simple Node app built on Express, instantly up and running.", + "main": "server.js", + "scripts": { + "start": "node server.js" + }, + "dependencies": { + "express": "^4.17.1", + "discord.js": "^12.3.1", + "moment-duration-format": "^2.2.2", + "os": "^0.1.1", + "cpu-stat": "^2.0.1", + "ms": "^2.1.2", + "moment": "^2.27.0", + "node-fetch": "^2.6.0", + "quick.db": "^7.1.1", + "node-superfetch": "^0.1.10", + "parse-ms": "^2.0.0", + "superagent": "^6.0.0", + "kitsu.js": "^2.0.0", + "axios": "^0.19.2", + "dateformat": "^3.0.3" + }, + "engines": { + "node": "12.x" + }, + "repository": { + "url": "https://glitch.com/edit/#!/hello-express" + }, + "license": "MIT", + "keywords": [ + "node", + "glitch", + "express" + ] +} \ No newline at end of file diff --git a/server.js b/server.js new file mode 100644 index 0000000..e93e7d9 --- /dev/null +++ b/server.js @@ -0,0 +1,12 @@ +const Discord = require("discord.js"); +const tutorialBot = require("./handler/ClientBuilder.js"); // We're gonna create this soon. +const client = new tutorialBot(); + +require("./handler/module.js")(client); +require("./handler/Event.js")(client); +require("./uptime.js"); + +client.package = require("./package.json"); +client.on("warn", console.warn); // This will warn you via logs if there was something wrong with your bot. +client.on("error", console.error); // This will send you an error message via logs if there was something missing with your coding. +client.login(process.env.SECRET).catch(console.error); // This token will leads to the .env file. It's safe in there. \ No newline at end of file diff --git a/shrinkwrap.yaml b/shrinkwrap.yaml new file mode 100644 index 0000000..b5c29e7 --- /dev/null +++ b/shrinkwrap.yaml @@ -0,0 +1,1185 @@ +dependencies: + axios: 0.19.2 + cpu-stat: 2.0.1 + dateformat: 3.0.3 + discord.js: 12.3.1 + express: 4.17.1 + kitsu.js: 2.0.0 + moment: 2.27.0 + moment-duration-format: 2.3.2 + ms: 2.1.2 + node-fetch: 2.6.0 + node-superfetch: 0.1.10 + os: 0.1.1 + parse-ms: 2.1.0 + quick.db: 7.1.1 + superagent: 6.0.0 +packages: + /@discordjs/collection/0.1.6: + dev: false + resolution: + integrity: sha512-utRNxnd9kSS2qhyivo9lMlt5qgAUasH2gb7BEOn6p0efFh24gjGomHzWKMAPn2hEReOPQZCJaRKoURwRotKucQ== + /@discordjs/form-data/3.0.1: + dependencies: + asynckit: 0.4.0 + combined-stream: 1.0.8 + mime-types: 2.1.27 + dev: false + engines: + node: '>= 6' + resolution: + integrity: sha512-ZfFsbgEXW71Rw/6EtBdrP5VxBJy4dthyC0tpQKGKmYFImlmmrykO14Za+BiIVduwjte0jXEBlhSKf0MWbFp9Eg== + /abort-controller/3.0.0: + dependencies: + event-target-shim: 5.0.1 + dev: false + engines: + node: '>=6.5' + resolution: + integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg== + /accepts/1.3.7: + dependencies: + mime-types: 2.1.25 + negotiator: 0.6.2 + dev: false + engines: + node: '>= 0.6' + resolution: + integrity: sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== + /ansi-regex/2.1.1: + dev: false + engines: + node: '>=0.10.0' + resolution: + integrity: sha1-w7M6te42DYbg5ijwRorn7yfWVN8= + /ansi-regex/3.0.0: + dev: false + engines: + node: '>=4' + resolution: + integrity: sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= + /aproba/1.2.0: + dev: false + resolution: + integrity: sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== + /are-we-there-yet/1.1.5: + dependencies: + delegates: 1.0.0 + readable-stream: 2.3.7 + dev: false + resolution: + integrity: sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w== + /array-flatten/1.1.1: + dev: false + resolution: + integrity: sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= + /asynckit/0.4.0: + dev: false + resolution: + integrity: sha1-x57Zf380y48robyXkLzDZkdLS3k= + /axios/0.19.2: + dependencies: + follow-redirects: 1.5.10 + dev: false + resolution: + integrity: sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA== + /base64-js/1.3.1: + dev: false + resolution: + integrity: sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g== + /better-sqlite3/6.0.1: + dependencies: + bindings: 1.5.0 + integer: 3.0.1 + prebuild-install: 5.3.5 + tar: 4.4.10 + dev: false + requiresBuild: true + resolution: + integrity: sha512-4aV1zEknM9g1a6B0mVBx1oIlmYioEJ8gSS3J6EpN1b1bKYEE+N5lmpmXHKNKTi0qjHziSd7XrXwHl1kpqvEcHQ== + /bindings/1.5.0: + dependencies: + file-uri-to-path: 1.0.0 + dev: false + resolution: + integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== + /bl/4.0.2: + dependencies: + buffer: 5.6.0 + inherits: 2.0.4 + readable-stream: 3.6.0 + dev: false + resolution: + integrity: sha512-j4OH8f6Qg2bGuWfRiltT2HYGx0e1QcBTrK9KAHNMwMZdQnDZFk0ZSYIpADjYCB3U12nicC5tVJwSIhwOWjb4RQ== + /body-parser/1.19.0: + dependencies: + bytes: 3.1.0 + content-type: 1.0.4 + debug: 2.6.9 + depd: 1.1.2 + http-errors: 1.7.2 + iconv-lite: 0.4.24 + on-finished: 2.3.0 + qs: 6.7.0 + raw-body: 2.4.0 + type-is: 1.6.18 + dev: false + engines: + node: '>= 0.8' + resolution: + integrity: sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw== + /buffer/5.6.0: + dependencies: + base64-js: 1.3.1 + ieee754: 1.1.13 + dev: false + resolution: + integrity: sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw== + /bytes/3.1.0: + dev: false + engines: + node: '>= 0.8' + resolution: + integrity: sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== + /chownr/1.1.4: + dev: false + resolution: + integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== + /code-point-at/1.1.0: + dev: false + engines: + node: '>=0.10.0' + resolution: + integrity: sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= + /combined-stream/1.0.8: + dependencies: + delayed-stream: 1.0.0 + dev: false + engines: + node: '>= 0.8' + resolution: + integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + /component-emitter/1.3.0: + dev: false + resolution: + integrity: sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== + /console-control-strings/1.1.0: + dev: false + resolution: + integrity: sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= + /content-disposition/0.5.3: + dependencies: + safe-buffer: 5.1.2 + dev: false + engines: + node: '>= 0.6' + resolution: + integrity: sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g== + /content-type/1.0.4: + dev: false + engines: + node: '>= 0.6' + resolution: + integrity: sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== + /cookie-signature/1.0.6: + dev: false + resolution: + integrity: sha1-4wOogrNCzD7oylE6eZmXNNqzriw= + /cookie/0.4.0: + dev: false + engines: + node: '>= 0.6' + resolution: + integrity: sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== + /cookiejar/2.1.2: + dev: false + resolution: + integrity: sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA== + /core-util-is/1.0.2: + dev: false + resolution: + integrity: sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= + /cpu-stat/2.0.1: + dev: false + resolution: + integrity: sha1-UB6NbdLUTO9dhCk5w40YIsB4/Kw= + /dateformat/3.0.3: + dev: false + resolution: + integrity: sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q== + /debug/2.6.9: + dependencies: + ms: 2.0.0 + dev: false + resolution: + integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + /debug/3.1.0: + dependencies: + ms: 2.0.0 + dev: false + resolution: + integrity: sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== + /debug/4.1.1: + dependencies: + ms: 2.1.2 + dev: false + resolution: + integrity: sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== + /decompress-response/4.2.1: + dependencies: + mimic-response: 2.1.0 + dev: false + engines: + node: '>=8' + resolution: + integrity: sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw== + /deep-extend/0.6.0: + dev: false + engines: + node: '>=4.0.0' + resolution: + integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== + /delayed-stream/1.0.0: + dev: false + engines: + node: '>=0.4.0' + resolution: + integrity: sha1-3zrhmayt+31ECqrgsp4icrJOxhk= + /delegates/1.0.0: + dev: false + resolution: + integrity: sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= + /depd/1.1.2: + dev: false + engines: + node: '>= 0.6' + resolution: + integrity: sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= + /destroy/1.0.4: + dev: false + resolution: + integrity: sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= + /detect-libc/1.0.3: + dev: false + engines: + node: '>=0.10' + hasBin: true + resolution: + integrity: sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= + /discord.js/12.3.1: + dependencies: + '@discordjs/collection': 0.1.6 + '@discordjs/form-data': 3.0.1 + abort-controller: 3.0.0 + node-fetch: 2.6.0 + prism-media: 1.2.2 + setimmediate: 1.0.5 + tweetnacl: 1.0.3 + ws: 7.3.1 + dev: false + engines: + node: '>=12.0.0' + resolution: + integrity: sha512-mSFyV/mbvzH12UXdS4zadmeUf8IMQOo/YdunubG1wWt1xjWvtaJz/s9CGsFD2B5pTw1W/LXxxUbrQjIZ/xlUdw== + /ee-first/1.1.1: + dev: false + resolution: + integrity: sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= + /encodeurl/1.0.2: + dev: false + engines: + node: '>= 0.8' + resolution: + integrity: sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= + /encoding/0.1.13: + dependencies: + iconv-lite: 0.6.2 + dev: false + resolution: + integrity: sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A== + /end-of-stream/1.4.4: + dependencies: + once: 1.4.0 + dev: false + resolution: + integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== + /escape-html/1.0.3: + dev: false + resolution: + integrity: sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= + /etag/1.8.1: + dev: false + engines: + node: '>= 0.6' + resolution: + integrity: sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= + /event-target-shim/5.0.1: + dev: false + engines: + node: '>=6' + resolution: + integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== + /expand-template/2.0.3: + dev: false + engines: + node: '>=6' + resolution: + integrity: sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg== + /express/4.17.1: + dependencies: + accepts: 1.3.7 + array-flatten: 1.1.1 + body-parser: 1.19.0 + content-disposition: 0.5.3 + content-type: 1.0.4 + cookie: 0.4.0 + cookie-signature: 1.0.6 + debug: 2.6.9 + depd: 1.1.2 + encodeurl: 1.0.2 + escape-html: 1.0.3 + etag: 1.8.1 + finalhandler: 1.1.2 + fresh: 0.5.2 + merge-descriptors: 1.0.1 + methods: 1.1.2 + on-finished: 2.3.0 + parseurl: 1.3.3 + path-to-regexp: 0.1.7 + proxy-addr: 2.0.5 + qs: 6.7.0 + range-parser: 1.2.1 + safe-buffer: 5.1.2 + send: 0.17.1 + serve-static: 1.14.1 + setprototypeof: 1.1.1 + statuses: 1.5.0 + type-is: 1.6.18 + utils-merge: 1.0.1 + vary: 1.1.2 + dev: false + engines: + node: '>= 0.10.0' + resolution: + integrity: sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g== + /fast-safe-stringify/2.0.7: + dev: false + resolution: + integrity: sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA== + /file-uri-to-path/1.0.0: + dev: false + resolution: + integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== + /finalhandler/1.1.2: + dependencies: + debug: 2.6.9 + encodeurl: 1.0.2 + escape-html: 1.0.3 + on-finished: 2.3.0 + parseurl: 1.3.3 + statuses: 1.5.0 + unpipe: 1.0.0 + dev: false + engines: + node: '>= 0.8' + resolution: + integrity: sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA== + /follow-redirects/1.5.10: + dependencies: + debug: 3.1.0 + dev: false + engines: + node: '>=4.0' + resolution: + integrity: sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ== + /form-data/2.5.1: + dependencies: + asynckit: 0.4.0 + combined-stream: 1.0.8 + mime-types: 2.1.27 + dev: false + engines: + node: '>= 0.12' + resolution: + integrity: sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA== + /form-data/3.0.0: + dependencies: + asynckit: 0.4.0 + combined-stream: 1.0.8 + mime-types: 2.1.27 + dev: false + engines: + node: '>= 6' + resolution: + integrity: sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg== + /formidable/1.2.2: + dev: false + resolution: + integrity: sha512-V8gLm+41I/8kguQ4/o1D3RIHRmhYFG4pnNyonvua+40rqcEmT4+V71yaZ3B457xbbgCsCfjSPi65u/W6vK1U5Q== + /forwarded/0.1.2: + dev: false + engines: + node: '>= 0.6' + resolution: + integrity: sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ= + /fresh/0.5.2: + dev: false + engines: + node: '>= 0.6' + resolution: + integrity: sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= + /fs-constants/1.0.0: + dev: false + resolution: + integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== + /fs-minipass/1.2.7: + dependencies: + minipass: 2.9.0 + dev: false + resolution: + integrity: sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA== + /gauge/2.7.4: + dependencies: + aproba: 1.2.0 + console-control-strings: 1.1.0 + has-unicode: 2.0.1 + object-assign: 4.1.1 + signal-exit: 3.0.3 + string-width: 1.0.2 + strip-ansi: 3.0.1 + wide-align: 1.1.3 + dev: false + resolution: + integrity: sha1-LANAXHU4w51+s3sxcCLjJfsBi/c= + /github-from-package/0.0.0: + dev: false + resolution: + integrity: sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4= + /has-unicode/2.0.1: + dev: false + resolution: + integrity: sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk= + /http-errors/1.7.2: + dependencies: + depd: 1.1.2 + inherits: 2.0.3 + setprototypeof: 1.1.1 + statuses: 1.5.0 + toidentifier: 1.0.0 + dev: false + engines: + node: '>= 0.6' + resolution: + integrity: sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg== + /http-errors/1.7.3: + dependencies: + depd: 1.1.2 + inherits: 2.0.4 + setprototypeof: 1.1.1 + statuses: 1.5.0 + toidentifier: 1.0.0 + dev: false + engines: + node: '>= 0.6' + resolution: + integrity: sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== + /iconv-lite/0.4.24: + dependencies: + safer-buffer: 2.1.2 + dev: false + engines: + node: '>=0.10.0' + resolution: + integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + /iconv-lite/0.6.2: + dependencies: + safer-buffer: 2.1.2 + dev: false + engines: + node: '>=0.10.0' + resolution: + integrity: sha512-2y91h5OpQlolefMPmUlivelittSWy0rP+oYVpn6A7GwVHNE8AWzoYOBNmlwks3LobaJxgHCYZAnyNo2GgpNRNQ== + /ieee754/1.1.13: + dev: false + resolution: + integrity: sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg== + /inherits/2.0.3: + dev: false + resolution: + integrity: sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + /inherits/2.0.4: + dev: false + resolution: + integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + /ini/1.3.5: + dev: false + resolution: + integrity: sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== + /integer/3.0.1: + dependencies: + bindings: 1.5.0 + prebuild-install: 5.3.5 + dev: false + requiresBuild: true + resolution: + integrity: sha512-OqtER6W2GIJTIcnT5o2B/pWGgvurnVOYs4OZCgay40QEIbMTnNq4R0KSaIw1TZyFtPWjm5aNM+pBBMTfc3exmw== + /ipaddr.js/1.9.0: + dev: false + engines: + node: '>= 0.10' + resolution: + integrity: sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA== + /is-fullwidth-code-point/1.0.0: + dependencies: + number-is-nan: 1.0.1 + dev: false + engines: + node: '>=0.10.0' + resolution: + integrity: sha1-754xOG8DGn8NZDr4L95QxFfvAMs= + /is-fullwidth-code-point/2.0.0: + dev: false + engines: + node: '>=4' + resolution: + integrity: sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= + /is-stream/1.1.0: + dev: false + engines: + node: '>=0.10.0' + resolution: + integrity: sha1-EtSj3U5o4Lec6428hBc66A2RykQ= + /isarray/1.0.0: + dev: false + resolution: + integrity: sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + /kitsu.js/2.0.0: + dependencies: + node-fetch: 1.7.3 + deprecated: use 'kitsu' on npm instead. + dev: false + engines: + node: '>=6' + resolution: + integrity: sha1-mCM6d2VAAyBwxgl3zDt/YukUXBo= + /lodash/4.17.15: + dev: false + resolution: + integrity: sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== + /media-typer/0.3.0: + dev: false + engines: + node: '>= 0.6' + resolution: + integrity: sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= + /merge-descriptors/1.0.1: + dev: false + resolution: + integrity: sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= + /methods/1.1.2: + dev: false + engines: + node: '>= 0.6' + resolution: + integrity: sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= + /mime-db/1.42.0: + dev: false + engines: + node: '>= 0.6' + resolution: + integrity: sha512-UbfJCR4UAVRNgMpfImz05smAXK7+c+ZntjaA26ANtkXLlOe947Aag5zdIcKQULAiF9Cq4WxBi9jUs5zkA84bYQ== + /mime-db/1.44.0: + dev: false + engines: + node: '>= 0.6' + resolution: + integrity: sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg== + /mime-types/2.1.25: + dependencies: + mime-db: 1.42.0 + dev: false + engines: + node: '>= 0.6' + resolution: + integrity: sha512-5KhStqB5xpTAeGqKBAMgwaYMnQik7teQN4IAzC7npDv6kzeU6prfkR67bc87J1kWMPGkoaZSq1npmexMgkmEVg== + /mime-types/2.1.27: + dependencies: + mime-db: 1.44.0 + dev: false + engines: + node: '>= 0.6' + resolution: + integrity: sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w== + /mime/1.6.0: + dev: false + engines: + node: '>=4' + hasBin: true + resolution: + integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== + /mime/2.4.6: + dev: false + engines: + node: '>=4.0.0' + hasBin: true + resolution: + integrity: sha512-RZKhC3EmpBchfTGBVb8fb+RL2cWyw/32lshnsETttkBAyAUXSGHxbEJWWRXc751DrIxG1q04b8QwMbAwkRPpUA== + /mimic-response/2.1.0: + dev: false + engines: + node: '>=8' + resolution: + integrity: sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA== + /minimist/1.2.5: + dev: false + resolution: + integrity: sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== + /minipass/2.9.0: + dependencies: + safe-buffer: 5.2.1 + yallist: 3.1.1 + dev: false + resolution: + integrity: sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg== + /minizlib/1.3.3: + dependencies: + minipass: 2.9.0 + dev: false + resolution: + integrity: sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q== + /mkdirp-classic/0.5.3: + dev: false + resolution: + integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A== + /mkdirp/0.5.5: + dependencies: + minimist: 1.2.5 + dev: false + hasBin: true + resolution: + integrity: sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== + /moment-duration-format/2.3.2: + dev: false + resolution: + integrity: sha512-cBMXjSW+fjOb4tyaVHuaVE/A5TqkukDWiOfxxAjY+PEqmmBQlLwn+8OzwPiG3brouXKY5Un4pBjAeB6UToXHaQ== + /moment/2.27.0: + dev: false + resolution: + integrity: sha512-al0MUK7cpIcglMv3YF13qSgdAIqxHTO7brRtaz3DlSULbqfazqkc5kEjNrLDOM7fsjshoFIihnU8snrP7zUvhQ== + /ms/2.0.0: + dev: false + resolution: + integrity: sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + /ms/2.1.1: + dev: false + resolution: + integrity: sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== + /ms/2.1.2: + dev: false + resolution: + integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + /napi-build-utils/1.0.2: + dev: false + resolution: + integrity: sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg== + /negotiator/0.6.2: + dev: false + engines: + node: '>= 0.6' + resolution: + integrity: sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== + /node-abi/2.18.0: + dependencies: + semver: 5.7.1 + dev: false + resolution: + integrity: sha512-yi05ZoiuNNEbyT/xXfSySZE+yVnQW6fxPZuFbLyS1s6b5Kw3HzV2PHOM4XR+nsjzkHxByK+2Wg+yCQbe35l8dw== + /node-fetch/1.7.3: + dependencies: + encoding: 0.1.13 + is-stream: 1.1.0 + dev: false + resolution: + integrity: sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ== + /node-fetch/2.6.0: + dev: false + engines: + node: 4.x || >=6.0.0 + resolution: + integrity: sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA== + /node-superfetch/0.1.10: + dependencies: + form-data: 2.5.1 + node-fetch: 2.6.0 + dev: false + engines: + node: '>=8' + resolution: + integrity: sha512-aM+4GmjwCSku1VLsVh/mjnxQHa3StRI8uB7eYSktstlMD6Dxvpk/tT6UFEg2NwlNPjLlwsFmexduNUahckCm2A== + /noop-logger/0.1.1: + dev: false + resolution: + integrity: sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI= + /npmlog/4.1.2: + dependencies: + are-we-there-yet: 1.1.5 + console-control-strings: 1.1.0 + gauge: 2.7.4 + set-blocking: 2.0.0 + dev: false + resolution: + integrity: sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== + /number-is-nan/1.0.1: + dev: false + engines: + node: '>=0.10.0' + resolution: + integrity: sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= + /object-assign/4.1.1: + dev: false + engines: + node: '>=0.10.0' + resolution: + integrity: sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= + /on-finished/2.3.0: + dependencies: + ee-first: 1.1.1 + dev: false + engines: + node: '>= 0.8' + resolution: + integrity: sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= + /once/1.4.0: + dependencies: + wrappy: 1.0.2 + dev: false + resolution: + integrity: sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + /os/0.1.1: + dev: false + resolution: + integrity: sha1-IIhF6J4ZOtTZcUdLk5R3NqVtE/M= + /parse-ms/2.1.0: + dev: false + engines: + node: '>=6' + resolution: + integrity: sha512-kHt7kzLoS9VBZfUsiKjv43mr91ea+U05EyKkEtqp7vNbHxmaVuEqN7XxeEVnGrMtYOAxGrDElSi96K7EgO1zCA== + /parseurl/1.3.3: + dev: false + engines: + node: '>= 0.8' + resolution: + integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== + /path-to-regexp/0.1.7: + dev: false + resolution: + integrity: sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= + /prebuild-install/5.3.5: + dependencies: + detect-libc: 1.0.3 + expand-template: 2.0.3 + github-from-package: 0.0.0 + minimist: 1.2.5 + mkdirp: 0.5.5 + napi-build-utils: 1.0.2 + node-abi: 2.18.0 + noop-logger: 0.1.1 + npmlog: 4.1.2 + pump: 3.0.0 + rc: 1.2.8 + simple-get: 3.1.0 + tar-fs: 2.1.0 + tunnel-agent: 0.6.0 + which-pm-runs: 1.0.0 + dev: false + engines: + node: '>=6' + hasBin: true + resolution: + integrity: sha512-YmMO7dph9CYKi5IR/BzjOJlRzpxGGVo1EsLSUZ0mt/Mq0HWZIHOKHHcHdT69yG54C9m6i45GpItwRHpk0Py7Uw== + /prism-media/1.2.2: + dev: false + peerDependencies: + '@discordjs/opus': ^0.1.0 + ffmpeg-static: ^2.4.0 || ^3.0.0 + node-opus: ^0.3.1 + opusscript: ^0.0.6 + resolution: + integrity: sha512-I+nkWY212lJ500jLe4tN9tWO7nRiBAVdMv76P9kffZjYhw20raMlW1HSSvS+MLXC9MmbNZCazMrAr+5jEEgTuw== + /process-nextick-args/2.0.1: + dev: false + resolution: + integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== + /proxy-addr/2.0.5: + dependencies: + forwarded: 0.1.2 + ipaddr.js: 1.9.0 + dev: false + engines: + node: '>= 0.10' + resolution: + integrity: sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ== + /pump/3.0.0: + dependencies: + end-of-stream: 1.4.4 + once: 1.4.0 + dev: false + resolution: + integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== + /qs/6.7.0: + dev: false + engines: + node: '>=0.6' + resolution: + integrity: sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== + /qs/6.9.4: + dev: false + engines: + node: '>=0.6' + resolution: + integrity: sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ== + /quick.db/7.1.1: + dependencies: + better-sqlite3: 6.0.1 + lodash: 4.17.15 + dev: false + resolution: + integrity: sha512-PziF96cxYNvHcgkZkEbZ3UzhR2bXcLff96n68J1DhE/2Q2ELeGnd/Z4jtqJqZz5rfiqXvzEbCznXV8wNsOTSww== + /range-parser/1.2.1: + dev: false + engines: + node: '>= 0.6' + resolution: + integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== + /raw-body/2.4.0: + dependencies: + bytes: 3.1.0 + http-errors: 1.7.2 + iconv-lite: 0.4.24 + unpipe: 1.0.0 + dev: false + engines: + node: '>= 0.8' + resolution: + integrity: sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q== + /rc/1.2.8: + dependencies: + deep-extend: 0.6.0 + ini: 1.3.5 + minimist: 1.2.5 + strip-json-comments: 2.0.1 + dev: false + hasBin: true + resolution: + integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== + /readable-stream/2.3.7: + dependencies: + core-util-is: 1.0.2 + inherits: 2.0.4 + isarray: 1.0.0 + process-nextick-args: 2.0.1 + safe-buffer: 5.1.2 + string_decoder: 1.1.1 + util-deprecate: 1.0.2 + dev: false + resolution: + integrity: sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== + /readable-stream/3.6.0: + dependencies: + inherits: 2.0.4 + string_decoder: 1.3.0 + util-deprecate: 1.0.2 + dev: false + engines: + node: '>= 6' + resolution: + integrity: sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== + /safe-buffer/5.1.2: + dev: false + resolution: + integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + /safe-buffer/5.2.1: + dev: false + resolution: + integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + /safer-buffer/2.1.2: + dev: false + resolution: + integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + /semver/5.7.1: + dev: false + hasBin: true + resolution: + integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + /semver/7.3.2: + dev: false + engines: + node: '>=10' + hasBin: true + resolution: + integrity: sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ== + /send/0.17.1: + dependencies: + debug: 2.6.9 + depd: 1.1.2 + destroy: 1.0.4 + encodeurl: 1.0.2 + escape-html: 1.0.3 + etag: 1.8.1 + fresh: 0.5.2 + http-errors: 1.7.3 + mime: 1.6.0 + ms: 2.1.1 + on-finished: 2.3.0 + range-parser: 1.2.1 + statuses: 1.5.0 + dev: false + engines: + node: '>= 0.8.0' + resolution: + integrity: sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg== + /serve-static/1.14.1: + dependencies: + encodeurl: 1.0.2 + escape-html: 1.0.3 + parseurl: 1.3.3 + send: 0.17.1 + dev: false + engines: + node: '>= 0.8.0' + resolution: + integrity: sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg== + /set-blocking/2.0.0: + dev: false + resolution: + integrity: sha1-BF+XgtARrppoA93TgrJDkrPYkPc= + /setimmediate/1.0.5: + dev: false + resolution: + integrity: sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU= + /setprototypeof/1.1.1: + dev: false + resolution: + integrity: sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== + /signal-exit/3.0.3: + dev: false + resolution: + integrity: sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== + /simple-concat/1.0.1: + dev: false + resolution: + integrity: sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q== + /simple-get/3.1.0: + dependencies: + decompress-response: 4.2.1 + once: 1.4.0 + simple-concat: 1.0.1 + dev: false + resolution: + integrity: sha512-bCR6cP+aTdScaQCnQKbPKtJOKDp/hj9EDLJo3Nw4y1QksqaovlW/bnptB6/c1e+qmNIDHRK+oXFDdEqBT8WzUA== + /statuses/1.5.0: + dev: false + engines: + node: '>= 0.6' + resolution: + integrity: sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= + /string-width/1.0.2: + dependencies: + code-point-at: 1.1.0 + is-fullwidth-code-point: 1.0.0 + strip-ansi: 3.0.1 + dev: false + engines: + node: '>=0.10.0' + resolution: + integrity: sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= + /string-width/2.1.1: + dependencies: + is-fullwidth-code-point: 2.0.0 + strip-ansi: 4.0.0 + dev: false + engines: + node: '>=4' + resolution: + integrity: sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== + /string_decoder/1.1.1: + dependencies: + safe-buffer: 5.1.2 + dev: false + resolution: + integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + /string_decoder/1.3.0: + dependencies: + safe-buffer: 5.2.1 + dev: false + resolution: + integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + /strip-ansi/3.0.1: + dependencies: + ansi-regex: 2.1.1 + dev: false + engines: + node: '>=0.10.0' + resolution: + integrity: sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= + /strip-ansi/4.0.0: + dependencies: + ansi-regex: 3.0.0 + dev: false + engines: + node: '>=4' + resolution: + integrity: sha1-qEeQIusaw2iocTibY1JixQXuNo8= + /strip-json-comments/2.0.1: + dev: false + engines: + node: '>=0.10.0' + resolution: + integrity: sha1-PFMZQukIwml8DsNEhYwobHygpgo= + /superagent/6.0.0: + dependencies: + component-emitter: 1.3.0 + cookiejar: 2.1.2 + debug: 4.1.1 + fast-safe-stringify: 2.0.7 + form-data: 3.0.0 + formidable: 1.2.2 + methods: 1.1.2 + mime: 2.4.6 + qs: 6.9.4 + readable-stream: 3.6.0 + semver: 7.3.2 + dev: false + engines: + node: '>= 7.0.0' + resolution: + integrity: sha512-gBiyDSUR3zbYO8za+MudSNxMFSOhKcZfQ1Anya1DWzk9R32zl++cYUFHXzP3VnyvQO8h/1/uPPA9FUDDtE+qdA== + /tar-fs/2.1.0: + dependencies: + chownr: 1.1.4 + mkdirp-classic: 0.5.3 + pump: 3.0.0 + tar-stream: 2.1.3 + dev: false + resolution: + integrity: sha512-9uW5iDvrIMCVpvasdFHW0wJPez0K4JnMZtsuIeDI7HyMGJNxmDZDOCQROr7lXyS+iL/QMpj07qcjGYTSdRFXUg== + /tar-stream/2.1.3: + dependencies: + bl: 4.0.2 + end-of-stream: 1.4.4 + fs-constants: 1.0.0 + inherits: 2.0.4 + readable-stream: 3.6.0 + dev: false + engines: + node: '>=6' + resolution: + integrity: sha512-Z9yri56Dih8IaK8gncVPx4Wqt86NDmQTSh49XLZgjWpGZL9GK9HKParS2scqHCC4w6X9Gh2jwaU45V47XTKwVA== + /tar/4.4.10: + dependencies: + chownr: 1.1.4 + fs-minipass: 1.2.7 + minipass: 2.9.0 + minizlib: 1.3.3 + mkdirp: 0.5.5 + safe-buffer: 5.2.1 + yallist: 3.1.1 + dev: false + engines: + node: '>=4.5' + resolution: + integrity: sha512-g2SVs5QIxvo6OLp0GudTqEf05maawKUxXru104iaayWA09551tFCTI8f1Asb4lPfkBr91k07iL4c11XO3/b0tA== + /toidentifier/1.0.0: + dev: false + engines: + node: '>=0.6' + resolution: + integrity: sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== + /tunnel-agent/0.6.0: + dependencies: + safe-buffer: 5.2.1 + dev: false + resolution: + integrity: sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= + /tweetnacl/1.0.3: + dev: false + resolution: + integrity: sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== + /type-is/1.6.18: + dependencies: + media-typer: 0.3.0 + mime-types: 2.1.25 + dev: false + engines: + node: '>= 0.6' + resolution: + integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== + /unpipe/1.0.0: + dev: false + engines: + node: '>= 0.8' + resolution: + integrity: sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= + /util-deprecate/1.0.2: + dev: false + resolution: + integrity: sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + /utils-merge/1.0.1: + dev: false + engines: + node: '>= 0.4.0' + resolution: + integrity: sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= + /vary/1.1.2: + dev: false + engines: + node: '>= 0.8' + resolution: + integrity: sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= + /which-pm-runs/1.0.0: + dev: false + resolution: + integrity: sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs= + /wide-align/1.1.3: + dependencies: + string-width: 2.1.1 + dev: false + resolution: + integrity: sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== + /wrappy/1.0.2: + dev: false + resolution: + integrity: sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + /ws/7.3.1: + dev: false + engines: + node: '>=8.3.0' + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ^5.0.2 + resolution: + integrity: sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA== + /yallist/3.1.1: + dev: false + resolution: + integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== +registry: 'https://registry.npmjs.org/' +shrinkwrapMinorVersion: 9 +shrinkwrapVersion: 3 +specifiers: + axios: ^0.19.2 + cpu-stat: ^2.0.1 + dateformat: ^3.0.3 + discord.js: ^12.3.1 + express: ^4.17.1 + kitsu.js: ^2.0.0 + moment: ^2.27.0 + moment-duration-format: ^2.2.2 + ms: ^2.1.2 + node-fetch: ^2.6.0 + node-superfetch: ^0.1.10 + os: ^0.1.1 + parse-ms: ^2.0.0 + quick.db: ^7.1.1 + superagent: ^6.0.0 diff --git a/subtitle b/subtitle new file mode 100644 index 0000000..0686067 --- /dev/null +++ b/subtitle @@ -0,0 +1,18 @@ +const Discord = require('discord.js'); +const fetch = require("node-fetch"); + +exports.run = async (client, message, args) => { + +} + +exports.help = { + name: "", + description: "", + usage: "", + example: "" +} + +exports.conf = { + aliases: [], + cooldown: 3 +} \ No newline at end of file diff --git a/uptime.js b/uptime.js new file mode 100644 index 0000000..c87cde9 --- /dev/null +++ b/uptime.js @@ -0,0 +1,16 @@ +let express = require("express"), + http = require('http'), + app = express(); + +app.use(express.static("public")); +app.get("/", function(request, response) { + response.sendStatus(200); // Status: OK +}); + +let listener = app.listen(process.env.PORT, function() { + console.log("Your app is listening on port " + listener.address().port); +}); + +setInterval(() => { + http.get(`http://${process.env.PROJECT_DOMAIN}.glitch.me/`); +}, 280000); \ No newline at end of file diff --git a/watch.json b/watch.json new file mode 100644 index 0000000..db5eb31 --- /dev/null +++ b/watch.json @@ -0,0 +1,10 @@ +{ + "install": { + "include": ["^package\\.json$", "^\\.env$"] + }, + "restart": { + "exclude": ["^public/", "^dist/"], + "include": ["\\.js$", "\\.json"] + }, + "throttle": 90000000 +} \ No newline at end of file From 79963028ee97ac146b487fbb9072eac50e16b82d Mon Sep 17 00:00:00 2001 From: Vii_Rakk <67989471+Viirakk@users.noreply.github.com> Date: Wed, 19 Aug 2020 16:41:25 +0700 Subject: [PATCH 02/12] Create Procfile --- Procfile | 1 + 1 file changed, 1 insertion(+) create mode 100644 Procfile diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..a8b02e1 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +worker: server.js From 9cc37948415c33fe6936790f0cf21fdc8294973f Mon Sep 17 00:00:00 2001 From: "Glitch (sweetless)" <none> Date: Fri, 21 Aug 2020 04:13:55 +0000 Subject: [PATCH 03/12] =?UTF-8?q?=F0=9F=8F=AC=F0=9F=8D=AD=20Updated=20with?= =?UTF-8?q?=20Glitch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Procfile | 1 - commands/Moderate/ban.js | 32 ++++++++++++++++++++++ commands/Moderate/modlog.js | 42 +++++++++++++++++++++++++++++ commands/Moderate/mute.js | 50 +++++++++++++++++++++++++++++++++++ commands/Moderate/unmute.js | 32 ++++++++++++++++++++++ commands/Setting/slowmode.js | 3 ++- json.sqlite | Bin 12288 -> 12288 bytes server.js | 2 +- uptime.js | 19 ++++--------- 9 files changed, 164 insertions(+), 17 deletions(-) delete mode 100644 Procfile create mode 100644 commands/Moderate/ban.js create mode 100644 commands/Moderate/modlog.js create mode 100644 commands/Moderate/mute.js create mode 100644 commands/Moderate/unmute.js diff --git a/Procfile b/Procfile deleted file mode 100644 index a8b02e1..0000000 --- a/Procfile +++ /dev/null @@ -1 +0,0 @@ -worker: server.js diff --git a/commands/Moderate/ban.js b/commands/Moderate/ban.js new file mode 100644 index 0000000..fab0ba6 --- /dev/null +++ b/commands/Moderate/ban.js @@ -0,0 +1,32 @@ +const Discord = require("discord.js"); + +exports.run = async (client, message, args) => { + if (!message.member.hasPermission("BAN_MEMBERS") || !message.member.hasPermission("ADMINISTRATOR")) return message.channel.send("You don't have a permissions to do this."); + let user = message.mentions.users.first(); + + let member = message.guild.member(user); + let reason = args.slice(22).join(" "); + + if (!user) return message.channel.send("Please mention the user."); + if (user.id === message.author.id) return message.channel.send("You can't ban yourself."); + if (user.id === client.user.id) return message.channel.send("You can't ban me."); + + if (!reason) reason = "No reason provided"; + member.ban(reason).then(() => { + message.channel.send(`Successfully banned **${user.tag}**`); + }).catch(err => { + message.reply("I was unable to ban the member."); + }) + } + +exports.help = { + name: "ban", + description: "Ban some noobs away", + usage: "ban [@user] [reason]", + example: "ban @Vii_Rakk#5424 idiot" +}; + +exports.conf = { + aliases: [], + cooldown: 5 +}; \ No newline at end of file diff --git a/commands/Moderate/modlog.js b/commands/Moderate/modlog.js new file mode 100644 index 0000000..2d05e04 --- /dev/null +++ b/commands/Moderate/modlog.js @@ -0,0 +1,42 @@ +const Discord = require("discord.js"); +const db = require("quick.db"); + +exports.run = async (client, message, args) => { + if (!message.member.permissions.any(["MANAGE_GUILD", "ADMINISTRATOR"])) { + return message.channel.send("You don't have **Manage Server** permissions to do this."); + } + + let toggling = ["disable", "enable"]; + if (!toggling.includes(args[0])) { + return message.channel.send("Please provide a valid options. Either **disable** or **enable** it."); + } + + if (args[0] === "enable") { + let channel = message.mentions.channels.first(); + if (!channel) return message.channel.send("Please provide the channel that you want to make it as an audit log."); + + await db.set(`moderation.${message.guild.id}.modlog.toggle`, true); + await db.set(`moderation.${message.guild.id}.modlog.channel`, channel.id); + return message.channel.send(`The audit log has been enabled for <#${channel.id}>`); + } + + if (args[0] === "disable") { + let toggle = db.get(`moderation.${message.guild.id}.modlog.toggle`); + if (!toggle || toggle == false) return message.channel.send("I guess, the audit log has already been disabled before."); + await db.set(`moderation.${message.guild.id}.modlog.toggle`, false); + await db.delete(`moderation.${message.guild.id}.modlog.channel`); + return message.channel.send("The audit log has been disabled."); + } +} + +exports.help = { + name: "modlog", + description: "Change/set/update the moderation log settings on the server.", + usage: "modlog <enable | disable> <#channel>", + example: "modlog enable #mod-log \nmodlog disable" +}; + +exports.conf = { + aliases: ["audit-log", "mod-log"], + cooldown: 8 +} \ No newline at end of file diff --git a/commands/Moderate/mute.js b/commands/Moderate/mute.js new file mode 100644 index 0000000..68af3dc --- /dev/null +++ b/commands/Moderate/mute.js @@ -0,0 +1,50 @@ +const Discord = require("discord.js"); +const ms = require("ms"); + +exports.run = async (client, message, args) => { + if (!message.member.hasPermission("MANAGE_MESSAGES") || !message.member.hasPermission("MUTE_MEMBERS") || !message.member.hasPermission("ADMINISTRATOR")) { + return message.channel.send("You don't have any permissions to do this: Manage Messages/Mute Members/Admin"); + } + + let user = message.guild.member(message.mentions.users.first()) || message.guild.members.cache.get(args[0]); + if (!user) return message.channel.send("You need to mention the user."); + // Optional: + // if (user.id === client.user.id) return message.channel.send("You can't mute me."); + // if (user.id === message.author.id) return message.channel.send("You can't mute yourself."); + let role = message.guild.roles.cache.find(r => r.name === "Muted"); + let bot = message.guild.members.cache.get(client.user.id).roles.highest; + + if (!role) return message.channel.send("Couldn't find the mute role."); + if (role.position > bot.position) return message.channel.send("The role is higher than me."); + + let time = args[1]; + + if (!time) { + if (user.roles.cache.has(role.id)) return message.channel.send("The user is still muted."); + await (user.roles.add(role.id).catch(err => message.channel.send(`Something went wrong: ${err}`))) + return message.channel.send(`${user.user.tag} is now muted.`); + } else { + if (user.roles.cache.has(role.id)) return message.channel.send("The user is still muted."); + await (user.roles.add(role.id).catch(err => message.channel.send(`Something went wrong: ${err}`))) + + let timer = setTimeout(function() { + user.roles.remove(role.id).catch(err => message.channel.send(`Something went wrong: ${err}`)); + message.channel.send(`${user.user.tag} is now unmuted.`); + }, ms(time)) + + client.mute.set(user.user.id, timer); + message.channel.send(`${user.user.tag} is now muted for **${ms(ms(time), {long: true})}**`); + } + } + +exports.help = { + name: "mute", + description: "Mute some noobs from chit-chat", + usage: "mute [@user] [reason]", + example: "mute @Vii_Rakk#5424 spam" +}; + +exports.conf = { + aliases: [], + cooldown: 5 +}; \ No newline at end of file diff --git a/commands/Moderate/unmute.js b/commands/Moderate/unmute.js new file mode 100644 index 0000000..e7f67a4 --- /dev/null +++ b/commands/Moderate/unmute.js @@ -0,0 +1,32 @@ +const Discord = require("discord.js"); + +exports.run = async (client, message, args) => { + if (!message.member.hasPermission("MANAGE_MESSAGES") || !message.member.hasPermission("MUTE_MEMBERS") || !message.member.hasPermission("ADMINISTRATOR")) { + return message.channel.send("You don't have any permissions to do this: Manage Messages/Mute Members/Admin"); + } + + let user = message.guild.member(message.mentions.users.first()) || message.guild.members.cache.get(args[0]); + if (!user) return message.channel.send("You need to mention the user."); + + let role = message.guild.roles.cache.find(r => r.name === "Muted"); + if (!role) return message.channel.send("Couldn't find the mute role."); + + if (!user.roles.cache.find(r => r.name === "Muted")) return message.channel.send("The user doesn't get muted."); + + await user.roles.remove(role.id).catch(err => message.channel.send(`Something went wrong: ${err}`)); + await clearTimeout(client.mute.get(user.user.id)); + await client.mute.delete(user.user.id); + await message.channel.send(`${user.user.tag} is now unmuted.`); + } + +exports.help = { + name: "mute", + description: "Mute some noobs from chit-chat", + usage: "mute [@user] [reason]", + example: "mute @Vii_Rakk#5424 spam" +}; + +exports.conf = { + aliases: [], + cooldown: 5 +}; \ No newline at end of file diff --git a/commands/Setting/slowmode.js b/commands/Setting/slowmode.js index f198af0..8120495 100644 --- a/commands/Setting/slowmode.js +++ b/commands/Setting/slowmode.js @@ -1,5 +1,6 @@ +const Discord = require("discord.js"); const ms = require("ms"); - +// so what am i fixing here exports.run = async (client, message, args) => { if (!message.member.permissions.any(["ADMINISTRATOR", "MANAGE_CHANNELS"])) { return message.channel.send("Oopsie, you don't have any rights to do this."); diff --git a/json.sqlite b/json.sqlite index 6c23c72216cc1b31741934eb5b305e3c14d16dc6..9c9286c1b1c43e3a4d42b5ac08ed3dd4c5e738a0 100644 GIT binary patch delta 390 zcmYk1yH3JT7{^;mXkscA2SF@|Cq^Yfb1pr-;G)s6FgY0#H8j#xlG-Ao(U2N+b-|p$ z!A*Su!pNqZgE}}k`T#zJbPyfC|Lx1KQ|(l{GkoPn+2AX^>Z3d<#w<>D<8oYxS<;oX zJO0o+D#yg@^Jp}4>#)Jpd>ml}3&6EcZ5I@Ec9ESH&l;eJvB9L|l0?jrN!VKQJ7OZX zl3I*tW`8?nL?nv;`FH7zgy={>{pWOzA4XYTA*BLPkqMEBh(=XiGgP7xP;7(n8~Iy7 zK>-kqG@`18s$+<tP6_%As%%SX3oqO!ds99p_QdGi<?^9lvzu0{?t84Oq&A1A>pNkg z<vWgRgJP?BVi&;vf#rE2B+ylAU`(N5La6DcP9X?_U`!B_iDR$cu-gHXvxBJo#NGE_ pv#UJ+)lcN!<%K-bF*P}k%gt(-5=cW1JOm;JreFuGm&!W;`~VA$YJ&g( delta 234 zcmZojXh@hK&B#1a#+i|MW5N=C0XDWR4E#BK{Cua_w(vCZ#BMBHz{cLK#=;^y&2e&u zm<q3jg^`X@PHI_dj*^wx<T^P?_KE@}D?>}O$-Bff7>y=-$!bjI7C+BqZZY|exH^-m z#b#Cs3nm^T6Syv;$(~ZOlRYK*H<w8zFfy4MPQD>+JUK?DfcYAu%jEMiS0?|LV4v(F z?yO{D0M}$#tD|IUVq|D)WNBz&YGiH*WSN;LP3D)|&BDdZEWY`ioHZlk{mp_3C;2Bf X@G~hYPF9o`=8RDaNi8mkQBnc`^^id5 diff --git a/server.js b/server.js index e93e7d9..39e63f1 100644 --- a/server.js +++ b/server.js @@ -4,7 +4,7 @@ const client = new tutorialBot(); require("./handler/module.js")(client); require("./handler/Event.js")(client); -require("./uptime.js"); +require("./uptime.js") client.package = require("./package.json"); client.on("warn", console.warn); // This will warn you via logs if there was something wrong with your bot. diff --git a/uptime.js b/uptime.js index c87cde9..eae2aa3 100644 --- a/uptime.js +++ b/uptime.js @@ -1,16 +1,7 @@ -let express = require("express"), - http = require('http'), - app = express(); +const express = require("express"), + app = express(), + port = 3000; -app.use(express.static("public")); -app.get("/", function(request, response) { - response.sendStatus(200); // Status: OK -}); +app.get("/", (req, res) => res.send("I am ready.")); -let listener = app.listen(process.env.PORT, function() { - console.log("Your app is listening on port " + listener.address().port); -}); - -setInterval(() => { - http.get(`http://${process.env.PROJECT_DOMAIN}.glitch.me/`); -}, 280000); \ No newline at end of file +app.listen(port, () => console.log(`Your app is listening on port ${port}`)); \ No newline at end of file From d68d523a4f17b65a90068131cad9d66b04354088 Mon Sep 17 00:00:00 2001 From: Vii_Rakk <67989471+Viirakk@users.noreply.github.com> Date: Fri, 21 Aug 2020 11:21:29 +0700 Subject: [PATCH 04/12] Create Procfile --- Procfile | 1 + 1 file changed, 1 insertion(+) create mode 100644 Procfile diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..48536c5 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +worker: node server.js From 3817e8be1ce6afcbd0442ff55bcdced047e44c6c Mon Sep 17 00:00:00 2001 From: "Glitch (sweetless)" <none> Date: Fri, 21 Aug 2020 04:21:44 +0000 Subject: [PATCH 05/12] =?UTF-8?q?=E2=98=84=EF=B8=8F=E2=9C=8D=EF=B8=8F=20Up?= =?UTF-8?q?dated=20with=20Glitch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Procfile | 2 +- json.sqlite | Bin 12288 -> 12288 bytes 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Procfile b/Procfile index 48536c5..562ef39 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -worker: node server.js +worker: node server.js \ No newline at end of file diff --git a/json.sqlite b/json.sqlite index 9c9286c1b1c43e3a4d42b5ac08ed3dd4c5e738a0..7494e73f57fa977a327da7ce1b7425625a7eabb7 100644 GIT binary patch delta 96 zcmZojXh@hK&6qM##+fl?W5P0it^@}D96o+NX10XQ0s;YS?A=u?EV9!xCufMMF&UXp ro*=fA$JA6uDJQioHAl(HXtSfZDl?CXA(BXulr<xhq50-@(m^5s_Awd= delta 96 zcmZojXh@hK%@{dR#+fm4W5P0iu0#g@96o+NX12u50s;YS91Pu+EG)9q(<i5ksWBNE rOzsz3%42Mzqm+|cmYSnvWw_ZvT$P!}&=g6eP|BK-(RA}V=^zmR+qN05 From 64463e97ed6516ee531ebdb80742dd22f068a732 Mon Sep 17 00:00:00 2001 From: "Glitch (sweetless-project)" <none> Date: Sat, 22 Aug 2020 01:17:13 +0000 Subject: [PATCH 06/12] =?UTF-8?q?=F0=9F=9A=89=E2=9B=B4=20Updated=20with=20?= =?UTF-8?q?Glitch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Procfile | 1 - commands/Information/info.js | 2 +- events/guildMemberAdd.js | 32 ++++++++++++++++++++++++++ events/message.js | 43 +++++++++++++++++++++++++++++++++++ events/ready.js | 2 +- json.sqlite | Bin 12288 -> 12288 bytes server.js | 15 ++++++++++++ 7 files changed, 92 insertions(+), 3 deletions(-) delete mode 100644 Procfile create mode 100644 events/guildMemberAdd.js diff --git a/Procfile b/Procfile deleted file mode 100644 index 562ef39..0000000 --- a/Procfile +++ /dev/null @@ -1 +0,0 @@ -worker: node server.js \ No newline at end of file diff --git a/commands/Information/info.js b/commands/Information/info.js index 116e742..6383bb2 100644 --- a/commands/Information/info.js +++ b/commands/Information/info.js @@ -5,7 +5,7 @@ exports.run = async (client, message, args) => { .setTitle("<:mdHelp:568466408548335650> Information Centre") .setColor("RANDOM") .setDescription("This is a quite easy to use which contains: **Moderate** | **Information** | **Fun** & more systems.") - .addField("Invite", `[Click Here](https://discord.com/api/oauth2/authorize?client_id=727448017799479296&permissions=271968370&scope=bot)`, true) + .addField("Invite", `[Click Here](https://discord.com/oauth2/authorize?client_id=727448017799479296&scope=bot&permissions=878181502)`, true) .addField("Support", `[Click Here](https://discord.gg/XYbcPBr)`, true) .addField("Teammate", `<@725968708358373477> <@529493423556919296>`, true) .addField("Goal", `<:Bot_Developer_Badge:742556995323822130>`, true) diff --git a/events/guildMemberAdd.js b/events/guildMemberAdd.js new file mode 100644 index 0000000..0cf4655 --- /dev/null +++ b/events/guildMemberAdd.js @@ -0,0 +1,32 @@ +module.exports = async (client, member) => { + const db = require("quick.db"); + const Discord = require("discord.js"); + + if (member.user.bot) return; + // If the user was a robot, return it. + // Unless, you create a welcome/goodbye system. Put this under your welcome/goodbye system. + + let number = randomInteger(100000, 1000000); + // The number will be shuffled from the range 100K - 1M + + let verifyChannel = member.guild.channels.cache.find(ch => ch.id === "746205759997476895"); + // Your Verification Text Channel. + + await db.set(`verification.${member.user.id}`, number); + + const dm = new Discord.MessageEmbed() + .setColor("RANDOM") + .setTitle(`Welcome to ${member.guild.name}!`) + .setDescription("Hello! Before you get started, I just want you to verify yourself first.") + .addField("Put your code into the channel.", `**This is your code:** ${number}`) + await member.send(dm).catch(() => { + verifyChannel.send(`<@!${member.user.id}> Hey, I guess your DM is locked. How about you unlock it first and type \`resend\` here.`) + .then(i => i.delete({timeout: 10000})); + }) +} + +function randomInteger(min, max) { + min = Math.ceil(min); + max = Math.floor(max); + return Math.floor(Math.random() * (max - min + 1)) + min; +} \ No newline at end of file diff --git a/events/message.js b/events/message.js index fc4fe66..de7a313 100644 --- a/events/message.js +++ b/events/message.js @@ -15,6 +15,49 @@ module.exports = async (client, message) => { .then(m => m.delete({timeout: 10000})) // Add this if you want the message automatically deleted. } + // Verification Site + if (message.channel.id === "746205759997476895") { // Verification Text Channel + // Re-send Code System + if (message.content.startsWith("resend")) { + let code = db.get(`verification.${message.author.id}`); + await message.delete(); + const dm = new Discord.MessageEmbed() + .setColor("RANDOM") + .setTitle(`Welcome to ${message.guild.name}!`) + .setDescription("Hello! Before you get started, I just want you to verify yourself first.") + .addField("Put your code into the channel.", `**This is your code:** ${code}`) + await message.author.send(dm).catch(() => { + return message.reply("Your DM is still locked. Unlock your DM first.") + .then(i => i.delete({timeout: 10000})); + }) + + return message.reply("Check your DM.").then(i => i.delete({timeout: 10000})); + } + + // Verify System + if (!client.config.owners.includes(message.author.id)) { // The owner of the bot cannot get any verification codes. + if (!message.author.bot) { // If the user was a robot, well return it. + let verify = parseInt(message.content); + let code = db.get(`verification.${message.author.id}`); + if (verify !== code) { + // If the code that user insert it doesn't the same with the database, return it. + message.delete() + return message.reply("Are you sure that is the code that you typing it?").then(i => i.delete({timeout: 10000})); + } + + if (verify === code) { + message.delete(); + db.delete(`verification.${message.author.id}`); + message.reply("You are not a robot! Please wait, 5 seconds okay?").then(i => i.delete({timeout: 7500})); + setTimeout(function() { + message.member.roles.add("729997307902296105"); + // Use .roles.remove if you wanna remove the role after verification. + }, 5000) + } + } + } + } + client.emit('experience', message); let afk = new db.table("AFKs"), diff --git a/events/ready.js b/events/ready.js index ba68aa3..4aae736 100644 --- a/events/ready.js +++ b/events/ready.js @@ -1,7 +1,7 @@ const Discord = require("discord.js"); module.exports = client => { - console.log(`Ready as ${client.user.tag} to serve in ${client.channels.cache.size} channels on ${client.guilds.cache.size} servers, for a total of ${client.users.cache.size} users.`); + console.log(`Login as ${client.user.tag} to serve in ${client.channels.cache.size} channels on ${client.guilds.cache.size} servers, for a total of ${client.users.cache.size} users.`); function randomStatus() { let status = [`on ${client.guilds.cache.size} guild(s) || Type .help`, `with ${client.users.cache.size} online(s) || Type .help`] // You can change it whatever you want. let rstatus = Math.floor(Math.random() * status.length); diff --git a/json.sqlite b/json.sqlite index 7494e73f57fa977a327da7ce1b7425625a7eabb7..f0bea99681c1a2a74d7d3298996e7eae3b373c77 100644 GIT binary patch delta 691 zcmb7B&ubGw7~RcoXw{@KC>xuf%Rr%!P-bR#enlun1;LxAB2>s4Vq6VL+Jx4yE;dC_ zP|-3sz1f3D3Axl$&tAQG@Xzq>w`f7J7jHA~&3oVX-t4#bTW?F|@nQM8c|2=<$T<hb zV*13$Jzsj5t))*g?=yF^N7?#p`(t|Hb;-6X@9MhitXQ5R`i--i^0EHxL@9|iFHBN` z&S!;+d4V-hue00fp(dGsyYkAk2*vYm@rQZ2fdp03V^k`}B_)htqCXW2c}ghtB_<O4 zoG`(#-dF|{D<()nD54mHX@C|1<%DvN`h<8sc%x>79uHAd=-XxDX73owQ>zz@#+!qk zM-fcq7)z?y)J)rz>7IU3zV<X(gelkqIKjb3ahlk0$~+8{1gDC4o}>&yFeTv?!`Krl zj?Y_GAwTMe!%h@87Oj<=yPcize%KDi;h-NO=0hwHOGX8O6ZcV534(=)mn`GfFXcv* zT-Nh{NfW4k>I~=FzjWr5)<>0=Z5T#ZFI3wL2gQ_KdREuptE+mw`V!Kel_Ns;f?m*X zcTf|u#Q#&lA5!9jHjej9yEX;8(fCFX_9jWqOmQhN{H}iDoYRLjyms~;zx(tR6s6)U qq%bZTM(*o8?|#WasI{wl+qvXyq0I*acNq4&Za8uSw;N2h5c&yyDY6d$ delta 445 zcmZojXh@hK&6qM##+fl?W5ObSk<$$9YzYkfIeh$l%xnofO+2x@i#HZ}vGI3Tv9QQa z&&)|JOU=p5OP_o|MvSXksiHv1%FxKjeDXU{4JIRt$r57KOs1xjr;1fFnOJNV5SL|~ ztRcg<*;=BLk;%kx^Kr?qjFV$z)cD<5S!5fTa}tY7!t;x=t0&Ks)1G`yhEJfD?-aug z*{(`tYlNZJSQ_XkfyI@qj3@sPl{K}ngbNte>L{66S{R#Hm|Iww7@HaznHZUvDp^6a znphwdPWBO#H8eyRWeC)1YGi3*X>4L-Y-(y|X=rI=X$I42Xb90cd9iE)3l}r9_+)mu z<jD_2*(Ohr<D7g&E<mJ~{}96>!Q#Bkg4Ajddzy5U?Bqf@4Mx++_CQY|lxnlrhA^_o zH%d?LmG>8_Wnf^igJ}b@jY5IKI^4CqKsJK_0|Wnq&4LO?_$LPNaBCWx8<|=Hg%#u{ RC&~+R#3(tsdB-Rz0RSg8eQW># diff --git a/server.js b/server.js index 39e63f1..cb6914b 100644 --- a/server.js +++ b/server.js @@ -9,4 +9,19 @@ require("./uptime.js") client.package = require("./package.json"); client.on("warn", console.warn); // This will warn you via logs if there was something wrong with your bot. client.on("error", console.error); // This will send you an error message via logs if there was something missing with your coding. + +let memberlog = "746294896830447617"; + +client.on("guildMemberAdd", member => { + if (member.guild.id !== "725952860076113962") return; + + client.channels.cache.get(memberlog).send(`Welcome to the **${member.guild.name}**, <@!${member.user.id}> !!!`); +}) + +client.on("guildMemberRemove", member => { + if (member.guild.id !== "725952860076113962") return; + + client.channels.cache.get(memberlog).send(`**${member.user.tag}** left **${member.guild.name}**.`); +}); + client.login(process.env.SECRET).catch(console.error); // This token will leads to the .env file. It's safe in there. \ No newline at end of file From a00ac6a5b8154a9d517752c0eaf308489411957c Mon Sep 17 00:00:00 2001 From: Vii_Rakk <67989471+Viirakk@users.noreply.github.com> Date: Sat, 22 Aug 2020 08:21:45 +0700 Subject: [PATCH 07/12] Create Procfile --- Procfile | 1 + 1 file changed, 1 insertion(+) create mode 100644 Procfile diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..e913529 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +Worker : node server.js From b5705a1099a5cd2c2b80f69daae569cbb88adda1 Mon Sep 17 00:00:00 2001 From: "Glitch (sweetless-project)" <none> Date: Sat, 22 Aug 2020 01:36:11 +0000 Subject: [PATCH 08/12] =?UTF-8?q?=F0=9F=8C=89=F0=9F=8F=A4=20Updated=20with?= =?UTF-8?q?=20Glitch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Procfile | 2 +- json.sqlite | Bin 12288 -> 12288 bytes 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Procfile b/Procfile index e913529..2bd959b 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -Worker : node server.js +Worker:node server.js \ No newline at end of file diff --git a/json.sqlite b/json.sqlite index f0bea99681c1a2a74d7d3298996e7eae3b373c77..b0db8abd4676936ba255e0b55bdc2ccc9295a1c5 100644 GIT binary patch delta 24 gcmZojXh@hK&A4--j5FiTjR|Rzj3%3pOInHn0C2GgcK`qY delta 24 gcmZojXh@hK&A4Ntj5FhojR|Rzj0T&JOInHn0C0Q=aR2}S From 4b20dcbd3bf2cd73f42a64c79d5317e88c903cfd Mon Sep 17 00:00:00 2001 From: "Glitch (sweetless-project)" <none> Date: Sat, 22 Aug 2020 01:38:38 +0000 Subject: [PATCH 09/12] =?UTF-8?q?=F0=9F=8D=89=F0=9F=90=8B=20Updated=20with?= =?UTF-8?q?=20Glitch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Procfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Procfile b/Procfile index 2bd959b..8c1654b 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -Worker:node server.js \ No newline at end of file +Worker : node server.js \ No newline at end of file From 3e02c895454d4de079aa6eb713837523fdfb840d Mon Sep 17 00:00:00 2001 From: "Glitch (sweetless-project)" <none> Date: Sat, 22 Aug 2020 02:05:57 +0000 Subject: [PATCH 10/12] =?UTF-8?q?=F0=9F=91=B4=F0=9F=9A=9E=20Updated=20with?= =?UTF-8?q?=20Glitch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- json.sqlite | Bin 12288 -> 12288 bytes uptime.js | 23 ++++++++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/json.sqlite b/json.sqlite index b0db8abd4676936ba255e0b55bdc2ccc9295a1c5..eba009174a642c4c12591d65b97604f5102d59de 100644 GIT binary patch delta 32 ocmZojXh@hK&A5A_j5FizjS0P?jFy|<iC$-BGB(<LT+&hu0LYjNng9R* delta 32 ocmZojXh@hK&A4--j5FiTjS0P?jE0-viC$-BGBVkGT+&hu0LRk{j{pDw diff --git a/uptime.js b/uptime.js index eae2aa3..b728426 100644 --- a/uptime.js +++ b/uptime.js @@ -1,7 +1,20 @@ -const express = require("express"), - app = express(), - port = 3000; +let express = require("express"), + http = require('http'), + app = express(); -app.get("/", (req, res) => res.send("I am ready.")); +app.use(express.static("public")); +app.get("/", function(request, response) { + response.sendStatus(200); // Status: OK +}); -app.listen(port, () => console.log(`Your app is listening on port ${port}`)); \ No newline at end of file +let listener = app.listen(process.env.PORT, function() { + console.log("Your app is listening on port " + listener.address().port); +}); + +setInterval(() => { + http.get(`http://${process.env.PROJECT_DOMAIN}.glitch.me/`); +}, 280000); + +// You don't need to fill anything on process.env.PROJECT_DOMAIN or process.env.PORT. +// It's default from glitch.com. +// Restart the bot and wait until 5 minutes forward. \ No newline at end of file From f230f78956ae891f40c57dd12cd1190c4a8f1f93 Mon Sep 17 00:00:00 2001 From: "Glitch (sweetless)" <none> Date: Sat, 22 Aug 2020 02:29:00 +0000 Subject: [PATCH 11/12] =?UTF-8?q?=F0=9F=9B=B3=F0=9F=8D=97=20Updated=20with?= =?UTF-8?q?=20Glitch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Procfile | 1 - json.sqlite | Bin 12288 -> 12288 bytes 2 files changed, 1 deletion(-) delete mode 100644 Procfile diff --git a/Procfile b/Procfile deleted file mode 100644 index 8c1654b..0000000 --- a/Procfile +++ /dev/null @@ -1 +0,0 @@ -Worker : node server.js \ No newline at end of file diff --git a/json.sqlite b/json.sqlite index eba009174a642c4c12591d65b97604f5102d59de..ecd7fa3ce3a7f41fce6591ac2764f93f5c676890 100644 GIT binary patch delta 26 icmZojXh@hK&A4Zxj5Fh&jS1bN%qE70o8O5FNdW+Yf(Zfu delta 26 icmZojXh@hK&A5A_j5FizjS1bN%*K|Mo8O5FNdW+Y!3hrl From ea20a973bfc6c225898785112940a25184a77159 Mon Sep 17 00:00:00 2001 From: "Glitch (pinata-pal)" <none> Date: Wed, 26 Aug 2020 08:11:26 +0000 Subject: [PATCH 12/12] =?UTF-8?q?=F0=9F=93=95=F0=9F=91=84=20Updated=20with?= =?UTF-8?q?=20Glitch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/Search/urban.js | 36 +++++++++++++++++++++++++++++++++++ commands/Search/wikipedia.js | 4 ++-- config.json | 2 +- events/guildMemberAdd.js | 2 +- events/message.js | 7 +++---- events/ready.js | 4 ++-- json.sqlite | Bin 12288 -> 12288 bytes notepad | 28 ++++++++++++++++++++++++++- package.json | 11 ++++++----- server.js | 2 +- shrinkwrap.yaml | 17 +++++++++++++++-- 11 files changed, 94 insertions(+), 19 deletions(-) create mode 100644 commands/Search/urban.js diff --git a/commands/Search/urban.js b/commands/Search/urban.js new file mode 100644 index 0000000..1788712 --- /dev/null +++ b/commands/Search/urban.js @@ -0,0 +1,36 @@ +const Discord = require("discord.js"); +const urban = require("relevant-urban"); + +exports.run= async (client, message, args) => { + if (!args[0]) return message.channel.send("Please specify the query.") + + let result = await urban(args[0]).catch(e => { + return message.channel.send(`Unknown word phrase of **${args[0]}**, please try again.`) + }) + + const embed = new Discord.MessageEmbed() + .setColor("RANDOM") + .setTitle(result.word) + .setURL(result.urbanURL) + .setDescription(`**Definition:** \n**${result.definition}** \n\n**Example:** \n**${result.example}**`) + .setAuthor("Author", result.author, true) + .addField("Rating", `<:upvote:744158383631892580> ${result.thumbsUp.toLocaleString()} | <:downvote:746609467147419699> ${result.thumbsDown.toLocaleString()}`) + + if (result.tags.length > 0 && result.tags.join(" ").length < 1024) { + embed.addField("Tags", result.tags.join(", "), true); + } + + return message.channel.send(embed); +} + +exports.help = { + name: "urban", + description: "Defines of a word, but with urban Dictionary.", + usage: "urban <word>", + example: "urban Temple" +} + +exports.conf = { + aliases: ["ud"], + cooldown: 5 +} \ No newline at end of file diff --git a/commands/Search/wikipedia.js b/commands/Search/wikipedia.js index cccaa65..d29019d 100644 --- a/commands/Search/wikipedia.js +++ b/commands/Search/wikipedia.js @@ -10,7 +10,7 @@ exports.run = async (client, message, args) => { const article = res.data; const wikipedia = new Discord.MessageEmbed() - .setColor(0xd15994) + .setColor("RANDOM") .setAuthor("Wikipedia", "https://i.imgur.com/a4eeEhh.png") .setTitle(`**${article.title}**`) .setURL(article.content_urls.desktop.page) @@ -32,4 +32,4 @@ exports.help = { exports.conf = { aliases: ["wiki"], cooldown: 10 -}; \ No newline at end of file +}; diff --git a/config.json b/config.json index 5a0dc98..7a5ab7a 100644 --- a/config.json +++ b/config.json @@ -1,5 +1,5 @@ { "owners": ["725968708358373477", "529493423556919296"], - "prefix": ".", + "prefix": "pinata ", "google": "AIzaSyBzgTW3ILZ2YaQd4VAp0UJC6fIwQWj067s" } \ No newline at end of file diff --git a/events/guildMemberAdd.js b/events/guildMemberAdd.js index 0cf4655..85fcc9e 100644 --- a/events/guildMemberAdd.js +++ b/events/guildMemberAdd.js @@ -9,7 +9,7 @@ module.exports = async (client, member) => { let number = randomInteger(100000, 1000000); // The number will be shuffled from the range 100K - 1M - let verifyChannel = member.guild.channels.cache.find(ch => ch.id === "746205759997476895"); + let verifyChannel = member.guild.channels.cache.find(ch => ch.id === "747647762463719584"); // Your Verification Text Channel. await db.set(`verification.${member.user.id}`, number); diff --git a/events/message.js b/events/message.js index de7a313..e1a9d92 100644 --- a/events/message.js +++ b/events/message.js @@ -7,7 +7,7 @@ module.exports = async (client, message) => { let prefix = client.config.prefix; - let inviteLink = ["discord.gg/", "discord.com/invite", "discordapp.com/invite"]; + let inviteLink = ["discord.gg/", "discord.com/invite", "discordapp.com/invite", "invite.gg/invite", "discord.io/invite", "discord.me/invite"]; if (inviteLink.some(word => message.content.toLowerCase().includes(word))) { await message.delete(); @@ -16,7 +16,7 @@ module.exports = async (client, message) => { } // Verification Site - if (message.channel.id === "746205759997476895") { // Verification Text Channel + if (message.channel.id === "747647762463719584") { // Verification Text Channel // Re-send Code System if (message.content.startsWith("resend")) { let code = db.get(`verification.${message.author.id}`); @@ -60,7 +60,7 @@ module.exports = async (client, message) => { client.emit('experience', message); - let afk = new db.table("AFKs"), + let afk = new db.table("AFKs"), authorStatus = await afk.fetch(message.author.id), mentioned = message.mentions.members.first(); @@ -84,7 +84,6 @@ module.exports = async (client, message) => { } // If the user doesn't doing any to the bot, return it. - if (!message.content.startsWith(prefix)) return; let args = message.content.slice(prefix.length).trim().split(/ +/g); let msg = message.content.toLowerCase(); diff --git a/events/ready.js b/events/ready.js index 4aae736..25d9571 100644 --- a/events/ready.js +++ b/events/ready.js @@ -3,14 +3,14 @@ const Discord = require("discord.js"); module.exports = client => { console.log(`Login as ${client.user.tag} to serve in ${client.channels.cache.size} channels on ${client.guilds.cache.size} servers, for a total of ${client.users.cache.size} users.`); function randomStatus() { - let status = [`on ${client.guilds.cache.size} guild(s) || Type .help`, `with ${client.users.cache.size} online(s) || Type .help`] // You can change it whatever you want. + let status = [`Serving on ${client.guilds.cache.size} guild(s) || Type .help`, `with ${client.users.cache.size} online(s) || Type .help`] // You can change it whatever you want. let rstatus = Math.floor(Math.random() * status.length); // client.user.setActivity(status[rstatus], {type: "WATCHING"}); // You can change the "WATCHING" into STREAMING, LISTENING, and PLAYING. // Example: streaming - client.user.setActivity(status[rstatus], {type: "STREAMING", url: "https://www.twitch.tv/vii_rakk"}); + client.user.setActivity(status[rstatus], {type: "PLAYING"}); } setInterval(randomStatus, 30000); // Time in ms. 30000ms = 30 seconds. Min: 20 seconds, to avoid ratelimit. } \ No newline at end of file diff --git a/json.sqlite b/json.sqlite index ecd7fa3ce3a7f41fce6591ac2764f93f5c676890..774ee1749361123b3496bedd52c0c6b53d323389 100644 GIT binary patch delta 660 zcmZWnJ!_Lu7){fl8JdQOO-xN{yi%wb%DvC$y)ihr2@Wo9MG`QUma46S6iTq-;NW2E zJ1Q1kJC*za2Y-OBg8#!we3C*exV*zT=RMCkhr8d~?;R}WXXUVQ+rB5g&*fS!mn#;I zbLBVloAVC}$EBa8kEQP1!;_t?P<|(cLi1C9Yw%*Qwee&<``V~p+;h9zt`mf~?Iwil z#O(J%vxJ_e2xYFiQwpL}1hb>+(^Am0$e*S92y5^2a~%HZMnCFr^WC;XrX-?XqMEah zNnPjkcAARAu<e8qV(=2sV^kHQtktMq;N*crh{{5qfg(>}4IE?gAtj7HAP8su#Y+_s zBM=Eu0U@EDiajf{`TEG>DJIIkU#?b|l!O%ngcKkmW>*>u#o?>_#lrIITIQQ8FD<?x zazIUDDzS6kbrho|YC9#?X#FBkuw)R$HpCFUO)9G65X{M{+hqpVNn}E?|NaZ_ItT!Q z#+|KjebT{5@&vZ6BH2Wwfg+OK1TzH{u~EJ>`?tF1X6w(lpA8;u?Cy<?ypNC={MZ`U z!nsv9zQ6`XV^u;xD`v!1H_SdX4n~_xM>8|OMwQmL^5MPnH&$<s)e`M-U0Y^Il#l?K TC4~e@+?u=dxOKO`zUJItL1CR~ delta 373 zcmZojXh@hK#l*B{qKp%e+?cSCU!13jfrE8F1AjYT7Oy<(exBJpvAm0UwKo<nXXWpe zW?_+?rJa*nmYS29mp=Kwtk~oWBJAcShK4#yU{NJ2^I9DxGXn!7b2C#*GeaW-a}x^# zV-qE-YNd(-B`YHn1Gq}#$$X-PJQfH6qscv@`8?)Ea1}<A|H(;iRur4W#AA#kx_Q4u zHxpZ}G8?m`<K%_1^6a&|kqnZJ%#$C=3QxWzJAqY)gIU#ma<+_yS1lhigO^}&US>gR zHHd8|Se9CpnU<NHSdy8a2Nu#sl9tDm=7CC2ww6s4W?*1QhbeEgU}BMON}pUP7qU4^ vZayR9rOkp0NBAcOurujdPiB-87K>2|&&XFO0EU!8X0bw|LV99ljFJ)ntp;q( diff --git a/notepad b/notepad index 4e7cd29..7264ef0 100644 --- a/notepad +++ b/notepad @@ -63,7 +63,33 @@ client.on('message', async message => { if (!message.content.startsWith(prefix)) return; - let args = message.content.slice(prefix.length).trim().split(/ +/g); + let args = const Discord = require("discord.js"); +const db = require("quick.db"); + +exports.run = async (client, message, args) => { + const status = new db.table("AFKs"); + let afk = await status.fetch(message.author.id); + const embed = new Discord.MessageEmbed().setColor("RANDOM") + + if (!afk) { + embed.setDescription(`**${message.author.tag}** now AFK.`) + embed.setFooter(`Reason: ${args.join(" ") ? args.join(" ") : "AFK"}`) + status.set(message.author.id, args.join(" ") || `AFK`); + } else { + embed.setDescription("You are no longer AFK."); + status.delete(message.author.id); + } + + message.channel.send(embed) +} + +exports.help = { + name: "afk", + description: "AFK", + usage: ["afk <reason>"], + example: ["afk go to poop\n afk go to pee"] +} +; let msg = message.content.toLowerCase(); let cmd = args.shift().toLowerCase(); diff --git a/package.json b/package.json index d727247..9528867 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "hello-express", + "name": "pinata-pal", "version": "0.0.1", "description": "A simple Node app built on Express, instantly up and running.", "main": "server.js", @@ -9,7 +9,7 @@ "dependencies": { "express": "^4.17.1", "discord.js": "^12.3.1", - "moment-duration-format": "^2.2.2", + "moment-duration-format": "^2.3.2", "os": "^0.1.1", "cpu-stat": "^2.0.1", "ms": "^2.1.2", @@ -17,17 +17,18 @@ "node-fetch": "^2.6.0", "quick.db": "^7.1.1", "node-superfetch": "^0.1.10", - "parse-ms": "^2.0.0", + "parse-ms": "^2.1.0", "superagent": "^6.0.0", "kitsu.js": "^2.0.0", "axios": "^0.19.2", - "dateformat": "^3.0.3" + "dateformat": "^3.0.3", + "relevant-urban": "^2.0.0" }, "engines": { "node": "12.x" }, "repository": { - "url": "https://glitch.com/edit/#!/hello-express" + "url": "https://glitch.com/edit/#!/join/6079c2f9-18b7-4334-a542-86f442a97ae2" }, "license": "MIT", "keywords": [ diff --git a/server.js b/server.js index cb6914b..cd476bd 100644 --- a/server.js +++ b/server.js @@ -10,7 +10,7 @@ client.package = require("./package.json"); client.on("warn", console.warn); // This will warn you via logs if there was something wrong with your bot. client.on("error", console.error); // This will send you an error message via logs if there was something missing with your coding. -let memberlog = "746294896830447617"; +let memberlog = "747654034508349530"; client.on("guildMemberAdd", member => { if (member.guild.id !== "725952860076113962") return; diff --git a/shrinkwrap.yaml b/shrinkwrap.yaml index b5c29e7..63cc511 100644 --- a/shrinkwrap.yaml +++ b/shrinkwrap.yaml @@ -13,6 +13,7 @@ dependencies: os: 0.1.1 parse-ms: 2.1.0 quick.db: 7.1.1 + relevant-urban: 2.0.0 superagent: 6.0.0 packages: /@discordjs/collection/0.1.6: @@ -895,6 +896,12 @@ packages: node: '>= 6' resolution: integrity: sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== + /relevant-urban/2.0.0: + dependencies: + snekfetch: 3.6.4 + dev: false + resolution: + integrity: sha1-abvU9DpnSQjbkI4n8jCWyw8kuLk= /safe-buffer/5.1.2: dev: false resolution: @@ -978,6 +985,11 @@ packages: dev: false resolution: integrity: sha512-bCR6cP+aTdScaQCnQKbPKtJOKDp/hj9EDLJo3Nw4y1QksqaovlW/bnptB6/c1e+qmNIDHRK+oXFDdEqBT8WzUA== + /snekfetch/3.6.4: + deprecated: use node-fetch instead + dev: false + resolution: + integrity: sha512-NjxjITIj04Ffqid5lqr7XdgwM7X61c/Dns073Ly170bPQHLm6jkmelye/eglS++1nfTWktpP6Y2bFXjdPlQqdw== /statuses/1.5.0: dev: false engines: @@ -1175,11 +1187,12 @@ specifiers: express: ^4.17.1 kitsu.js: ^2.0.0 moment: ^2.27.0 - moment-duration-format: ^2.2.2 + moment-duration-format: ^2.3.2 ms: ^2.1.2 node-fetch: ^2.6.0 node-superfetch: ^0.1.10 os: ^0.1.1 - parse-ms: ^2.0.0 + parse-ms: ^2.1.0 quick.db: ^7.1.1 + relevant-urban: ^2.0.0 superagent: ^6.0.0