diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 656811d..0000000 --- a/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -node_modules -data -config.js -package-lock.json \ No newline at end of file diff --git a/LICENSE.md b/LICENSE.md deleted file mode 100644 index 4e230a1..0000000 --- a/LICENSE.md +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (c) 2018 YorkAARGH -Copyright (c) 2018-2020 mudkipscience - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/README.md b/README.md deleted file mode 100644 index d0fde98..0000000 --- a/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# Woomy -Woomy is a all-purpose discord bot built off the [guidebot](https://github.com/AnIdiotsGuide/guidebot) base and coded in node.js using discord.js. - -# How to use -The easiest way to use Woomy is to invite it to your server with [this link.](https://discordapp.com/oauth2/authorize?client_id=435961704145485835&permissions=2134240503&scope=bot) It is hosted 24/7 and automatically updates itself when a new release is made available, making sure you always get the newest features. - -You can also self-host! Some modificatiomns to the code will need to be made before Woomy will run on your machine, but anyone who can read errors will figure out what needs to be changed pretty quickly :P - -# Requirements -- git -- node.js v12.0.0 or higher -- node-gyp build tools -- ffmpeg (or ffmpeg-static) - -# Installation -- Clone Woomy to your machine -- Run `npm i` in Woomy's directory -- Open config.js in your code editor and insert all the required information - -# Contributing -If you wish to contribute to Woomy, please fork the repository and open a pull request. Any contribution is appreciated <3 diff --git a/configTemplate.js b/configTemplate.js deleted file mode 100644 index b6e96c3..0000000 --- a/configTemplate.js +++ /dev/null @@ -1,75 +0,0 @@ -const config = { - // ID's - "owners": [], // Adding your ID here will give you access to dangerous commands like eval. Please be careful with who you add here! Eval can be used to modify the host machine. - - // Host options - "devmodeEnabled": false, // true or false - "loggingServer": "", // server ID, or blank to disable - "startupLogs": "", // Channel ID, or blank to disable - "consoleLogs": "", // Channel ID, or blank to disable - - // Tokens - "token": "", // Your bot's token. - "devtoken": "", // (optional) another token, meant for a bot used for development - "ytkey": "", // Youtube API key, needed for music searching to work - "dblkey": "", // top.gg key, sends bot statistics to top.gg. You do not need this. - - // Default per-server settings - "defaultSettings" : { - "prefix": "~", - "devprefix": "!", - "modRole": "None set", - "adminRole": "None set", - "mutedRole": "None set", - "autorole": "off", - "welcomeChannel": "off", - "welcomeMessage": "off", - "leaveMessage": "off", - "chatlogsChannel": "off", - "modlogsChannel": "off", - "raidMode": "off", - "raidModeStrict": "off", - "blacklisted": "ARRAY", - "botChannels": "ARRAY", - "AFK": "ARRAY", - "SAR": "ARRAY", - "customCommands": "ARRAY", - }, - - // Perm levels - permLevels: [ - { level: 0, - name: "User", - check: () => true - }, - - { level: 1, - name: "Moderator", - check: (message) => { - try { - if (message.member.roles.cache.has(message.settings.modRole)) return true; - } catch (e) { - return false; - } - } - }, - - { level: 2, - name: "Administrator", - check: (message) => { - try { - if (message.member.roles.cache.has(message.settings.adminRole) || message.member.permissions.has("ADMINISTRATOR")) return true; - } catch (e) { - return false; - } - } - }, - - { level: 3, - name: "Server Owner", - check: (message) => message.channel.type === "text" ? (message.guild.ownerID === message.author.id ? true : false) : false - }, - ] -}; - -module.exports = config; diff --git a/index.js b/index.js deleted file mode 100644 index 49d5326..0000000 --- a/index.js +++ /dev/null @@ -1,93 +0,0 @@ -if (Number(process.version.slice(1).split(".")[0]) < 12) { - throw new Error("Node 12.0.0 or higher is required. Please update Node on your system."); -}; - -const Discord = require('discord.js'); -const { promisify } = require('util'); -const readdir = promisify(require('fs').readdir); -const Enmap = require('enmap'); -const chalk = require('chalk'); -const client = new Discord.Client(); - -try { - client.config = require('./config'); -} catch (err) { - console.log('Failed to load config.js:', err); - process.exit(); -}; - -try{ - client.version = require('./version.json'); -} catch (err) { - console.log('Failed to load version.json:', err); - process.exit(); -}; - -try{ - client.logger = require('./src/modules/Logger'); -} catch (err) { - console.log('Failed to load Logger.js:', err); - process.exit(); -}; - -client.logger.setClient(client); - -try{ - require("./src/modules/functions")(client); -} catch (err) { - console.log('Failed to load functions.js:', err); - process.exit(); -}; - -if(client.config.devmodeEnabled == true && process.env['USER'] != 'container') { - client.devmode = true; -} else { - client.devmode = false; - if(client.config.dblkey.length > 0) { - const DBL = require("dblapi.js"); - const dblapi = new DBL(client.config.dblkey, client); - }; -}; - -client.commands = new Enmap(); -client.aliases = new Enmap(); -client.settings = new Enmap({name: 'settings'}); - -const init = async () => { - const cmdFiles = await readdir("./src/commands/"); - client.logger.info(`Loading ${cmdFiles.length} commands.`); - cmdFiles.forEach(file => { - if (!file.endsWith(".js")) { - return; - }; - const response = client.loadCommand(file); - if (response) { - console.log(response); - }; - }); - - const evtFiles = await readdir("./src/events/"); - client.logger.info(`Loading ${evtFiles.length} events.`); - evtFiles.forEach(file => { - if (!file.endsWith(".js")) { - return; - }; - const eventName = file.split(".")[0]; - const event = require(`./src/events/${file}`); - client.on(eventName, event.bind(null, client)); - }); - - client.levelCache = {}; - for (let i = 0; i < client.config.permLevels.length; i++) { - const thisLevel = client.config.permLevels[i]; - client.levelCache[thisLevel.name] = thisLevel.level; - }; - - if(client.devmode === true) { - client.login(client.config.devtoken); - } else { - client.login(client.config.token); - }; -}; - -init(); \ No newline at end of file diff --git a/package.json b/package.json deleted file mode 100644 index 891ab34..0000000 --- a/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "woomy", - "version": "1.1.0", - "description": "Woomy is a all-purpose discord bot built off the guidebot base and coded in node.js using discord.js.", - "main": "index.js", - "dependencies": { - "@discordjs/opus": "^0.1.0", - "better-sqlite3": "^5.4.1", - "chalk": "^3.0.0", - "dblapi.js": "^2.3.1", - "discord.js": "^12.0.2", - "enmap": "^5.2.4", - "garfield": "^1.1.2", - "get-youtube-id": "^1.0.1", - "hastebin-gen": "^2.0.5", - "moment": "^2.24.0", - "moment-duration-format": "^2.3.2", - "nekos.life": "^2.0.5", - "node-fetch": "^2.6.0", - "openweather-apis": "^4.2.0", - "prism-media": "^1.2.1", - "randomcolor": "^0.5.4", - "relevant-urban": "^2.0.0", - "request": "^2.88.2", - "to-zalgo": "^1.0.1", - "urban": "^0.3.2", - "weather-js": "^2.0.0", - "youtube-info": "^1.3.2", - "ytdl-core-discord": "^1.1.0" - }, - "devDependencies": {}, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/mudkipscience/woomy.git" - }, - "author": "mudkipscience", - "license": "MIT", - "bugs": { - "url": "https://github.com/mudkipscience/woomy/issues" - }, - "homepage": "https://github.com/mudkipscience/woomy#readme" -} diff --git a/resources/audio/WOOMY.mp3 b/resources/audio/WOOMY.mp3 deleted file mode 100644 index 9b39891..0000000 Binary files a/resources/audio/WOOMY.mp3 and /dev/null differ diff --git a/resources/images/attackhelicopter.jpg b/resources/images/attackhelicopter.jpg deleted file mode 100644 index c077f0d..0000000 Binary files a/resources/images/attackhelicopter.jpg and /dev/null differ diff --git a/resources/images/fax.png b/resources/images/fax.png deleted file mode 100644 index a616839..0000000 Binary files a/resources/images/fax.png and /dev/null differ diff --git a/resources/other/coolpeople.json b/resources/other/coolpeople.json deleted file mode 100644 index d5f335c..0000000 --- a/resources/other/coolpeople.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "coolPeople": [ - "448354605617643520", - "433790467830972417", - "231777839576252417", - "285992938314661899", - "231704701433937931", - "324937993972350976", - "336492042299637771", - "273867501006225419", - "331870539897372672", - "304000458144481280", - "239787232666451980", - "264970229514371072", - "254310746450690048", - "358390849807319040", - "211011138656272386", - "266472557740425216", - "102943767346057216" - ] -} \ No newline at end of file diff --git a/resources/other/identities.json b/resources/other/identities.json deleted file mode 100644 index 4afd11a..0000000 --- a/resources/other/identities.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "agender": { - "name": "agender", - "description": "A gender identity used by someone who has no gender, or sometimes by someone whose gender is neutral." - }, - "androgyne": { - "name": "androgyne", - "description": "A gender identity associated with androgyny. Androgynes have a gender which is simultaneously feminine and masculine, although not necessarily in equal amounts." - }, - "androgynous": { - "name": "androgynous", - "description": "A term used to refer to people who have both feminine and masculine characteristics." - }, - "aporagender": { - "name": "aporagender", - "description": "A gender that is not male, female, or anything in between that still has a distinct gendered feeling." - }, - "bigender": { - "name": "bigender", - "description": "Having two gender identities, either simultaneously or varying between the two." - }, - "cisgender": { - "name": "cisgender", - "description": "Someone who identifies with their assigned gender at birth." - }, - "demiboy": { - "name": "demiboy", - "description": "Someone who identifies as partially male and partially another gender." - }, - "demiflux": { - "name": "demiflux", - "description": "A gender where one part of someone’s gender is static, and the other part fluctuates in intensity." - }, - "demigender": { - "name": "demigender", - "description": "Someone who identifies as partially one gender, and partially another." - }, - "demigirl": { - "name": "demigirl", - "description": "Someone who identifies as partially female and partially another gender." - }, - "dyadic": { - "name": "dyadic", - "description": "A word used to refer to people who are not intersex" - }, - "enby": { - "name": "enby", - "description": "Shortened term for “nonbinary”. Used as a noun, like “boy” or “girl” but for nonbinary people." - }, - "fluidflux": { - "name": "fluidflux", - "description": "A gender identity which refers to someone with a gender that moves between two or more genders and also fluctuates in intensity." - }, - "genderfluid": { - "name": "genderfluid", - "description": "Someone whose gender varies over time. This might be fluctuating between different genders, or expressing multiple aspects of various genders at the same time." - }, - "genderflux": { - "name": "genderflux", - "description": "Someone whose gender fluctuates, usually between agender and something else." - }, - "genderqueer": { - "name": "genderqueer", - "description": "An umbrella term for all the nonbinary genders. Genderqueer can be a standalone identity, or can refer to a more specific gender identity." - }, - "gendervoid": { - "name": "gendervoid", - "description": "Someone who does not experience gender, or who feels an absence or void in the place of gender." - }, - "intersex": { - "name": "intersex", - "description": "An intersex person is someone with sex characteristics (sexual anatomy, reproductive organs, chromosomal patterns, etc.) that do not align with the typical descriptions of male and female." - }, - "libragender": { - "name": "libragender", - "description": "A gender identity that is mostly agender, but has a connection to masculinity and/or femininity and/or other gendered feelings. That connection may be static (libragender, librafeminine, libramasculine, etc) or fluid, where one feels that the gender one experiences changes (librafluid)." - }, - "neutrois": { - "name": "neutrois", - "description": "Having a null or neutral gender." - }, - "nonbinary": { - "name": "nonbinary", - "description": "An umbrella term for all the gender identities that aren't male or female (the binary genders)" - }, - "non-gendered": { - "name": "non-gendered", - "description": "Having no gender." - }, - "polygender": { - "name": "polygender", - "description": "Having more than one gender, either at the same time or at different times. A polygender person may identify with any combination of binary and nonbinary genders." - }, - "pangender": { - "name": "pangender", - "description": "Having more than one gender, especially someone who identifies as all genders." - }, - "transfeminine": { - "name": "transfeminine", - "description": "A transgender person who identifies with femininity, either as a binary female or a fem-leaning nonbinary identity." - }, - "transgender": { - "name": "transgender", - "description": "Someone whose identity differs from their assigned gender at birth." - }, - "transmasculine": { - "name": "transmasculine", - "description": "A transgender person who identifies with masculinity, either as a binary male or a masc-leaning nonbinary identity." - } -} \ No newline at end of file diff --git a/resources/other/lyrics.json b/resources/other/lyrics.json deleted file mode 100644 index cd753d2..0000000 --- a/resources/other/lyrics.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "bohemian_rhapsody": [ - "Is this the real life?", - "Is this just fantasy?", - "Caught in a landslide, no escape from reality", - "Open your eyes, look up to the skies and see", - "I'm just a poor boy, I need no sympathy", - "Because I'm easy come, easy go, little high, little low", - "Any way the wind blows doesn't really matter to me, to me", - "Mama, just killed a man", - "Put a gun against his head, pulled my trigger, now he's dead", - "Mama, life had just begun", - "But now I've gone and thrown it all away", - "Mama, ooh, didn't mean to make you cry", - "If I'm not back again this time tomorrow", - "Carry on, carry on as if nothing really matters", - "Too late, my time has come", - "sends shivers down my spine, body's aching all the time", - "Goodbye, everybody, I've got to go", - "Gotta leave you all behind and face the truth", - "Mama, ooh, (Anyway the wind blows)", - "I don't wanna die", - "I sometimes wish I'd never been born at all", - "i see a little silhouetto of a man", - "Scaramouche! Scaramouche! will you do the Fandango?", - "Thunderbolt and lightning, very, very fright'ning me", - "(Galileo) Galileo, (Galileo) Galileo, Galileo Figaro magnifico", - "I'm just a poor boy, nobody loves me", - "He's just a poor boy from a poor family", - "spare him his life from this monstrosity", - "Easy come, easy go, will you not let me go?", - "Bismillah! No, we will not let you go", - "(Let him go!) Bismillah! We will not let you go", - "(Let him go!) Bismillah! We will not let you go", - "(Let me go) Will not let you go", - "(Let me go) Will not let you go", - "(Let me go) Ah", - "no, no, no, no, no, no, no", - "(Oh mamma mia, mamma mia) Mamma mia, let me go", - "Beelzebub has the devil put aside for me, for me, for me!", - "So you think you can stone me and spit in my eye?", - "so you think you can love me and leave me to die?", - "Oh baby, can't do this to me, baby!", - "Just gotta get out, just gotta get right outta here!", - "Nothing really matters, anyone can see", - "nothing really matters", - "Nothing really matters, to me", - "any way the wind blows" - ], - - "creeper": [ - "Aw man", - "So we back in the mine", - "Got our pickaxe swinging from side to side", - "Side side to side", - "This task a grueling one", - "Hope to find some diamonds tonight night night", - "Diamonds tonight", - "Heads up", - "You hear a sound turn around and look up", - "Total shock fills your body", - "Oh no it's you again", - "I can never forget those eyes eyes eyes", - "Eyes-eye-eyes", - "Cause baby tonight", - "The creeper's tryna steal all our stuff again", - "Cause baby tonight", - "You grab your pick, shovel and bolt again", - "And run run until it's done done", - "Until the sun comes up in the morn", - "Cause baby tonight", - "The creeper's tryna steal all our stuff again", - "Just when you think you're safe", - "Overhear some hissing from right behind", - "Right right behind", - "That's a nice life you have", - "Shame it's gotta end at this time time time", - "Time-time-time-time", - "Blows up", - "Then your health bar drops and you could use a one up", - "Get inside, don't be tardy", - "So now you're stuck in there", - "Half a heart is left, but don't die die die", - "Die-die-die", - "Cause baby tonight", - "The creeper's tryna steal all our stuff again", - "Cause baby tonight", - "You grab your pick shovel and bolt again", - "And run run until it's done done", - "Until the sun comes up in the morn", - "Cause baby tonight?", - "The creeper's tryna steal all our stuff again", - "Dig up diamonds and craft those diamonds", - "And make some armor, get it baby", - "Go and forge that like you so MLG pro", - "The sword's made of diamonds, so come at me bro, huh", - "Training in your room under the torchlight", - "Hone that form to get you ready for the big fight", - "Every single day and the whole night", - "Creeper's out prowlin', hoo, alright", - "Look at me, look at you", - "Take my revenge, that's what I'm gonna do", - "I'm a warrior baby, what else is new", - "And my blade's gonna tear through you, bring it", - "Cause baby tonight", - "The creeper's tryna steal all our stuff again", - "(Gather your stuff, yeah, let's take back the world)", - "Yeah baby tonight", - "Grab your sword armor and go", - "Take your revenge", - "So fight fight like it's the last last night", - "Of your life life show them your bite", - "Cause baby tonight", - "The creeper's tryna steal all our stuff again", - "Cause baby tonight", - "You grab your pick shovel and bolt again", - "And run run until it's done done", - "Until the sun comes up in the morn", - "Cause baby tonight", - "The creeper's tryna steal all our stuff again" - ] -} \ No newline at end of file diff --git a/resources/other/pronouns.json b/resources/other/pronouns.json deleted file mode 100644 index fa65ece..0000000 --- a/resources/other/pronouns.json +++ /dev/null @@ -1,154 +0,0 @@ -{ - "ae/aer": { - "name": "ae/aer", - "examples": "• **Ae** went to the park.\n• I went with **aer**.\n• **Ae** brought **aer** frisbee.\n• At least I think it was **aers.**\n• **Ae** threw a frisbee to **aerself**." - }, - "e/em": { - "name": "e/em", - "examples": "• **E** went to the park.\n• I went with **em**.\n• **E** brought **eir** frisbee.\n• At least I think it was **eirs**.\n• **E** threw a frisbee to **emself**." - }, - "ey/em": { - "name": "ey/em", - "examples": "• **Ey** went to the park.\n• I went with **em**.\n• **Ey** brought **eir** frisbee.\n• At least I think it was **eirs**.\n• **Ey** threw a frisbee to **eirself**." - }, - "fae/faer": { - "name": "fae/faer", - "examples": "• **Fae** went to the park.\n• I went with **faer**.\n• **Fae** brought **faer** frisbee.\n• At least I think it was **faers**.\n• **Fae** threw a frisbee to **faerself**." - }, - "fey/fem": { - "name": "fey/fem", - "examples": "• **Fey** went to the park.\n• I went with **fem**.\n• **Fey** brought **feir** frisbee.\n• At least I think it was **feirs**.\n• **Fey** threw a frisbee to **feirself**." - }, - "he/him": { - "name": "he/him", - "examples": "• **He** went to the park.\n• I went with **him**.\n• **He** brought **his** frisbee.\n• At least I think it was **his**.\n• **He** threw a frisbee to **himself**." - }, - "hu/hum": { - "name": "hu/hum", - "examples": "• **Hu** went to the park.\n• I went with **hum**.\n• **Hu** brought **hus** frisbee.\n• At least I think it was **hus**.\n• **Hu** threw a frisbee to **humself**." - }, - "it/its": { - "name": "it/its", - "examples": "• **It** went to the park.\n• I went with **it**.\n• **It** brought **its** frisbee.\n• At least I think it was **its**.\n• **It** threw a frisbee to **itself**." - }, - "jee/jem": { - "name": "je/jem", - "examples": "• **Jee** went to the park.\n• I went with **jem**.\n• **Jee** brought **jeir** frisbee.\n• At least I think it was **jeirs**.\n• **Jee** threw a frisbee to **jemself**." - }, - "kit/kits": { - "name": "kit/kits", - "examples": "• **Kit** went to the park.\n• I went with **kit**.\n• **Kit** brought **kits** frisbee.\n• At least I think it was **kits**.\n• **Kit** threw a frisbee to **kitself**." - }, - "ne/nem": { - "name": "ne/nem", - "examples": "• **Ne** went to the park.\n• I went with **nem**.\n• **Ne** brought **nir** frisbee.\n• At least I think it was **nirs**.\n• **Ne** threw a frisbee to **nemself**." - }, - "peh/pehm": { - "name": "pe/pehm", - "examples": "• **Peh** went to the park.\n• I went with **pehm**.\n• **Peh** brought **peh's** frisbee.\n• At least I think it was **peh's**.\n• **Peh** threw a frisbee to **pehself**." - }, - "per": { - "name": "per/per", - "examples": "• **Per** went to the park.\n• I went with **per**.\n• **Per** brought **per** frisbee.\n• At least I think it was **pers**.\n• **Per** threw a frisbee to **perself**." - }, - "sie/hir": { - "name": "sie/hir", - "examples": "• **Sie** went to the park.\n• I went with **hir**.\n• **Sie** brought **hir** frisbee.\n• At least I think it was **hirs**.\n• **Sie* threw a frisbee to **hirself**." - }, - "se/sim": { - "name": "se/sim", - "examples": "• **Se** went to the park.\n• I went with **sim**.\n• **Se** brought **ser** frisbee.\n• At least I think it was **sers**.\n• **Se** threw a frisbee to **serself**." - }, - "shi/hir": { - "name": "shi/her", - "examples": "• **Shi** went to the park.\n• I went with **hir**.\n• **Shi** brought **shir** frisbee.\n• At least I think it was **hirs**.\n• **Shi** threw a frisbee to **hirself**." - }, - "si/hyr": { - "name": "si/hyr", - "examples": "• **Si** went to the park.\n• I went with **hyr**.\n• **Si** brought **hyr** frisbee.\n• At least I think it was **hyrs**.\n• **Si** threw a frisbee to **hyrself**." - }, - "they/them": { - "name": "they/them", - "examples": "• **They** went to the park.\n• I went with **them**.\n• **They** brought **their** frisbee.\n• At least I think it was **theirs**.\n• **They** threw a frisbee to **themself**." - }, - "thon": { - "name": "thon/thon", - "examples": "• **Thon** went to the park.\n• I went with **thon**.\n• **Thon** brought **thons** frisbee.\n• At least I think it was **thons**.\n• **Thon** threw a frisbee to **thonself**." - }, - "she/her": { - "name": "she/her", - "examples": "• **She** went to the park.\n• I went with **her**.\n• **She** brought **her** frisbee.\n• At least I think it was **hers**.\n• **She** threw a frisbee to **herself**." - }, - "ve/ver": { - "name": "ve/ver", - "examples": "• **Ve** went to the park.\n• I went with **ver**.\n• **Ve** brought **vis** frisbee.\n• At least I think it was **vis**.\n• **Ve** threw a frisbee to **verself**." - }, - "ve/vem": { - "name": "ve/vem", - "examples": "• **Ve** went to the park.\n• I went with **vem**.\n• **Ve** brought **vir** frisbee.\n• At least I think it was **virs**.\n• **Ve** threw a frisbee to **vemself**." - }, - "vi/ver": { - "name": "vi/ver", - "examples": "• **Vi** went to the park.\n• I went with **ver**.\n• **Vi** brought **ver** frisbee.\n• At least I think it was **vers**.\n• **Vi** threw a frisbee to **verself**." - }, - "vi/vim/vir": { - "name": "vi/vim/vir", - "examples": "• **Vi** went to the park.\n• I went with **vim**.\n• **Vi** brought **vir** frisbee.\n• At least I think it was **virs**.\n• **Vi** threw a frisbee to **vimself**." - }, - "vi/vim/vim": { - "name": "vi/vim/vim", - "examples": "• **Vi** went to the park.\n• I went with **vim**.\n• **Vi** brought **vim** frisbee.\n• At least I think it was **vims**.\n• **Vi** threw a frisbee to **vimself**." - }, - "xie/xer": { - "name": "xie/xer", - "examples": "• **Xie** went to the park.\n• I went with **xer**.\n• **Xie** brought **xer** frisbee.\n• At least I think it was **xers**.\n• **Xie** threw a frisbee to **xerself**." - }, - "xe/xem": { - "name": "xe/xem", - "examples": "• **Xe** went to the park.\n• I went with **xem**.\n• **Xe** brought **xyr** frisbee.\n• At least I think it was **xyrs**.\n• **Xe** threw a frisbee to **xemself**." - }, - "xey/xem": { - "name": "xey/xem", - "examples": "• **Xey** went to the park.\n• I went with **xem**.\n• **Xey** brought **xeir** frisbee.\n• At least I think it was **xeirs**.\n• **Xey** threw a frisbee to **xemself**." - }, - "yo": { - "name": "yo", - "examples": "• **Yo** went to the park.\n• I went with **yo**.\n• **Yo** brought **yos** frisbee.\n• At least I think it was **yos**.\n• **Yo** threw a frisbee to **yosself**." - }, - "ze/hir": { - "name": "ze/hir", - "examples": "• **Ze** went to the park.\n• I went with **hir**.\n• **Ze** brought **hir** frisbee.\n• At least I think it was **hirs**.\n• **Ze** threw a frisbee to **hirself**." - }, - "ze/zem": { - "name": "ze/zem", - "examples": "• **Ze** went to the park.\n• I went with **zem**.\n• **Ze** brought **zes** frisbee.\n• At least I think it was **zes**.\n• **Ze** threw a frisbee to **zirself**." - }, - "ze/mer": { - "name": "ze/mer", - "examples": "• **Ze** went to the park.\n• I went with **mer**.\n• **Ze** brought **zer** frisbee.\n• At least I think it was **zers**.\n• **Ze** threw a frisbee to **zemself**." - }, - "zee/zed": { - "name": "zee/zed", - "examples": "• **Zee** went to the park.\n• I went with **zed**.\n• **Zee** brought **zeta** frisbee.\n• At least I think it was **zetas**.\n• **Zee** threw a frisbee to **zedself**." - }, - "ze/zir": { - "name": "ze/zir", - "examples": "• **Ze** went to the park.\n• I went with **zir**.\n• **Ze** brought **zir** frisbee.\n• At least I think it was **zirs**.\n• **Ze** threw a frisbee to **zirself**." - }, - "zie/zir": { - "name": "zie/zir", - "examples": "• **Zie** went to the park.\n• I went with **zir**.\n• **Zie** brought **zir** frisbee.\n• At least I think it was **zirs**.\n• **Zie** threw a frisbee to **zirself**." - }, - "zie/zem": { - "name": "zie/zem", - "examples": "• **Zie** went to the park.\n• I went with **zem**.\n• **Zie** brought **zes** frisbee.\n• At least I think it was **zes**.\n• **Zie** threw a frisbee to **zirself**." - }, - "zie/hir": { - "name": "zie/hir", - "examples": "• **Zie** went to the park.\n• I went with **hir**.\n• **Zie** brought **hir** frisbee.\n• At least I think it was **hirs**.\n• **Zie** threw a frisbee to **hirself**." - }, - "zme/zmyr": { - "name": "zme/zmyr", - "examples": "• **Zme** went to the park.\n• I went with **zmyr**.\n• **Zme** brought **zmyr** frisbee.\n• At least I think it was **zmyrs**.\n• **Zme** threw a frisbee to **zmyrself**." - } -} \ No newline at end of file diff --git a/resources/other/sexualities.json b/resources/other/sexualities.json deleted file mode 100644 index a8805ed..0000000 --- a/resources/other/sexualities.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "aesthetic attraction": { - "name": "aesthetic attraction", - "description": "Getting pleasure from the appearance of a specific individual like you would from watching beautiful scenery." - }, - "platonic attraction": { - "name": "platonic attraction", - "description": "A desire to have a platonic relationship or friendship with a specific individual." - }, - "romantic attraction": { - "name": "romantic attraction", - "description": "A desire to have a romantic relationship with a specific individual." - }, - "sensual attraction": { - "name": "sensual attraction", - "description": "A desire for physical intimacy with a specific individual. Cuddling, hand holding, etc." - }, - "sexual attraction": { - "name": "sexual attraction", - "description": "A desire for sexual contact with a specific individual." - }, - "abrosexual": { - "name": "abrosexual", - "description": "Someone whose sexuality changes frequently. They experience different sexualities over time." - }, - "androgynosexual": { - "name": "androgynosexual", - "description": "Someone who is attracted to both men and women, particularly those who are androgynous in appearance." - }, - "androsexual": { - "name": "androsexual", - "description": "Someone who is attracted to men and/or masculine people." - }, - "aromantic": { - "name": "aromantic", - "description": "Someone who does not experience romantic attraction. They do not have to also be asexual however as they may still experience other types of attraction." - }, - "asexual": { - "name": "asexual", - "description": "Someone who feels little to no sexual attraction to anyone." - }, - "bisexual": { - "name": "bisexual", - "description": "Someone who is attracted to more than one gender." - }, - "ceterosexual": { - "name": "ceterosexual", - "description": "Someone who is attracted to non-binary people." - }, - "demisexual": { - "name": "demisexual", - "description": "Someone who doesn't experience sexual/romantic attraction towards someone until they form an emotional connection." - }, - "finsexual": { - "name": "finsexual", - "description": "Someone who is attracted to women and/or feminine people." - }, - "gay": { - "name": "gay", - "description": "Someone who is homosexual (attracted to ones own gender)" - }, - "gynosexual": { - "name": "gynosexual", - "description": "Someone who as attracted to women and/or feminity." - }, - "grey-romantic": { - "name": "grey-romantic", - "description": "Someone with a romantic orentiation that is somewhere between aromantic and romantic." - }, - "heterosexual": { - "name": "heterosexual", - "description": "Someone who is attracted to people of the opposite gender." - }, - "homosexual": { - "name": "homosexual", - "description": "Someone attracted to people of ones own gender." - }, - "lesbian": { - "name": "lesbian", - "description": "A woman who is attracted to other women." - }, - "omnisexual": { - "name": "omnisexual", - "description": "Someone who is attracted to all genders." - }, - "pansexual": { - "name": "pansexual", - "description": "Someone who is attracted towards people regardless of their gender identity." - }, - "pomosexual": { - "name": "pomosexual", - "description": "Someone who does not fit into any sexual orientation label." - }, - "polysexual": { - "name": "polysexual", - "description": "Someone who is attracted to some, but not all genders." - }, - "straight": { - "name": "straight", - "description": "Someone who is heterosexual (attracted to people of the opposite gender)" - } -} \ No newline at end of file diff --git a/src/commands/8ball.js b/src/commands/8ball.js deleted file mode 100644 index ef69684..0000000 --- a/src/commands/8ball.js +++ /dev/null @@ -1,38 +0,0 @@ -exports.run = async (client, message, args) => { - if (!args[0]) - return message.channel.send( - `<:error:466995152976871434> You did not ask me a question. Usage: \`${client.commands.get(`8ball`).help.usage}\`` - ); - - var ball = [ - "No darndested clue.", - "Stupid question. You should be ashamed of yourself for even asking.", - "Yes!", - "Not in your wildest dreams!", - "No chance.", - "Never.", - "Just Google it.", - "¯\\_(ツ)_/¯", - "Possibly.", - "There's a high chance.", - "I'd rather not say." - ]; - - let mess = ball.random(); - message.channel.send(":8ball: " + mess); -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: [], - permLevel: "User", - requiredPerms: [] -}; - -exports.help = { - name: "8ball", - category: "Fun", - description: "Consult the 8ball for advice.", - usage: "8ball [question]" -}; diff --git a/src/commands/about.js b/src/commands/about.js deleted file mode 100644 index 2049bfa..0000000 --- a/src/commands/about.js +++ /dev/null @@ -1,58 +0,0 @@ - -const { version } = require("discord.js"); -const moment = require("moment"); -require("moment-duration-format"); - -exports.run = (client, message) => { - const duration = moment - .duration(client.uptime) - .format(" D [days], H [hrs], m [mins], s [secs]"); - - var mud = client.users.cache.get(client.config.owners[0]).tag; - var flgx = client.users.cache.get(client.config.owners[1]).tag; - var build; - var prefix; - - if(message.guild) { - prefix = message.settings.prefix; - } else { - prefix = client.config.defaultSettings.prefix; - }; - - if(client.devmode == true) { - build = "development" - } else { - build = "production" - } - - embed = new Discord.MessageEmbed(); - embed.setColor(client.embedColour(message)); - embed.setThumbnail(client.user.avatarURL({format: "png", dynamic: true, size: 2048})) - embed.setTitle("About Woomy") - embed.addField( - "General:", `• users: \`${client.users.cache.size}\`\n• channels: \`${client.channels.cache.size}\`\n• servers: \`${client.guilds.cache.size}\`\n• commands: \`${client.commands.size}\`\n• uptime: \`${duration}\``,true - ); - embed.addField( - `Technical:`, `• RAM Usage: \`${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} MB\`\n• OS: \`${require("os").type}\`\n• bot version: \`${client.version.number} (${build})\`\n• discord.js version: \`v${version}\`\n• node.js version: \`${process.version}\``,true - ); - embed.addField( - "Links:", "[Support](https://discord.gg/HCF8mdv) | [GitHub](https://github.com/mudkipscience/woomy) | [db.org](https://discordbots.org/bot/435961704145485835/vote) | [BFD](https://botsfordiscord.com/bots/435961704145485835/vote) | [top.gg](https://discordbotlist.com/bots/435961704145485835) | [discord.js](https://discord.js.org/#/) | [guidebot](https://github.com/AnIdiotsGuide/guidebot/)" - ); - - message.channel.send(embed); -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: ["stats", "botinfo"], - permLevel: "User", - requiredPerms: [] -}; - -exports.help = { - name: "about", - category: "Utility", - description: "Information about the bot, as well as a couple of helpful links", - usage: "about" -}; diff --git a/src/commands/achievement.js b/src/commands/achievement.js deleted file mode 100644 index 49b75f7..0000000 --- a/src/commands/achievement.js +++ /dev/null @@ -1,41 +0,0 @@ -Discord = require("discord.js"); - -const url = "https://www.minecraftskinstealer.com/achievement/a.php"; - -exports.run = (client, message, args) => { - let text = args.join(" "); - - if (!text) { - return message.channel.send( - `<:error:466995152976871434> No text provided to turn into an achievement. Usage: \`${client.commands.get(`achievement`).help.usage}\`` - ); - }; - message.channel.startTyping(); - let params = "h=Achievement+Get%21&i=1&t=" + encodeURIComponent(text); - - try { - message.channel.stopTyping(); - message.channel.send({ - files: [new Discord.MessageAttachment(url + "?" + params, "achievement.png")] - }); - - } catch(err) { - message.channel.stopTyping(); - message.channel.send(`<:error:466995152976871434> Error when generating image: \`${err}\``) - } -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: [], - permLevel: "User", - requiredPerms: ["ATTACH_FILES"] -}; - -exports.help = { - name: "achievement", - category: "Fun", - description: "Generates an minecraft achievement.", - usage: "achievement [text]" -}; diff --git a/src/commands/activity.js b/src/commands/activity.js deleted file mode 100644 index 59ab78a..0000000 --- a/src/commands/activity.js +++ /dev/null @@ -1,45 +0,0 @@ -exports.run = (client, message, args) => { - if(!args[0]) { - return message.channel.send(`<:error:466995152976871434> No arguments! Usage: \`${client.commands.get(`activity`).help.usage}\``) - } - if(client.lockActivity == true) { - activityLocked = "locked"; - } else { - activityLocked = "unlocked"; - } - - if(args[0] == "lock" && !args[1]) { - client.lockActivity = true; - return message.channel.send( - "<:success:466995111885144095> Activity has been locked will no longer change automatically." - ); - }; - - if(args[0] == "unlock" && !args[1]) { - client.lockActivity = false; - return message.channel.send( - "<:success:466995111885144095> Activity has been unlocked and will begin changing automatically." - ); - }; - - client.lockActivity = true; - client.user.setActivity(args.join(" ")); - message.channel.send( - `<:success:466995111885144095> Activity locked and changed to \`${args.join(" ")}\` - `); -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: [], - permLevel: "Developer", - requiredPerms: [] -}; - -exports.help = { - name: "activity", - category: "Owner", - description: "Changes the bot's activity and disables automatic changing of the activity", - usage: "activity [activity] **OR** activity [lock/unlock]" -}; diff --git a/src/commands/adminrole.js b/src/commands/adminrole.js deleted file mode 100644 index 6e3d231..0000000 --- a/src/commands/adminrole.js +++ /dev/null @@ -1,61 +0,0 @@ -exports.run = async (client, message, args) => { - - const settings = message.settings; - - if (!client.settings.has(message.guild.id)) { - client.settings.set(message.guild.id, {}); - } - - var adminRole = message.guild.roles.cache.get(settings.adminRole) - - if (!args[0]) { - if(!adminRole) { - return message.channel.send( - `<:error:466995152976871434> There is no admin role set for this server. Please set one using \`${message.settings.prefix}adminrole \`` - ); - } else { - message.channel.send(`The current admin role is: \`${adminRole.name}\``) - } - - } else { - const joinedValue = args.join(" "); - if (joinedValue.length < 1) { - return message.channel.send( - `<:error:466995152976871434> You didn't specify a role. Usage: \`${client.commands.get(`adminrole`).help.usage}\`` - ); - }; - - if (settings.adminRole != "None set" && joinedValue === adminRole.name) { - return message.channel.send( - "<:error:466995152976871434> The admin role is already set to that!" - ); - }; - - let role = client.findRole(joinedValue, message); - - if (!role) { - return message.channel.send(`<:error:466995152976871434> That role doesn't seem to exist. Try again!`); - }; - - client.settings.set(message.guild.id, role.id, "adminRole"); - - message.channel.send( - `<:success:466995111885144095> The admin role has been set to \`${role.name}\` - `); - }; -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: [], - permLevel: "Server Owner", - requiredPerms: [] -}; - -exports.help = { - name: "adminrole", - category: "Configure", - description: "Sets the admin role for this server.", - usage: "adminrole [role]" -}; diff --git a/src/commands/autorole.js b/src/commands/autorole.js deleted file mode 100644 index 2aae88d..0000000 --- a/src/commands/autorole.js +++ /dev/null @@ -1,69 +0,0 @@ -exports.run = async (client, message, args) => { - - const settings = message.settings; - - if (!client.settings.has(message.guild.id)) { - client.settings.set(message.guild.id, {}); - } - - var autorole = message.guild.roles.cache.get(settings.autorole) - - if (!args[0]) { - if(!autorole) { - return message.channel.send( - `<:error:466995152976871434> There is no autorole set for this server. Please set one using \`${message.settings.prefix}autorole \`` - ); - } else { - message.channel.send(`Users recieve this role upon joining: \`${autorole.name}\``) - } - - } else if(args.join(" ").toLowerCase() == "off") { - if(settings.autorole == "off") { - return message.channel.send("<:error:466995152976871434> Autoroling has not been enabled.") - } - - client.settings.set(message.guild.id, "off", "autorole"); - return message.channel.send("<:success:466995111885144095> Autoroling has been disabled.") - } else { - - const joinedValue = args.join(" "); - if (joinedValue.length < 1) { - return message.channel.send( - `<:error:466995152976871434> You didn't specify a role. Usage: \`${client.commands.get(`autorole`).help.usage}\`` - ); - }; - - if (settings.autorole != "off" && joinedValue === autorole.name) { - return message.channel.send( - "<:error:466995152976871434> The autorole is already set to that!" - ); - }; - - role = client.findRole(joinedValue, message); - - if (!role) { - return message.channel.send(`<:error:466995152976871434> That role doesn't seem to exist. Try again!`); - }; - - client.settings.set(message.guild.id, role.id, "autorole"); - - message.channel.send( - `<:success:466995111885144095> The autorole has been set to \`${role.name}\` - `); - }; -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: [], - permLevel: "Administrator", - requiredPerms: ["MANAGE_ROLES"] -}; - -exports.help = { - name: "autorole", - category: "Configure", - description: "Sets the autorole for this server.", - usage: "autorole **OR** autorole off" -}; diff --git a/src/commands/avatar.js b/src/commands/avatar.js deleted file mode 100644 index 5832be2..0000000 --- a/src/commands/avatar.js +++ /dev/null @@ -1,38 +0,0 @@ -exports.run = (client, message, args) => { - let user = message.mentions.users.first(); - let users; - if (!args[0] || !message.guild) { - user = message.author; - }; - - if (!user && message.guild) { - users = client.searchForMembers(message.guild, args[0]); - if (users.length > 1) { - return message.channel.send( - "<:error:466995152976871434> Found multiple users, please be more specific or mention the user instead." - ); - } else if (users.length == 0) { - return message.channel.send( - "<:error:466995152976871434> That user doesn't seem to exist, try again!" - ); - }; - user = users[0]; - user = user.user; - } - message.channel.send(`**${user.tag}'s** avatar is: ${user.avatarURL({format: "png", dynamic: true, size: 2048})}`); -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: [], - permLevel: "User", - requiredPerms: ["EMBED_LINKS"] -}; - -exports.help = { - name: "avatar", - category: "Utility", - description: "Gives you the specified users avatar.", - usage: "avatar " -}; diff --git a/src/commands/ban.js b/src/commands/ban.js deleted file mode 100644 index affa882..0000000 --- a/src/commands/ban.js +++ /dev/null @@ -1,87 +0,0 @@ -exports.run = async (client, message, args) => { - const settings = (message.settings = client.getSettings(message.guild.id)); - - if(!args[0]) { - return message.channel.send( - `<:error:466995152976871434> No username provided. Usage: \`${client.commands.get(`ban`).help.usage}\`` - ); - }; - - let user = message.mentions.members.first(); - - if (!user) { - let users; - users = client.searchForMembers(message.guild, args[0]); - if (users.length > 1) - return message.channel.send( - "<:error:466995152976871434> Found multiple users! Please be more specific or mention the user instead." - ); - else if (users.length == 0) - return message.channel.send( - "<:error:466995152976871434> That user doesn't seem to exist. Try again!" - ); - user = users[0]; - }; - - if (user.user.id === message.guild.owner.id) { - return message.channel.send("<:error:466995152976871434> You can't ban the owner!") - }; - let moderator = message.guild.member(message.author) - if (user.roles.highest.position >= moderator.roles.highest.position && moderator.user.id !== message.guild.ownerID) { - return message.channel.send( - `<:error:466995152976871434> You can't ban people higher ranked than yourself!` - ); - }; - - let bot = message.guild.member(client.user) - if (user.roles.highest.position >= bot.roles.highest.position) { - return message.channel.send( - `<:error:466995152976871434> I can't ban people who are higher ranked than me!` - ); - }; - - if (!user.bannable) - return message.channel.send( - "<:error:466995152976871434> Specified user is not bannable." - ); - - let reason = args.slice(1).join(" "); - if (!reason) reason = `Banned by ${message.author.tag}`; - await message.guild.members.ban(user, {reason: reason}).catch(console.error); - message.channel.send(`<:success:466995111885144095> Banned \`${user.user.tag}\``); - - if (settings.modlogsChannel !== "off") { - const channel = message.guild.channels.cache.find( - channel => channel.name === settings.modlogsChannel - ); - - if (channel) { - let embed = new Discord.MessageEmbed(); - embed.setColor("#BC0057"); - embed.setAuthor("User banned!", user.user.avatarURL({format: "png", dynamic: true, size: 2048})); - embed.setDescription( - `• User: ${user.user.tag} (${user.user.id})\n• Mod: ${message.author} (${message.author.id})\n• Reason: ${reason}` - ); - try { - channel.send(embed); - } catch (err) { - // probably no permissions to send messages/embeds there - }; - }; - }; -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: [], - permLevel: "Moderator", - requiredPerms: ["BAN_MEMBERS"] -}; - -exports.help = { - name: "ban", - category: "Moderation", - description: "Bans specified user.", - usage: "ban [user] " -}; diff --git a/src/commands/blacklist.js b/src/commands/blacklist.js deleted file mode 100644 index 20c41aa..0000000 --- a/src/commands/blacklist.js +++ /dev/null @@ -1,124 +0,0 @@ -exports.run = async (client, message, [action, ...member]) => { - const settings = message.settings; - - if(settings.blacklisted == "ARRAY") { - await client.settings.set(message.guild.id, [], "blacklisted"); - } - - if(!action) { - return message.channel.send( - `<:error:466995152976871434> You didn't tell me if I was meant to add or remove someone from the blacklist! Usage: \`${client.commands.get(`blacklist`).help.usage}\`` - ) - } - - member = member.join(" ") - - if(!member) { - return message.channel.send( - `<:error:466995152976871434> You didn't tell me who to blacklist! Usage: \`${client.commands.get(`blacklist`).help.usage}\`` - ); - }; - - let user = message.mentions.members.first(); - - if(action == "add") { - if (!user) { - let users; - users = client.searchForMembers(message.guild, member); - if (users.length > 1) - return message.channel.send( - "<:error:466995152976871434> Found multiple users! Please be more specific or mention the user instead." - ); - else if (users.length == 0) - return message.channel.send( - "<:error:466995152976871434> That user doesn't seem to exist. Try again!" - ); - user = users[0]; - }; - - if(user.id === client.user.id) { - return message.channel.send('lol no'); - }; - - if (user.id === message.guild.owner.id) { - return message.channel.send("<:error:466995152976871434> You can't blacklist the owner!") - }; - - let admin = message.guild.member(message.author) - if (user.roles.highest.position >= admin.roles.highest.position && admin.user.id !== message.guild.ownerID) { - return message.channel.send( - `<:error:466995152976871434> You can't blacklist people higher ranked than yourself!` - ); - }; - - if(user.id === message.member.id) { - return message.channel.send('<:error:466995152976871434> You can\'t blacklist yourself!'); - }; - - let blacklisted = false; - - if(settings.blacklisted.length > 0) { - settings.blacklisted.forEach(function(ID) { - if(ID == user.id) { - blacklisted = true; - } - }); - - if(blacklisted == true) { - return message.channel.send('<:error:466995152976871434> This person has already been blacklisted!'); - }; - }; - - client.settings.push(message.guild.id, user.id, "blacklisted") - - return message.channel.send(`<:success:466995111885144095> Blacklisted \`${user.user.tag}\``) - }; - - - if (action == "remove") { - if (!user) { - let users; - users = client.searchForMembers(message.guild, member); - if (users.length > 1) - return message.channel.send( - "<:error:466995152976871434> Found multiple users! Please be more specific or mention the user instead." - ); - else if (users.length == 0) - return message.channel.send( - "<:error:466995152976871434> That user doesn't seem to exist. Try again!" - ); - user = users[0]; - }; - - let blacklisted = false; - - settings.blacklisted.forEach(function(ID) { - if(ID == user.id) { - blacklisted = true; - } - }); - - if(blacklisted != true) { - return message.channel.send('<:error:466995152976871434> This user isn\'t blacklisted!'); - }; - - client.settings.remove(message.guild.id, user.id, "blacklisted") - - return message.channel.send(`<:success:466995111885144095> Removed \`${user.user.tag}\` from the blacklist.`) - }; -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: [], - permLevel: "Administrator", - requiredPerms: [] -}; - -exports.help = { - name: "blacklist", - category: "Moderation", - description: "Allows you to configure Woomy's blacklist. Blacklisted users cannot use commands.", - usage: "blacklist [add/remove] [member]" -}; diff --git a/src/commands/bohemian_rhapsody.js b/src/commands/bohemian_rhapsody.js deleted file mode 100644 index c9bb3ef..0000000 --- a/src/commands/bohemian_rhapsody.js +++ /dev/null @@ -1,45 +0,0 @@ -const Discord = require("discord.js"); -const lyric = require('../../resources/other/lyrics.json') -exports.run = async (client, message, args, level) => { - const lyrics = lyric.bohemian_rhapsody; - var runtop = true; - var runbottom = false; - for(var br = 0; br < lyrics.length; br++) { - { - if (runtop === true) { - var response = await client.awaitReply(message, lyrics[br]); - runbottom = false; - }; - - if (runbottom === true) { - if (response !== lyrics[br]) { - return message.channel.send("Those aren't the lyrics!"); - } - runtop = false - }; - }; - if (runtop === true) { - runtop = false - runbottom = true - } else if (runbottom === true) { - runtop = true - runbottom = false - }; - }; - message.channel.send("What a lovely duet!"); -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: ["br"], - permLevel: "User", - requiredPerms: [] -}; - -exports.help = { - name: "bohemian_rhapsody", - category: "Fun", - description: "Queen kareoke", - usage: "bohemian_rhapsody" -}; diff --git a/src/commands/calculate.js b/src/commands/calculate.js deleted file mode 100644 index e7737b3..0000000 --- a/src/commands/calculate.js +++ /dev/null @@ -1,42 +0,0 @@ -var allowed = ["+", "-", "*", "/", "(", ")", " "]; -exports.run = (client, message, args) => { - let exercise = args.join(" "); - - if (!exercise) { - return message.channel.send( - `<:error:466995152976871434> No equation provided. Usage :\`${client.commands.get(`calculate`).help.usage}\`` - ); - } - - for (var i = 0; i < exercise.length; i++) { - let c = exercise.charAt(i); - let found = allowed.find((element) => element === c); - - if(c == "0") found = true; - if(!(Number(c) || found)) - { - return message.channel.send( - `<:error:466995152976871434> Invalid equation. Please use \`*\` for multiplication and \`/\` for division!` - ); - } - } - - let result = (new Function( 'return ' + exercise )()); - - message.channel.send(`\`RESULT:\`\n\`\`\`${result}\`\`\``); -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: ["calc", "math"], - permLevel: "User", - requiredPerms: [] -}; - -exports.help = { - name: "calculate", - category: "Utility", - description: "Solves basic mathematical equations.", - usage: "calculate [equation]" -}; \ No newline at end of file diff --git a/src/commands/cat.js b/src/commands/cat.js deleted file mode 100644 index afd627f..0000000 --- a/src/commands/cat.js +++ /dev/null @@ -1,30 +0,0 @@ -const API = require('nekos.life'); -const {sfw} = new API(); -exports.run = async (client, message) => { - message.channel.startTyping(); - try { - sfw.meow().then((json) => { - message.channel.send(json.url) - message.channel.stopTyping(); - }); - } catch (err) { - client.logger.error("cat.js: " + err); - message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`) - message.channel.stopTyping(); - }; -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: [], - permLevel: "User", - requiredPerms: ["EMBED_LINKS"] -}; - -exports.help = { - name: "cat", - category: "Image", - description: "Sends you cat pics.", - usage: "cat" -}; diff --git a/src/commands/catfact.js b/src/commands/catfact.js deleted file mode 100644 index 366999e..0000000 --- a/src/commands/catfact.js +++ /dev/null @@ -1,27 +0,0 @@ -const fetch = require("node-fetch") -exports.run = async (bot, message, args) => { - message.channel.startTyping(); - try{ - fetch('https://catfact.ninja/facts') - .then(res => res.json()) - .then(json => message.channel.send(`__**Did you know?**__\n${json.data[0].fact}`)) - } catch(err) { - message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`); - }; - message.channel.stopTyping(); -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: ["kittenfact"], - permLevel: "User", - requiredPerms: [] - }; - - exports.help = { - name: "catfact", - category: "Fun", - description: "Sends a fun fact about a cat.", - usage: "catfact/kittenfact" - }; diff --git a/src/commands/changelog.js b/src/commands/changelog.js deleted file mode 100644 index a604a98..0000000 --- a/src/commands/changelog.js +++ /dev/null @@ -1,18 +0,0 @@ -exports.run = (client, message) => { - message.channel.send(client.version.changelog) -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: ["updates"], - permLevel: "User", - requiredPerms: [] -}; - -exports.help = { - name: "changelog", - category: "Utility", - description: "Gives you the changes/features introduced with the latest update", - usage: "changelog" -}; diff --git a/src/commands/chatlogs.js b/src/commands/chatlogs.js deleted file mode 100644 index 8faab92..0000000 --- a/src/commands/chatlogs.js +++ /dev/null @@ -1,29 +0,0 @@ -exports.run = async (client, message) => { - - const settings = message.settings; - - if (!client.settings.has(message.guild.id)) client.settings.set(message.guild.id, {}); - - if (message.channel.name !== settings.chatlogsChannel) { - client.settings.set(message.guild.id, message.channel.name, "chatlogsChannel") - message.channel.send(`<:success:466995111885144095> Chat logs will now be displayed in \`${message.channel.name}\``); - } else { - client.settings.set(message.guild.id, "off", "chatlogsChannel") - message.channel.send(`<:success:466995111885144095> Chat logs disabled.`); - } -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: [], - permLevel: "Administrator", - requiredPerms: [] -}; - -exports.help = { - name: "chatlogs", - category: "Configure", - description: "Enables chat logging in your server.", - usage: "chatlogs **OR** chatlogs off" -}; diff --git a/src/commands/coinflip.js b/src/commands/coinflip.js deleted file mode 100644 index 418a996..0000000 --- a/src/commands/coinflip.js +++ /dev/null @@ -1,35 +0,0 @@ -exports.run = (client, message, args) => { - if(!args[0]) { - return message.channel.send( - `<:error:466995152976871434> Invalid choice. Usage: \`${client.commands.get(`flip`).help.usage}\`` - ); - }; - - if(args[0].toLowerCase() != "heads" && args[0].toLowerCase() != "tails") { - return message.channel.send( - `<:error:466995152976871434> Invalid choice. Usage: \`${client.commands.get(`flip`).help.usage}\`` - ); - }; - var coin = [ - "Heads!", - "Tails!" - ]; - - let mess = coin.random(); - message.channel.send(mess); -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: ["flip"], - permLevel: "User", - requiredPerms: [] -}; - -exports.help = { - name: "coinflip", - category: "Fun", - description: "Flips a coin!", - usage: "coinflip [heads/tails]" -}; diff --git a/src/commands/colour.js b/src/commands/colour.js deleted file mode 100644 index bdcbf61..0000000 --- a/src/commands/colour.js +++ /dev/null @@ -1,57 +0,0 @@ -const randomColour = require("randomcolor"); -exports.run = async (client, message, args, level) => { - var colour; - if(!args[0]) { - colour = randomColour(); - } else if(isHex(args.join(" ")) != true) { - colour = stringToHex(args.join(" ")); - } else { - colour = args[0] - } - - embed = new Discord.MessageEmbed(); - embed.setTitle(colour) - embed.setColor(colour); - embed.setImage("https://api.alexflipnote.xyz/colour/image/" + colour.replace("#", "")); - message.channel.send(embed) -}; - -function isHex(string) { - var str = string; - if(str.charAt(0) == "#") { - str = str.slice(1) - }; - - return typeof str === 'string' - && str.length === 6 - && !isNaN(Number('0x' + str)) -} - -function stringToHex(string) { - var hash = 0; - for (var i = 0; i < string.length; i++) { - hash = string.charCodeAt(i) + ((hash << 5) - hash); - } - var colour = '#'; - for (var i = 0; i < 3; i++) { - var value = (hash >> (i * 8)) & 0xFF; - colour += ('00' + value.toString(16)).substr(-2); - } - return colour; -}; - - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: ["color"], - permLevel: "User", - requiredPerms: [] -}; - -exports.help = { - name: "colour", - category: "Utility", - description: "Gives you a random colour", - usage: "colour **OR** colour " -}; \ No newline at end of file diff --git a/src/commands/credits.js b/src/commands/credits.js deleted file mode 100644 index 5eb48ce..0000000 --- a/src/commands/credits.js +++ /dev/null @@ -1,20 +0,0 @@ -exports.run = async (client, message, args) => { - message.channel.send( - `__**Credits:**__\n• \`mudkipscience#8904\`, \`FLGX#9896\` and \`TheCakeChicken#9088\` for developing the bot\n• \`An Idiots Guide\` for the Guidebot bot base\n• \`Tina the Cyclops girl#0064\` for helping me not suck at coding\n• \`AirVentTrent\` for the icon, find him on Instagram\n• \`Terryiscool160\` for contributing to Woomy.` - ); -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: [], - permLevel: "User", - requiredPerms: [] -}; - -exports.help = { - name: "credits", - category: "Utility", - description: "Cool people", - usage: "credits" -}; diff --git a/src/commands/creeper.js b/src/commands/creeper.js deleted file mode 100644 index 80ac90b..0000000 --- a/src/commands/creeper.js +++ /dev/null @@ -1,45 +0,0 @@ - -const lyric = require('../../resources/other/lyrics.json') -exports.run = async (client, message, args, level) => { - var lyrics = lyric.creeper; - - var runtop = true; - var runbottom = false; - for(var br = 0; br < lyrics.length; br++) { - { - if (runtop === true) { - var response = await client.awaitReply(message, lyrics[br]); - runbottom = false; - }; - - if (runbottom === true) { - if (response !== lyrics[br]) { - return message.channel.send("Those aren't the lyrics!") - } - runtop = false - }; - } if (runtop === true) { - runtop = false - runbottom = true - } else if (runbottom === true) { - runtop = true - runbottom = false - } - } - message.channel.send("What a lovely duet!") -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: [], - permLevel: "User", - requiredPerms: [] -}; - -exports.help = { - name: "creeper", - category: "Fun", - description: "Aww man", - usage: "creeper" -}; diff --git a/src/commands/cuddle.js b/src/commands/cuddle.js deleted file mode 100644 index 63263ae..0000000 --- a/src/commands/cuddle.js +++ /dev/null @@ -1,69 +0,0 @@ -const API = require('nekos.life'); -const {sfw} = new API(); -exports.run = async (client, message, args) => { - if(!args[0]) { - return message.channel.send(`<:error:466995152976871434> You didn't say who you wanted to cuddle! Usage: \`${client.commands.get(`cuddle`).help.usage}\``) - }; - - var people = ""; - - for (var i = 0; i < args.length; i++) { - var user = client.getUserFromMention(args[i]) - if (user) { - user = message.guild.members.cache.get(user.id).displayName; - } else { - users = client.searchForMembers(message.guild, args[i]); - if (users.length > 1) - return message.channel.send( - "<:error:466995152976871434> Found multiple users for `" + args[i] + "`, Please be more specific or mention the user instead." - ); - else if (users.length == 0) - return message.channel.send( - "<:error:466995152976871434> That user doesn't seem to exist. Try again!" - ); - user = users[0].displayName; - }; - if(i+1 == args.length && args.length > 1) { - people += `**and** ${user}!` - } else if(args.length < 2) { - people += `${user}!`; - } else if(args.length == 2 && i == 0) { - people += `${user} `; - } else { - people += `${user}, `; - }; - }; - - - - message.channel.startTyping(); - try { - sfw.cuddle().then((json) => { - embed = new Discord.MessageEmbed(); - embed.setImage(json.url) - embed.setColor(client.embedColour(message)); - embed.setDescription(`**${message.guild.members.cache.get(message.author.id).displayName}** cuddled **${people}**`) - message.channel.send(embed) - message.channel.stopTyping(); - }); - } catch (err) { - client.logger.error("cuddle.js: " + err); - message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`) - message.channel.stopTyping(); - }; -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: [], - permLevel: "User", - requiredPerms: ["EMBED_LINKS"] -}; - -exports.help = { - name: "cuddle", - category: "Action", - description: "cuddle someone!", - usage: "cuddle [@user/user] (you can cuddle as many people as you want!)" -}; diff --git a/src/commands/dice.js b/src/commands/dice.js deleted file mode 100644 index be9edcf..0000000 --- a/src/commands/dice.js +++ /dev/null @@ -1,27 +0,0 @@ -exports.run = async (bot, message, args) => { - if (args.length === 0) { - message.channel.send(`🎲 You rolled a ${Array.from(Array(6).keys()).random() + 1}!`); - } else { - if (args[0].match(/^\d+$/)) { - message.channel.send(`🎲 You rolled a ${Array.from(Array(parseInt(args[0])).keys()).random() + 1}!`); - } else { - message.channel.send(`🎲 You rolled a ${Array.from(Array(6).keys()).random() + 1}!`); - } - } - }; - - exports.conf = { - enabled: true, - guildOnly: false, - aliases: ["diceroll", "roll"], - permLevel: "User", - requiredPerms: [] - }; - - exports.help = { - name: "dice", - category: "Fun", - description: "Rolls a dice.", - usage: "dice " - }; - diff --git a/src/commands/dog.js b/src/commands/dog.js deleted file mode 100644 index 39ce25c..0000000 --- a/src/commands/dog.js +++ /dev/null @@ -1,30 +0,0 @@ -const API = require('nekos.life'); -const {sfw} = new API(); -exports.run = async (client, message) => { - message.channel.startTyping(); - try { - sfw.woof().then((json) => { - message.channel.send(json.url) - message.channel.stopTyping(); - }); - } catch (err) { - client.logger.error("dog.js: " + err); - message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`) - message.channel.stopTyping(); - }; -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: [], - permLevel: "User", - requiredPerms: ["EMBED_LINKS"] -}; - -exports.help = { - name: "dog", - category: "Image", - description: "Sends you dog pics.", - usage: "dog" -}; diff --git a/src/commands/dogfact.js b/src/commands/dogfact.js deleted file mode 100644 index fca8a62..0000000 --- a/src/commands/dogfact.js +++ /dev/null @@ -1,27 +0,0 @@ -const fetch = require("node-fetch"); -exports.run = async (bot, message, args) => { - message.channel.startTyping(); - try{ - fetch('https://dog-api.kinduff.com/api/facts') - .then(res => res.json()) - .then(json => message.channel.send(`__**Did you know?**__\n ${json.facts[0]}`)); - } catch(err) { - message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`); - }; - message.channel.stopTyping(); -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: ["pupfact"], - permLevel: "User", - requiredPerms: [] - }; - - exports.help = { - name: "dogfact", - category: "Fun", - description: "Sends a fun fact about a doggo.", - usage: "dogfact/pupfact" - }; diff --git a/src/commands/emoji.js b/src/commands/emoji.js deleted file mode 100644 index ab6907b..0000000 --- a/src/commands/emoji.js +++ /dev/null @@ -1,42 +0,0 @@ -exports.run = async (client, message, args) => { - if(!args[0]) { - return message.channel.send(`You need to specify a custom emoji. Usage: \`${client.commands.get(`emoji`).help.usage}\``) - }; - - var ID; - var format = ".png" - var string = args[0].replace(/\D/g,''); - - if(args[0].charAt(1) == "a" && args[0].charAt(2) == ":") { - format = ".gif" - }; - - if(string.length > 18) { - ID = string.slice(string.length - 18); - } else { - ID = string; - }; - - if(!ID) { - return message.channel.send(`<:error:466995152976871434> Invalid emoji. This command only works with custom emojis.`) - }; - - - - message.channel.send("https://cdn.discordapp.com/emojis/" + ID + format) -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: [], - permLevel: "User", - requiredPerms: [] -}; - -exports.help = { - name: "emoji", - category: "Utility", - description: "Enlarges and links an custom emoji", - usage: "emoji [emoji]" -}; diff --git a/src/commands/emojify.js b/src/commands/emojify.js deleted file mode 100644 index 46dfa35..0000000 --- a/src/commands/emojify.js +++ /dev/null @@ -1,56 +0,0 @@ -Discord = require("discord.js"); -exports.run = (client, message, args) => { - if (!args[0]) { - return message.channel.send( - `<:error:466995152976871434> You must include a message for me to emojify! Usage: \`${client.commands.get(`emojify`).help.usage}\`` - ); - }; - const specialChars = { - '0': ':zero:', - '1': ':one:', - '2': ':two:', - '3': ':three:', - '4': ':four:', - '5': ':five:', - '6': ':six:', - '7': ':seven:', - '8': ':eight:', - '9': ':nine:', - '#': ':hash:', - '*': ':asterisk:', - '?': ':grey_question:', - '!': ':grey_exclamation:', - ' ': ' ' - }; - - const emojified = `${args.join(' ')}`.toLowerCase().split('').map(letter => { - if (/[a-z]/g.test(letter)) { - return `:regional_indicator_${letter}: ` - } else if (specialChars[letter]) { - return `${specialChars[letter]} ` - }; - return letter - }).join(''); - - if(emojified.length > 2000) { - return message.channel.send("<:error:466995152976871434> The emojified message exceeds 2000 characters.") - }; - - message.channel.send(emojified); -}; - - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: [], - permLevel: "User", - requiredPerms: [] -}; - -exports.help = { - name: "emojify", - category: "Fun", - description: "Changes text into emojis", - usage: "emojify [message]" -}; diff --git a/src/commands/eval.js b/src/commands/eval.js deleted file mode 100644 index 2fef95f..0000000 --- a/src/commands/eval.js +++ /dev/null @@ -1,46 +0,0 @@ -const hastebin = require('hastebin-gen'); -exports.run = async (client, message, args) => { - const code = args.join(" "); - try { - const evaled = eval(code); - const clean = await client.clean(client, evaled); - - if(clean.length > 2000) { - hastebin(clean, { extension: "txt" }).then(haste => { - return message.channel.send('`OUTPUT`\n' + haste); - }).catch(error => { - client.logger.err(error); - }); - - return; - } - message.channel.send(`\`OUTPUT\` \`\`\`js\n${await clean}\n\`\`\``); - } catch (err) { - const errclean = await client.clean(client, err); - if(errclean.length > 2000) { - hastebin(errclean, { extension: "txt" }).then(haste => { - return message.channel.send('`ERROR`\n' + haste); - }).catch(error => { - client.logger.err(error); - }); - - return; - } - message.channel.send(`\`ERROR\` \`\`\`xl\n${await errclean}\n\`\`\``); - } -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: [], - permLevel: "Developer", - requiredPerms: [] -}; - -exports.help = { - name: "eval", - category: "Owner", - description: "Evaluates arbitrary javascript.", - usage: "eval [code]" -}; diff --git a/src/commands/fact.js b/src/commands/fact.js deleted file mode 100644 index 0e351a6..0000000 --- a/src/commands/fact.js +++ /dev/null @@ -1,30 +0,0 @@ -const API = require('nekos.life'); -const {sfw} = new API(); -exports.run = async (client, message) => { - message.channel.startTyping(); - try { - sfw.fact().then((json) => { - message.channel.send("__**Did you know?**__\n" + json.fact + "."); - message.channel.stopTyping(); - }); - } catch (err) { - client.logger.error("fact.js: " + err); - message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`) - message.channel.stopTyping(); - }; -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: ["randomfact"], - permLevel: "User", - requiredPerms: [] -}; - -exports.help = { - name: "fact", - category: "Fun", - description: "Sends you a random fact.", - usage: "fact" -}; diff --git a/src/commands/feed.js b/src/commands/feed.js deleted file mode 100644 index 9749f45..0000000 --- a/src/commands/feed.js +++ /dev/null @@ -1,69 +0,0 @@ -const API = require('nekos.life'); -const {sfw} = new API(); -exports.run = async (client, message, args) => { - if(!args[0]) { - return message.channel.send(`<:error:466995152976871434> You didn't say who you wanted to feed! Usage: \`${client.commands.get(`feed`).help.usage}\``) - }; - - var people = ""; - - for (var i = 0; i < args.length; i++) { - var user = client.getUserFromMention(args[i]) - if (user) { - user = message.guild.members.cache.get(user.id).displayName; - } else { - users = client.searchForMembers(message.guild, args[i]); - if (users.length > 1) - return message.channel.send( - "<:error:466995152976871434> Found multiple users for `" + args[i] + "`, Please be more specific or mention the user instead." - ); - else if (users.length == 0) - return message.channel.send( - "<:error:466995152976871434> That user doesn't seem to exist. Try again!" - ); - user = users[0].displayName; - }; - if(i+1 == args.length && args.length > 1) { - people += `**and** ${user}!` - } else if(args.length < 2) { - people += `${user}!`; - } else if(args.length == 2 && i == 0) { - people += `${user} `; - } else { - people += `${user}, `; - }; - }; - - - - message.channel.startTyping(); - try { - sfw.feed().then((json) => { - embed = new Discord.MessageEmbed(); - embed.setImage(json.url) - embed.setColor(client.embedColour(message)); - embed.setDescription(`**${message.guild.members.cache.get(message.author.id).displayName}** fed **${people}**`) - message.channel.send(embed) - message.channel.stopTyping(); - }); - } catch (err) { - client.logger.error("feed.js: " + err); - message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`) - message.channel.stopTyping(); - }; -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: [], - permLevel: "User", - requiredPerms: ["EMBED_LINKS"] -}; - -exports.help = { - name: "feed", - category: "Action", - description: "feed someone!", - usage: "feed [@user/user] (you can feed as many people as you want!)" -}; diff --git a/src/commands/feedback.js b/src/commands/feedback.js deleted file mode 100644 index 6b4512b..0000000 --- a/src/commands/feedback.js +++ /dev/null @@ -1,28 +0,0 @@ -exports.run = (client, message, args, level) => { - if(!args[0]) return message.channel.send(`<:error:466995152976871434> You didn't give me any feedback! Usage: \`${client.commands.get(`feedback`).help.usage}\``) - const feedback = args.join(" ") - let guild = client.guilds.cache.get("410990517841690625") - let channel = guild.channels.cache.get("438825830949453824") - let embed = new Discord.MessageEmbed() - .setTitle(`Feedback:`) - .setColor(client.embedColour(message)) - .addField("User:",message.author.tag) - .addField("Feedback: ", feedback) - channel.send({embed: embed}) - message.channel.send("<:success:466995111885144095> Your feedback has been sent to my developer. Thank you!") -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: ["suggest"], - permLevel: "User", - requiredPerms: [] -}; - -exports.help = { - name: "feedback", - category: "Utility", - description: "Send feedback to my developer.", - usage: "feedback [message]" -}; diff --git a/src/commands/forceskip.js b/src/commands/forceskip.js deleted file mode 100644 index 7e341d6..0000000 --- a/src/commands/forceskip.js +++ /dev/null @@ -1,28 +0,0 @@ -exports.run = (client, message) => { - let guild = client.music.getGuild(message.guild.id); - - if(guild.queue.length < 1) return message.channel.send( - `<:error:466995152976871434> There is nothing for me to skip!` - ); - skip_song(guild); - message.channel.send("<:skip:467216735356059660> Skipped the song!") -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: [], - permLevel: "Moderator", - requiredPerms: ["SPEAK"] -}; - -exports.help = { - name: "forceskip", - category: "Music", - description: "Skips the currently playing song without requiring a vote.", - usage: "forceskip" -}; - -function skip_song(guild) { - guild.dispatcher.end(); -} diff --git a/src/commands/foxgirl.js b/src/commands/foxgirl.js deleted file mode 100644 index f3f3312..0000000 --- a/src/commands/foxgirl.js +++ /dev/null @@ -1,30 +0,0 @@ -const API = require('nekos.life'); -const {sfw} = new API(); -exports.run = async (client, message) => { - message.channel.startTyping(); - try { - sfw.foxGirl().then((json) => { - message.channel.send(json.url) - message.channel.stopTyping(); - }); - } catch (err) { - client.logger.error("foxgirl.js: " + err); - message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`) - message.channel.stopTyping(); - }; -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: [], - permLevel: "User", - requiredPerms: ["EMBED_LINKS"] -}; - -exports.help = { - name: "foxgirl", - category: "Image", - description: "Sends you pictures of fox girls.", - usage: "foxgirl" -}; diff --git a/src/commands/garfield.js b/src/commands/garfield.js deleted file mode 100644 index 5376ded..0000000 --- a/src/commands/garfield.js +++ /dev/null @@ -1,21 +0,0 @@ -const garfield = require("garfield"); -exports.run = async (client, message) => { - message.channel.send({ files: [garfield.random()] }).catch(() => message.channel.send( - "<:error:466995152976871434> API didn't respond, try again in a few seconds." - )); -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: [], - permLevel: "User", - requiredPerms: ["ATTACH_FILES"] -}; - -exports.help = { - name: "garfield", - category: "Fun", - description: "Sends you a random garfield comic", - usage: "garfield" -}; diff --git a/src/commands/giverole.js b/src/commands/giverole.js deleted file mode 100644 index f62a055..0000000 --- a/src/commands/giverole.js +++ /dev/null @@ -1,87 +0,0 @@ -exports.run = async (client, message, [member, ...role2add], query) => { - if (!member) { - return message.channel.send( - "<:error:466995152976871434> Who am I meant to give a role?" - ); - } - let user = message.mentions.members.first(); - let users; - if (!user) { - users = client.searchForMembers(message.guild, member); - if (users.length > 1) - return message.channel.send( - "<:error:466995152976871434> Found multiple users! Please be more specific or mention the user instead." - ); - else if (users.length == 0) - return message.channel.send( - "<:error:466995152976871434> That user doesn't seem to exist. Try again!" - ); - user = users[0]; - } - let joinedValue = role2add.join(" "); - - let gRole = client.findRole(joinedValue, message); - - if (!gRole) { - return message.channel.send(`<:error:466995152976871434> That role doesn't seem to exist. Try again!`); - }; - - let moderator = message.guild.member(message.author) - if (gRole.position >= moderator.roles.highest.position) { - return message.channel.send( - "<:error:466995152976871434> You cannot give roles higher than your own!" - ); - } - - var bot = message.guild.members.cache.get(client.user.id) - if (gRole.position >= bot.roles.highest.position) { - return message.channel.send( - `<:error:466995152976871434> I cannot give roles higher than my own!` - ); - } - - if (user.roles.cache.has(gRole.id)) { - return message.channel.send( - "<:error:466995152976871434> They already have that role!" - ); - } - - await user.roles.add(gRole.id); - message.channel.send( - `<:success:466995111885144095> Gave \`${user.user.tag}\` the \`${gRole.name}\` role.` - ); - - if (client.getSettings(message.guild.id).modlogsChannel !== "off") { - const channel = message.guild.channels.cache.find( - channel => channel.name === client.getSettings(message.guild.id).modlogsChannel - ); - - if (channel) { - let embed = new Discord.MessageEmbed(); - embed.setColor("#00c09a"); - embed.setAuthor("Role given:", user.user.avatarURL({format: "png", dynamic: true, size: 2048})); - embed.setDescription(`‏‏‎• User: ${user} (${user.user.id})\n‏‏‎• Mod: ${message.author} (${message.author.id})\n‏‏‎• Role: ${gRole}`) - try { - channel.send({ embed }); - } catch (err) { - // probably no permissions to send messages/embeds there - }; - }; - }; - -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: ["addrole"], - permLevel: "Moderator", - requiredPerms: ["MANAGE_ROLES"] -}; - -exports.help = { - name: "giverole", - category: "Moderation", - description: "Gives the user the specified role.", - usage: "giverole [user] [role]" -}; diff --git a/src/commands/goodbye.js b/src/commands/goodbye.js deleted file mode 100644 index f22d1cf..0000000 --- a/src/commands/goodbye.js +++ /dev/null @@ -1,42 +0,0 @@ -exports.run = async (client, message, args, level) => { - - const settings = message.settings; - if (!client.settings.has(message.guild.id)) client.settings.set(message.guild.id, {}); - - if (args[0]) { - const joinedValue = args.join(" "); - if (joinedValue === settings.welcomeMessage) return message.channel.send( - "<:error:466995152976871434> The leave message is already set to that!" - ); - if (!client.settings.has(message.guild.id)) client.settings.set(message.guild.id, {}); - if (joinedValue === "off") { - if (!client.settings.has(message.guild.id)) client.settings.set(message.guild.id, {}); - client.settings.set(message.guild.id, "off", "leaveMessage"); - return message.channel.send(`<:success:466995111885144095> Leave messages have been disabled.`); - } - client.settings.set(message.guild.id, joinedValue, "leaveMessage"); - client.settings.set(message.guild.id, message.channel.id, "welcomeChannel") - message.channel.send(`<:success:466995111885144095> Set the leave message to \`${joinedValue}\``); - } else { - if (settings.leaveMessage === "off") { - message.channel.send(`Leave messages are off.`) - } else { - message.channel.send(`The current leave message is: \`${settings.leaveMessage}\``) - } - } -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: [], - permLevel: "Administrator", - requiredPerms: [] -}; - -exports.help = { - name: "goodbye", - category: "Configure", - description: "Sets the leave message for this server. try using [[server]], [[user]] and [[members]] in your message!", - usage: "goodbye **OR** goodbye off" -}; diff --git a/src/commands/hackban.js b/src/commands/hackban.js deleted file mode 100644 index ff4d1cb..0000000 --- a/src/commands/hackban.js +++ /dev/null @@ -1,60 +0,0 @@ -exports.run = async (client, message, args) => { - const settings = (message.settings = client.getSettings(message.guild.id)); - - if(!args[0]) { - return message.channel.send( - `<:error:466995152976871434> No user ID provided. Usage: \`${client.commands.get(`hackban`).help.usage}\`` - ); - }; - - user = client.users.cache.get(args[0]) - if(!user) { - return message.channel.send("<:error:466995152976871434> Invalid ID") - } - - if(message.guild.member(args[0])) { - if(!message.guild.member(args[0]).bannable) { - return message.channel.send("<:error:466995152976871434> User is not bannable.") - } - } - - let reason = args.slice(1).join(" "); - if (!reason) reason = `Banned by ${message.author.tag}`; - await message.guild.members.ban(args[0], {reason: reason}).catch(console.error); - message.channel.send(`<:success:466995111885144095> Hackbanned \`${user.tag}\``); - - if (settings.modlogsChannel !== "off") { - const channel = message.guild.channels.cache.find( - channel => channel.name === settings.modlogsChannel - ); - - if (channel) { - let embed = new Discord.MessageEmbed(); - embed.setColor("#BC0057"); - embed.setAuthor("User banned!", user.avatarURL({format: "png", dynamic: true, size: 2048})); - embed.setDescription( - `• User: ${user.tag} (${user.id})\n• Mod: ${message.author} (${message.author.id})\n• Reason: ${reason}` - ); - try { - channel.send(embed); - } catch (err) { - // probably no permissions to send messages/embeds there - }; - } - }; -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: [], - permLevel: "Moderator", - requiredPerms: ["BAN_MEMBERS"] -}; - -exports.help = { - name: "hackban", - category: "Moderation", - description: "Ban users who are not in the server.", - usage: "ban [userID] " -}; diff --git a/src/commands/help.js b/src/commands/help.js deleted file mode 100644 index 5c07963..0000000 --- a/src/commands/help.js +++ /dev/null @@ -1,174 +0,0 @@ -exports.run = (client, message, args, level) => { - embed = new Discord.MessageEmbed(); - embed.setColor(client.embedColour(message)); - - var ran = false; - var output = ""; - var commands = 0; - var prefix; - var currentCategory; - - if(message.guild) { - prefix = message.settings.prefix; - } else { - prefix = client.config.defaultSettings.prefix; - }; - - if(!args[0]) { - embed.setTitle(`Command list`); - embed.setDescription(`⁣For more information on a specific command use \`${prefix}help \`\nFor the full command list use \`${prefix}help all\`\n`); - - const myCommands = message.guild ? client.commands.filter( - cmd => client.levelCache[cmd.conf.permLevel] <= level - ) : client.commands.filter( - cmd => client.levelCache[cmd.conf.permLevel] <= level && cmd.conf.guildOnly !== true - ); - - const commandNames = myCommands.keyArray(); - const longest = commandNames.reduce( - (long, str) => Math.max(long, str.length), - 0 - ); - - const sorted = myCommands.array().sort( - (p, c) => p.help.category > c.help.category ? 1 : p.help.name > c.help.name && p.help.category === c.help.category ? 1 : -1 - ); - - sorted.forEach( c => { - const cat = c.help.category; - if (currentCategory !== cat) { - if(ran == true) { - embed.addField(currentCategory + ` [${commands}]`, output) - output = ""; - commands = 0; - } - currentCategory = cat; - ran = true - } - output += `\`${c.help.name}\` `; - commands = commands + 1; - }); - - embed.addField(currentCategory + ` [${commands}]`, output); - - embed.addField( - "Invite me", - "[Click here](https://discordapp.com/oauth2/authorize?client_id=435961704145485835&permissions=8&scope=bot) to add me to your server", - true - ); - embed.addField( - "Support", - "[Click here](https://discord.gg/HCF8mdv) if bot broke", - true - ); - - message.channel.send(embed); - - return; - }; - - if(args[0].toLowerCase() == "all") { - embed.setTitle(`Command list`); - embed.setDescription(`⁣For more information on a specific command use \`${prefix}help \`\nFor the full command list use \`${prefix}help all\`\n`); - - const myCommands = client.commands - - const commandNames = myCommands.keyArray(); - const longest = commandNames.reduce( - (long, str) => Math.max(long, str.length), - 0 - ); - - const sorted = myCommands.array().sort( - (p, c) => p.help.category > c.help.category ? 1 : p.help.name > c.help.name && p.help.category === c.help.category ? 1 : -1 - ); - - sorted.forEach( c => { - const cat = c.help.category; - if (currentCategory !== cat) { - if(ran == true) { - embed.addField(currentCategory + ` [${commands}]`, output) - output = ""; - commands = 0; - } - currentCategory = cat; - ran = true - } - output += `\`${c.help.name}\` `; - commands = commands + 1; - }); - - - embed.addField(currentCategory + ` [${commands}]`, output); - - embed.addField( - "Invite me", - "[Click here](https://discordapp.com/oauth2/authorize?client_id=435961704145485835&permissions=8&scope=bot) to add me to your server", - true - ); - embed.addField( - "Support", - "[Click here](https://discord.gg/HCF8mdv) if bot broke", - true - ); - - message.channel.send(embed); - - return; - }; - - if(args[0]) { - let command = args.shift().toLowerCase(); - let cmd = client.commands.get(command) || client.commands.get(client.aliases.get(command)); - - if(!client.commands.has(command)) { - return message.channel.send("<:error:466995152976871434> That command doesn't exist!") - }; - - command = client.commands.get(command); - - var requiredPerms = ""; - - if(cmd.conf.requiredPerms.length > 0 ) { - requiredPerms = "`" + cmd.conf.requiredPerms.join("`, `") + "`"; - } else { - requiredPerms = "None"; - }; - - var aliases = ""; - - if(cmd.conf.aliases.length > 0 ) { - aliases = "`" + cmd.conf.aliases.join("`, `") + "`"; - } else { - aliases = "None"; - }; - - - - embed.setTitle(prefix + command.help.name); - embed.setDescription( - `• **Description:** ${command.help.description}\n• **Usage:** ${prefix + command.help.usage}\n• **Permission Level:** ${cmd.conf.permLevel} \n• **Guild Only:** ${cmd.conf.guildOnly}\n• **Aliases:** ${aliases}\n• **Required perms:** ${requiredPerms}` - ); - embed.setFooter("Arguments in [] are required, <> are optional."); - - message.channel.send(embed); - - return; - }; -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: ["h", "cmds"], - permLevel: "User", - requiredPerms: ["EMBED_LINKS"] -}; - -exports.help = { - name: "help", - category: "Utility", - description: - "Displays all the commands you are able to use.", - usage: "help **OR** help all" -}; \ No newline at end of file diff --git a/src/commands/hug.js b/src/commands/hug.js deleted file mode 100644 index 30ef214..0000000 --- a/src/commands/hug.js +++ /dev/null @@ -1,69 +0,0 @@ -const API = require('nekos.life'); -const {sfw} = new API(); -exports.run = async (client, message, args) => { - if(!args[0]) { - return message.channel.send(`<:error:466995152976871434> You didn't say who you wanted to hug! Usage: \`${client.commands.get(`hug`).help.usage}\``) - }; - - var people = ""; - - for (var i = 0; i < args.length; i++) { - var user = client.getUserFromMention(args[i]) - if (user) { - user = message.guild.members.cache.get(user.id).displayName; - } else { - users = client.searchForMembers(message.guild, args[i]); - if (users.length > 1) - return message.channel.send( - "<:error:466995152976871434> Found multiple users for `" + args[i] + "`, Please be more specific or mention the user instead." - ); - else if (users.length == 0) - return message.channel.send( - "<:error:466995152976871434> That user doesn't seem to exist. Try again!" - ); - user = users[0].displayName; - }; - if(i+1 == args.length && args.length > 1) { - people += `**and** ${user}!` - } else if(args.length < 2) { - people += `${user}!`; - } else if(args.length == 2 && i == 0) { - people += `${user} `; - } else { - people += `${user}, `; - }; - }; - - - - message.channel.startTyping(); - try { - sfw.hug().then((json) => { - embed = new Discord.MessageEmbed(); - embed.setImage(json.url) - embed.setColor(client.embedColour(message)); - embed.setDescription(`**${message.guild.members.cache.get(message.author.id).displayName}** hugged **${people}**`) - message.channel.send(embed) - message.channel.stopTyping(); - }); - } catch (err) { - client.logger.error("hug.js: " + err); - message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`) - message.channel.stopTyping(); - }; -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: [], - permLevel: "User", - requiredPerms: ["EMBED_LINKS"] -}; - -exports.help = { - name: "hug", - category: "Action", - description: "Hug someone!", - usage: "hug [@user/user] (you can hug as many people as you want!)" -}; diff --git a/src/commands/identity.js b/src/commands/identity.js deleted file mode 100644 index b7f3809..0000000 --- a/src/commands/identity.js +++ /dev/null @@ -1,36 +0,0 @@ -const identities = require ("../../resources/other/identities.json"); -exports.run = async (client, message, args) => { - var output = ""; - if(!args[0]) { - for (var key of Object.keys(identities)) { - output += `${key}, ` - }; - return message.channel.send(`__**Identities**__\n${output.slice(0, -2)}`); - } else { - if(args.join(" ").toLowerCase() == "attack helicopter" || args.join(" ").toLowerCase() == "apache attack helicopter" || args.join(" ").toLowerCase() == "apache") { - return message.channel.send({ - files: [new Discord.MessageAttachment("./resources/images/attackhelicopter.jpg")] - }); - } - output = identities[args.join(" ").toLowerCase()]; - if(!output) { - return message.channel.send("<:error:466995152976871434> No results for that query."); - }; - return message.channel.send(`__**${output.name.toProperCase()}**__\n${output.description}`); - }; -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: ["identities"], - permLevel: "User", - requiredPerms: [] -}; - -exports.help = { - name: "identity", - category: "Fun", - description: "Gives you information about the specified identity.", - usage: "identity [identity]" -}; diff --git a/src/commands/inspirobot.js b/src/commands/inspirobot.js deleted file mode 100644 index 17a028f..0000000 --- a/src/commands/inspirobot.js +++ /dev/null @@ -1,28 +0,0 @@ -const fetch = require("node-fetch") -exports.run = async (client, message) => { - message.channel.startTyping(); - try { - fetch('http://inspirobot.me/api?generate=true') - .then(res => res.text()) - .then(body => message.channel.send({files: [new Discord.MessageAttachment(body)]})); - message.channel.stopTyping(); - } catch (err) { - message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`) - message.channel.stopTyping(); - }; -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: ["inspire"], - permLevel: "User", - requiredPerms: [] -}; - -exports.help = { - name: "inspirobot", - category: "Fun", - description: "Returns an inspirational message generated by inspirobot.", - usage: "inspirobot" -}; diff --git a/src/commands/invite.js b/src/commands/invite.js deleted file mode 100644 index 49cdc86..0000000 --- a/src/commands/invite.js +++ /dev/null @@ -1,20 +0,0 @@ -exports.run = async (client, message) => { - message.channel.send( - `Use this link to invite me to your server:\n` - ); -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: [], - permLevel: "User", - requiredPerms: [] -}; - -exports.help = { - name: "invite", - category: "Utility", - description: "Sends you a link so you can add Woomy to your own servers", - usage: "invite" -}; diff --git a/src/commands/kemonomimi.js b/src/commands/kemonomimi.js deleted file mode 100644 index 3c4b70e..0000000 --- a/src/commands/kemonomimi.js +++ /dev/null @@ -1,30 +0,0 @@ -const API = require('nekos.life'); -const {sfw} = new API(); -exports.run = async (client, message) => { - message.channel.startTyping(); - try { - sfw.kemonomimi().then((json) => { - message.channel.send(json.url) - message.channel.stopTyping(); - }); - } catch (err) { - client.logger.error("kemonomimi.js: " + err); - message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`) - message.channel.stopTyping(); - }; -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: [], - permLevel: "User", - requiredPerms: ["EMBED_LINKS"] -}; - -exports.help = { - name: "kemonomimi", - category: "Image", - description: "Sends you pictures of people with animal characteristics.", - usage: "kemonomimi" -}; diff --git a/src/commands/kick.js b/src/commands/kick.js deleted file mode 100644 index 9070a98..0000000 --- a/src/commands/kick.js +++ /dev/null @@ -1,87 +0,0 @@ -exports.run = async (client, message, args) => { - const settings = client.getSettings(message.guild.id); - - if(!args[0]) { - return message.channel.send("<:error:466995152976871434> Who am I meant to kick?") - } - - let user = message.mentions.members.first(); - - if (!user) { - let users; - users = client.searchForMembers(message.guild, args[0]); - if (users.length > 1) - return message.channel.send( - "<:error:466995152976871434> Found multiple users! Please be more specific or mention the user instead." - ); - else if (users.length == 0) - return message.channel.send( - "<:error:466995152976871434> That user doesn't seem to exist. Try again!" - ); - user = users[0]; - } -if (user.user.id === client.user.id) { - return message.channel.send("lol no") -} -if (user.user.id === message.guild.owner.id) { - return message.channel.send("<:error:466995152976871434> You can't kick the owner!") -} -let moderator = message.guild.member(message.author) -if (user.roles.highest.position >= moderator.roles.highest.position && moderator.user.id !== message.guild.ownerID) { - return message.channel.send( - `<:error:466995152976871434> You can't kick people higher ranked than yourself!` - ); -} - -let bot = message.guild.member(client.user) -if (user.roles.highest.position >= bot.roles.highest.position) { - return message.channel.send( - `<:error:466995152976871434> I can't kick people who are higher ranked than me!` - ); -} - -if (!user.bannable) - return message.channel.send( - "<:error:466995152976871434> Specified user is not bannable." - ); - -let reason = args.slice(1).join(" "); -if (!reason) reason = `Kicked by ${message.author.tag}`; -await user.kick(reason).catch(console.error); -message.channel.send(`<:success:466995111885144095> Kicked \`${user.user.tag}\``); - -if (settings.modlogsChannel !== "off") { - const channel = message.guild.channels.cache.find( - channel => channel.name === settings.modlogsChannel - ); - - if (channel) { - let embed = new Discord.MessageEmbed(); - embed.setColor("#fd0061"); - embed.setAuthor("User kicked!", user.user.avatarURL({format: "png", dynamic: true, size: 2048})); - embed.setDescription( - `• User: ${user.user.tag} (${user.user.id})\n• Mod: ${message.author} (${message.author.id})\n• Reason: ${reason}` - ); - try { - channel.send({ embed }); - } catch (err) { - // probably no permissions to send messages/embeds there - }; - }; -}; -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: [], - permLevel: "Moderator", - requiredPerms: ["KICK_MEMBERS"] -}; - -exports.help = { - name: "kick", - category: "Moderation", - description: "Kicks specified user.", - usage: "kick [user] " -}; diff --git a/src/commands/kiss.js b/src/commands/kiss.js deleted file mode 100644 index 495ee62..0000000 --- a/src/commands/kiss.js +++ /dev/null @@ -1,69 +0,0 @@ -const API = require('nekos.life'); -const {sfw} = new API(); -exports.run = async (client, message, args) => { - if(!args[0]) { - return message.channel.send(`<:error:466995152976871434> You didn't say who you wanted to kiss! Usage: \`${client.commands.get(`kiss`).help.usage}\``) - }; - - var people = ""; - - for (var i = 0; i < args.length; i++) { - var user = client.getUserFromMention(args[i]) - if (user) { - user = message.guild.members.cache.get(user.id).displayName; - } else { - users = client.searchForMembers(message.guild, args[i]); - if (users.length > 1) - return message.channel.send( - "<:error:466995152976871434> Found multiple users for `" + args[i] + "`, Please be more specific or mention the user instead." - ); - else if (users.length == 0) - return message.channel.send( - "<:error:466995152976871434> That user doesn't seem to exist. Try again!" - ); - user = users[0].displayName; - }; - if(i+1 == args.length && args.length > 1) { - people += `**and** ${user}!` - } else if(args.length < 2) { - people += `${user}!`; - } else if(args.length == 2 && i == 0) { - people += `${user} `; - } else { - people += `${user}, `; - }; - }; - - - - message.channel.startTyping(); - try { - sfw.kiss().then((json) => { - embed = new Discord.MessageEmbed(); - embed.setImage(json.url) - embed.setColor(client.embedColour(message)); - embed.setDescription(`**${message.guild.members.cache.get(message.author.id).displayName}** kissed **${people}**`) - message.channel.send(embed) - message.channel.stopTyping(); - }); - } catch (err) { - client.logger.error("kiss.js: " + err); - message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`) - message.channel.stopTyping(); - }; -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: [], - permLevel: "User", - requiredPerms: ["EMBED_LINKS"] -}; - -exports.help = { - name: "kiss", - category: "Action", - description: "Kiss someone!", - usage: "kiss [@user/user] (you can kiss as many people as you want!)" -}; diff --git a/src/commands/lizard.js b/src/commands/lizard.js deleted file mode 100644 index f476704..0000000 --- a/src/commands/lizard.js +++ /dev/null @@ -1,30 +0,0 @@ -const API = require('nekos.life'); -const {sfw} = new API(); -exports.run = async (client, message) => { - message.channel.startTyping(); - try { - sfw.lizard().then((json) => { - message.channel.send(json.url) - message.channel.stopTyping(); - }); - } catch (err) { - client.logger.error("lizard.js: " + err); - message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`) - message.channel.stopTyping(); - }; -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: [], - permLevel: "User", - requiredPerms: ["EMBED_LINKS"] -}; - -exports.help = { - name: "lizard", - category: "Image", - description: "Sends pictures of lizards.", - usage: "lizard" -}; diff --git a/src/commands/modlogs.js b/src/commands/modlogs.js deleted file mode 100644 index 3c0c2c0..0000000 --- a/src/commands/modlogs.js +++ /dev/null @@ -1,28 +0,0 @@ -exports.run = async (client, message) => { - const settings = message.settings; - - if (!client.settings.has(message.guild.id)) client.settings.set(message.guild.id, {}); - - if (message.channel.name !== settings.modlogsChannel) { - client.settings.set(message.guild.id, message.channel.name, "modlogsChannel") - message.channel.send(`<:success:466995111885144095> Mod logs will now be displayed in \`${message.channel.name}\``); - } else { - client.settings.set(message.guild.id, "off", "modlogsChannel") - message.channel.send(`<:success:466995111885144095> Mod logging disabled.`); - } -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: [], - permLevel: "Administrator", - requiredPerms: [] -}; - -exports.help = { - name: "modlogs", - category: "Configure", - description: "Enables mod action logging in your server.", - usage: "modlogs **OR** modlogs off" -}; diff --git a/src/commands/modrole.js b/src/commands/modrole.js deleted file mode 100644 index 817d89a..0000000 --- a/src/commands/modrole.js +++ /dev/null @@ -1,61 +0,0 @@ -exports.run = async (client, message, args) => { - - const settings = message.settings; - - if (!client.settings.has(message.guild.id)) { - client.settings.set(message.guild.id, {}); - } - - var modRole = message.guild.roles.cache.get(settings.modRole) - - if (!args[0]) { - if(!modRole) { - return message.channel.send( - "<:error:466995152976871434> There is no mod role set for this server. Please set one using `" + message.settings.prefix + "modrole `" - ) - } else { - message.channel.send(`The current mod role is: \`${modRole.name}\``) - } - - } else { - const joinedValue = args.join(" "); - if (joinedValue.length < 1) { - return message.channel.send( - `<:error:466995152976871434> You didn't specify a role. Usage: \`${client.commands.get(`modrole`).help.usage}\`` - ); - }; - - if (settings.modRole != "None set" && joinedValue === modRole.name) { - return message.channel.send( - "<:error:466995152976871434> The mod role is already set to that!" - ); - }; - - let role = client.findRole(joinedValue, message); - - if (!role) { - return message.channel.send(`<:error:466995152976871434> That role doesn't seem to exist. Try again!`); - }; - - client.settings.set(message.guild.id, role.id, "modRole"); - - message.channel.send( - `<:success:466995111885144095> The mod role has been set to \`${role.name}\` - `); - }; -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: [], - permLevel: "Administrator", - requiredPerms: [] -}; - -exports.help = { - name: "modrole", - category: "Configure", - description: "Sets the mod role for this server.", - usage: "modrole " -}; \ No newline at end of file diff --git a/src/commands/msearch.js b/src/commands/msearch.js deleted file mode 100644 index 876da31..0000000 --- a/src/commands/msearch.js +++ /dev/null @@ -1,39 +0,0 @@ -exports.run = (client, message, args) => { - if (!args[0]) - return message.channel.send( - `<:error:466995152976871434> No username provided. Usage: \`${client.commands.get(``).help.usage}\`` - ); - var mlist = ""; - var count = 0; - client.searchForMembers(message.guild, args[0]).forEach((member) => { - if (member) { - mlist += `\`${member.user.tag}\``; - count = count + 1; - } - mlist += "**, **"; - }); - mlist = mlist.substring(0, mlist.length - 6); - - var mlist1 = `Found ${count} users:\n` + mlist; - - if (!mlist1) { - return message.channel.send("<:error:466995152976871434> No users found!"); - } - - message.channel.send(mlist1); -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: [], - permLevel: "User", - requiredPerms: [] -}; - -exports.help = { - name: "msearch", - category: "Utility", - description: "Search for server members.", - usage: "msearch [user]" -}; \ No newline at end of file diff --git a/src/commands/mute.js b/src/commands/mute.js deleted file mode 100644 index a52e7c5..0000000 --- a/src/commands/mute.js +++ /dev/null @@ -1,114 +0,0 @@ -exports.run = async (client, message, [args, ...reason], level) => { - const settings = message.settings; - - if(!args) { - return message.channel.send("<:error:466995152976871434> Who am I meant to mute?") - } - let user = message.mentions.members.first(); - let users; - if (!user) { - users = client.searchForMembers(message.guild, args); - if (users.length > 1) - return message.channel.send( - "<:error:466995152976871434> Found multiple users! Please be more specific or mention the user instead." - ); - else if (users.length == 0) - return message.channel.send( - "<:error:466995152976871434> That user doesn't seem to exist. Try again!" - ); - user = users[0]; - }; - - if (user.user.id === message.guild.ownerID) { - return message.channel.send("<:error:466995152976871434> You can't mute the owner!") - }; - - let moderator = message.guild.member(message.author) - if (message.settings.mutedRole.position >= moderator.roles.highest.position && level < 2) { - return message.channel.send( - "<:error:466995152976871434> The muted role is positioned above the moderator role! Please move the muted role below the moderator role." - ); - }; - if (user.roles.highest.position >= moderator.roles.highest.position && moderator.user.id !== message.guild.ownerID) { - return message.channel.send( - `<:error:466995152976871434> You can't mute people who have a higher role than you!` - ); - }; - - let bot = message.guild.member(client.user) - - if (user.roles.highest.position >= bot.roles.highest.position) { - return message.channel.send( - `<:error:466995152976871434> I can't mute people who have a higher role than me!` - ); - } - - var role = message.guild.roles.cache.get(settings.mutedRole); - - if (!role) { - return message.channel.send( - "<:error:466995152976871434> There is no muted role set for this server. Please set one using `" + message.settings.prefix + "mutedrole ` before using this command." - ); - }; - - if (bot.roles.highest.position <= role.position) { - return message.channel.send( - "<:error:466995152976871434> The muted role is above my highest role! Please move the muted role below my highest role." - ); - }; - - message.guild.channels.cache.forEach(async (channel, id) => { - await channel.updateOverwrite(role, { - SEND_MESSAGES: false, - ADD_REACTIONS: false - }); - }); - - if (user.roles.cache.has(role.id)) { - return message.channel.send("<:error:466995152976871434> They're already muted!") - } - - await user.roles.add(role.id); - message.channel.send(`<:success:466995111885144095> Muted \`${user.user.tag}\``) - - var muteReason = reason.join(" "); - - if(muteReason.length == 0) { - muteReason = "**No reason provided.**" - } - - if (settings.modlogsChannel !== "off") { - const channel = message.guild.channels.cache.find( - channel => channel.name === settings.modlogsChannel - ); - - if (channel) { - let embed = new Discord.MessageEmbed(); - embed.setColor("#a652bb"); - embed.setAuthor("User muted!", user.user.avatarURL({format: "png", dynamic: true, size: 2048})); - embed.setDescription( - `• User: ${user} (${user.user.id})\n• Mod: ${message.author} (${message.author.id})\n• Reason: ${muteReason}` - ); - try { - channel.send(embed); - } catch (err) { - // probably no permissions to send messages/embeds there - } - } - } -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: [], - permLevel: "Moderator", - requiredPerms: ["MANAGE_ROLES", "MANAGE_CHANNELS"] -}; - -exports.help = { - name: "mute", - category: "Moderation", - description: "Prevents the specified user from typing.", - usage: "mute [member] " -}; diff --git a/src/commands/mutedrole.js b/src/commands/mutedrole.js deleted file mode 100644 index 1757efd..0000000 --- a/src/commands/mutedrole.js +++ /dev/null @@ -1,61 +0,0 @@ -exports.run = async (client, message, args) => { - - const settings = message.settings; - - if (!client.settings.has(message.guild.id)) { - client.settings.set(message.guild.id, {}); - } - - var mutedRole = message.guild.roles.cache.get(settings.mutedRole) - - if (!args[0]) { - if(!mutedRole) { - return message.channel.send( - "<:error:466995152976871434> There is no muted role set for this server. Please set one using `" + message.settings.prefix + "mutedrole `" - ) - } else { - message.channel.send(`The current muted role is: \`${mutedRole.name}\``) - } - - } else { - const joinedValue = args.join(" "); - if (joinedValue.length < 1) { - return message.channel.send( - `<:error:466995152976871434> You didn't specify a role. Usage: \`${client.commands.get(`mutedrole`).help.usage}\`` - ); - }; - - if (settings.mutedRole != "None set" && joinedValue === mutedRole.name) { - return message.channel.send( - "<:error:466995152976871434> The muted role is already set to that!" - ); - }; - - let role = client.findRole(joinedValue, message); - - if (!role) { - return message.channel.send(`<:error:466995152976871434> That role doesn't seem to exist. Try again!`); - }; - - client.settings.set(message.guild.id, role.id, "mutedRole"); - - message.channel.send( - `<:success:466995111885144095> The muted role has been set to \`${role.name}\` - `); - }; -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: [], - permLevel: "Administrator", - requiredPerms: [] -}; - -exports.help = { - name: "mutedrole", - category: "Configure", - description: "Sets the muted role for this server.", - usage: "mutedrole [role]" -}; diff --git a/src/commands/neko.js b/src/commands/neko.js deleted file mode 100644 index 7ce0d6b..0000000 --- a/src/commands/neko.js +++ /dev/null @@ -1,30 +0,0 @@ -const API = require('nekos.life'); -const {sfw} = new API(); -exports.run = async (client, message) => { - message.channel.startTyping(); - try { - sfw.neko().then((json) => { - message.channel.send(json.url); - message.channel.stopTyping(); - }); - } catch (err) { - client.logger.error("neko.js: " + err); - message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`) - message.channel.stopTyping(); - }; -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: ["catgirl"], - permLevel: "User", - requiredPerms: ["EMBED_LINKS"] -}; - -exports.help = { - name: "neko", - category: "Image", - description: "Sends you pictures of catgirls.", - usage: "neko" -}; diff --git a/src/commands/nekogif.js b/src/commands/nekogif.js deleted file mode 100644 index 0df6917..0000000 --- a/src/commands/nekogif.js +++ /dev/null @@ -1,30 +0,0 @@ -const API = require('nekos.life'); -const {sfw} = new API(); -exports.run = async (client, message) => { - message.channel.startTyping(); - try { - sfw.nekoGif().then((json) => { - message.channel.send(json.url); - message.channel.stopTyping(); - }); - } catch (err) { - client.logger.error("nekogif.js: " + err); - message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`) - message.channel.stopTyping(); - }; -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: ["catgirlgif"], - permLevel: "User", - requiredPerms: ["EMBED_LINKS"] -}; - -exports.help = { - name: "nekogif", - category: "Image", - description: "Sends you gifs of catgirls.", - usage: "nekogif" -}; diff --git a/src/commands/nowplaying.js b/src/commands/nowplaying.js deleted file mode 100644 index e94f71a..0000000 --- a/src/commands/nowplaying.js +++ /dev/null @@ -1,44 +0,0 @@ -const Discord = require("discord.js"); -exports.run = async (client, message) => { - let guild = client.music.getGuild(message.guild.id); - - if(guild.queue.length < 1) { - return message.channel.send("<:error:466995152976871434> Nothing is playing."); - } - - var song = guild.queue[0]; - var elapsedTime = client.createTimestamp(guild.dispatcher.streamTime / 1000); - var timestamp; - - if(song.duration == 0) { - timestamp = "`[LIVE]`"; - } else { - timestamp = `\`[${elapsedTime + "/" + client.createTimestamp(song.duration)}]\``; - }; - - embed = new Discord.MessageEmbed(); - embed.setTitle("Now playing:") - embed.setThumbnail(song.thumbnail) - embed.setColor(client.embedColour(message)); - embed.setDescription(`**[${song.title}](https://www.youtube.com/watch?v=${song.id})**`) - embed.addField("Channel:", song.author, true) - embed.addField("Time:", timestamp, true) - embed.setFooter("Requested by " + song.requestedBy.tag, song.requestedBy.avatarURL({format: "png", dynamic: true, size: 2048})) - - message.channel.send(embed) -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: ["np"], - permLevel: "User", - requiredPerms: ["EMBED_LINKS"] -}; - -exports.help = { - name: "nowplaying", - category: "Music", - description: "Shows details about the currently playing song.", - usage: "nowplaying" -}; diff --git a/src/commands/owoify.js b/src/commands/owoify.js deleted file mode 100644 index 9587a6f..0000000 --- a/src/commands/owoify.js +++ /dev/null @@ -1,35 +0,0 @@ -// totally not stolen from https://github.com/GmdDjca/Hitomi-Manaka -exports.run = (client, message, args) => { - if (!args[0]) { - return message.channel.send(`<:error:466995152976871434> pwease incwude some text fow me to owoify UwU`) - } - const faces = ['(・`ω´・)', 'x3', 'owo', 'UwU', '>w<', '^w^'] - owoified = `${args.join(' ')}`.replace(/(?:r|l)/g, 'w') - owoified = owoified.replace(/(?:R|L)/g, 'W') - owoified = owoified.replace(/n([aeiou])/g, 'ny$1') - owoified = owoified.replace(/N([aeiou])/g, 'Ny$1') - owoified = owoified.replace(/N([AEIOU])/g, 'Ny$1') - owoified = owoified.replace(/ove/g, 'uv') - owoified = owoified.replace(/!+/g, ' ' + faces[~~(Math.random() * faces.length)] + ' ') - - if(owoified.length > 2000) { - owoified = owoified.slice(0, -Math.abs(owoified.length - 2000)) - }; - -message.channel.send(owoified) -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: [], - permLevel: "User", - requiredPerms: [] -}; - -exports.help = { - name: "owoify", - category: "Fun", - description: "Makes nyowmal tewxt owo'ed x3", - usage: "owoify [message]" -}; diff --git a/src/commands/pat.js b/src/commands/pat.js deleted file mode 100644 index fee469b..0000000 --- a/src/commands/pat.js +++ /dev/null @@ -1,69 +0,0 @@ -const API = require('nekos.life'); -const {sfw} = new API(); -exports.run = async (client, message, args) => { - if(!args[0]) { - return message.channel.send(`<:error:466995152976871434> You didn't say who you wanted to pat! Usage: \`${client.commands.get(`pat`).help.usage}\``) - }; - - var people = ""; - - for (var i = 0; i < args.length; i++) { - var user = client.getUserFromMention(args[i]) - if (user) { - user = message.guild.members.cache.get(user.id).displayName; - } else { - users = client.searchForMembers(message.guild, args[i]); - if (users.length > 1) - return message.channel.send( - "<:error:466995152976871434> Found multiple users for `" + args[i] + "`, Please be more specific or mention the user instead." - ); - else if (users.length == 0) - return message.channel.send( - "<:error:466995152976871434> That user doesn't seem to exist. Try again!" - ); - user = users[0].displayName; - }; - if(i+1 == args.length && args.length > 1) { - people += `**and** ${user}!` - } else if(args.length < 2) { - people += `${user}!`; - } else if(args.length == 2 && i == 0) { - people += `${user} `; - } else { - people += `${user}, `; - }; - }; - - - - message.channel.startTyping(); - try { - sfw.pat().then((json) => { - embed = new Discord.MessageEmbed(); - embed.setImage(json.url) - embed.setColor(client.embedColour(message)); - embed.setDescription(`**${message.guild.members.cache.get(message.author.id).displayName}** patted **${people}**`) - message.channel.send(embed) - message.channel.stopTyping(); - }); - } catch (err) { - client.logger.error("pat.js: " + err); - message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`) - message.channel.stopTyping(); - }; -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: ["headpat"], - permLevel: "User", - requiredPerms: ["EMBED_LINKS"] -}; - -exports.help = { - name: "pat", - category: "Action", - description: "pat someone!", - usage: "pat [@user/user] (you can pat as many people as you want!)" -}; diff --git a/src/commands/pause.js b/src/commands/pause.js deleted file mode 100644 index 2816baf..0000000 --- a/src/commands/pause.js +++ /dev/null @@ -1,30 +0,0 @@ -exports.run = (client, message, args, level) => { - let guild = client.music.getGuild(message.guild.id); - if(guild.queue.length < 1) { - return message.channel.send("<:error:466995152976871434> Nothing is playing."); - }; - - guild.playing = false; - guild.paused = true; - guild.dispatcher.pause(); - message.channel.send("<:pause:467639357961142273> Playback paused!"); - - -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: [], - permLevel: "Moderator", - requiredPerms: ["CONNECT", "SPEAK"] -}; - -exports.help = { - name: "pause", - category: "Music", - description: "Pauses music playback.", - usage: "pause" -}; - - diff --git a/src/commands/permlevel.js b/src/commands/permlevel.js deleted file mode 100644 index 5d41034..0000000 --- a/src/commands/permlevel.js +++ /dev/null @@ -1,19 +0,0 @@ -exports.run = async (client, message, args, level) => { - const friendly = client.config.permLevels.find(l => l.level === level).name; - message.reply(`Your permission level is: ${level} - ${friendly}`); -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: ["plevel"], - permLevel: "User", - requiredPerms: [] -}; - -exports.help = { - name: "permlevel", - category: "Utility", - description: "Tells you your permission level for that server.", - usage: "permlevel" -}; diff --git a/src/commands/ping.js b/src/commands/ping.js deleted file mode 100644 index 6f6d674..0000000 --- a/src/commands/ping.js +++ /dev/null @@ -1,21 +0,0 @@ -exports.run = async (client, message) => { - const msg = await message.channel.send("⏱️ Please wait..."); - msg.edit( - `:ping_pong: Pong! Latency is ${msg.createdTimestamp - message.createdTimestamp}ms, API Latency is ${Math.round(client.ws.ping)}ms` - ); -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: [], - permLevel: "User", - requiredPerms: [] -}; - -exports.help = { - name: "ping", - category: "Utility", - description: "Displays bot latency in miliseconds.", - usage: "ping" -}; diff --git a/src/commands/play.js b/src/commands/play.js deleted file mode 100644 index d9c8866..0000000 --- a/src/commands/play.js +++ /dev/null @@ -1,33 +0,0 @@ -const util = require("util") -const Discord = require("discord.js") - -module.exports.run = (client, message, args, level) =>{ - if(!args[0]) - { - message.channel.send(`<:error:466995152976871434> You didn't give me a song to play! Usage: \`${client.commands.get(`play`).help.usage}\``); - - return; - } - - let voiceChannel = message.member.voice.channel; - if(!voiceChannel) return message.channel.send('<:error:466995152976871434> You need to be in a voice channel to use this command!'); - - message.channel.send(`🔎 searching YouTube for \`${args.join(" ")}\``); - - client.music.play(message, args.join(" ")); -} - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: ["p"], - permLevel: "User", - requiredPerms: ["CONNECT", "SPEAK"] -}; - -exports.help = { - name: "play", - category: "Music", - description: "Plays a song.", - usage: "play [youtube-url] **OR** play [song-name]" -}; diff --git a/src/commands/poke.js b/src/commands/poke.js deleted file mode 100644 index 07c48bc..0000000 --- a/src/commands/poke.js +++ /dev/null @@ -1,69 +0,0 @@ -const API = require('nekos.life'); -const {sfw} = new API(); -exports.run = async (client, message, args) => { - if(!args[0]) { - return message.channel.send(`<:error:466995152976871434> You didn't say who you wanted to poke! Usage: \`${client.commands.get(`poke`).help.usage}\``) - }; - - var people = ""; - - for (var i = 0; i < args.length; i++) { - var user = client.getUserFromMention(args[i]) - if (user) { - user = message.guild.members.cache.get(user.id).displayName; - } else { - users = client.searchForMembers(message.guild, args[i]); - if (users.length > 1) - return message.channel.send( - "<:error:466995152976871434> Found multiple users for `" + args[i] + "`, Please be more specific or mention the user instead." - ); - else if (users.length == 0) - return message.channel.send( - "<:error:466995152976871434> That user doesn't seem to exist. Try again!" - ); - user = users[0].displayName; - }; - if(i+1 == args.length && args.length > 1) { - people += `**and** ${user}!` - } else if(args.length < 2) { - people += `${user}!`; - } else if(args.length == 2 && i == 0) { - people += `${user} `; - } else { - people += `${user}, `; - }; - }; - - - - message.channel.startTyping(); - try { - sfw.poke().then((json) => { - embed = new Discord.MessageEmbed(); - embed.setImage(json.url) - embed.setColor(client.embedColour(message)); - embed.setDescription(`**${message.guild.members.cache.get(message.author.id).displayName}** poked **${people}**`) - message.channel.send(embed) - message.channel.stopTyping(); - }); - } catch (err) { - client.logger.error("poke.js: " + err); - message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`) - message.channel.stopTyping(); - }; -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: [], - permLevel: "User", - requiredPerms: ["EMBED_LINKS"] -}; - -exports.help = { - name: "poke", - category: "Action", - description: "poke someone!", - usage: "poke [@user/user] (you can poke as many people as you want!)" -}; diff --git a/src/commands/prefix.js b/src/commands/prefix.js deleted file mode 100644 index 1d72e74..0000000 --- a/src/commands/prefix.js +++ /dev/null @@ -1,30 +0,0 @@ -exports.run = async (client, message, args) => { - const settings = message.settings; - - if (!client.settings.has(message.guild.id)) client.settings.set(message.guild.id, {}); - - if (args[0]) { - const joinedValue = args.join(" "); - if (joinedValue === settings.prefix) return message.channel.send("<:error:466995152976871434> The prefix is already set to that!"); - if (!client.settings.has(message.guild.id)) client.settings.set(message.guild.id, {}); - client.settings.set(message.guild.id, joinedValue, "prefix"); - message.channel.send(`<:success:466995111885144095> Set the prefix to \`${joinedValue}\``); - } else { - message.channel.send(`The current prefix is: \`${settings.prefix}\``) - } -} - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: [], - permLevel: "Administrator", - requiredPerms: [] -}; - -exports.help = { - name: "prefix", - category: "Configure", - description: "Sets the prefix for this server.", - usage: "prefix [prefix]" -}; diff --git a/src/commands/pronoun.js b/src/commands/pronoun.js deleted file mode 100644 index 0d4b36a..0000000 --- a/src/commands/pronoun.js +++ /dev/null @@ -1,36 +0,0 @@ -const pronouns = require ("../../resources/other/pronouns.json"); -exports.run = async (client, message, args) => { - var output = ""; - if(!args[0]) { - for (var key of Object.keys(pronouns)) { - output += `${key}, ` - }; - return message.channel.send(`__**Pronouns:**__\n${output.slice(0, -2)}`); - } else { - if(args.join(" ").toLowerCase() == "attack helicopter" || args.join(" ").toLowerCase() == "apache attack helicopter" || args.join(" ").toLowerCase() == "apache") { - return message.channel.send({ - files: [new Discord.MessageAttachment("./resources/images/attackhelicopter.jpg")] - }); - }; - output = pronouns[args.join(" ").toLowerCase()]; - if(!output) { - return message.channel.send("<:error:466995152976871434> No results for that query."); - }; - return message.channel.send(`__**Example sentences using ${output.name}:**__\n${output.examples}`); - }; -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: ["pronouns"], - permLevel: "User", - requiredPerms: [] -}; - -exports.help = { - name: "pronoun", - category: "Fun", - description: "Gives you information on how to use the specified pronoun.", - usage: "pronoun [pronoun]" -}; diff --git a/src/commands/purge.js b/src/commands/purge.js deleted file mode 100644 index 79cf320..0000000 --- a/src/commands/purge.js +++ /dev/null @@ -1,60 +0,0 @@ -exports.run = async (client, message, args, level) => { - const settings = message.settings; - - if(message.channel.name === settings.chatlogsChannel) { - return message.channel.send("<:error:466995152976871434> Can't purge logs.") - } - - if(message.channel.name === settings.modlogsChannel) { - return message.channel.send("<:error:466995152976871434> Can't purge logs.") - } - const amount = !!parseInt(message.content.split(' ')[1]) ? parseInt(message.content.split(' ')[1]) : parseInt(message.content.split(' ')[2]) - if(amount > 100) { - return message.channel.send("<:error:466995152976871434> Can only purge a maximum of 100 messages!") - } - - if (!amount) return message.channel.send( - '<:error:466995152976871434> You didn\'t tell me how many messages to purge. Usage: \`' + client.commands.get(`purge`).help.usage + "`" - ); - - await message.delete().catch(O_o => {}); - - message.channel.messages.fetch({ - limit: amount, - }).then((messages) => { - message.channel.bulkDelete(messages, true).catch(console.error); - message.channel.send(`<:success:466995111885144095> Purged ${amount} messages!`).then(m => m.delete({timeout: 5000})); - }); - - if (settings.modlogsChannel !== "off") { - const channel = message.guild.channels.cache.find( - channel => channel.name === settings.modlogsChannel - ); - - if (channel) { - let embed = new Discord.MessageEmbed(); - embed.setColor("#a62019"); - embed.setAuthor(`${amount} messages purged!`, message.author.avatarURL({format: "png", dynamic: true, size: 2048})); - embed.setDescription(`• Channel: ${message.channel.name} (${message.channel.id})\n• Mod: ${message.author} (${message.author.id})\n• Amount: \`${amount}\``) - try { - channel.send({ embed }); - } catch (err) { - }; - }; - }; -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: [], - permLevel: "Moderator", - requiredPerms: ["MANAGE_MESSAGES"] -}; - -exports.help = { - name: "purge", - category: "Moderation", - description: "Bulk deletes messages. **cannot delete messages older than 14 days.**", - usage: "purge [amount]" -}; diff --git a/src/commands/queue.js b/src/commands/queue.js deleted file mode 100644 index 0bdc87e..0000000 --- a/src/commands/queue.js +++ /dev/null @@ -1,183 +0,0 @@ -'use strict'; - -const Discord = require("discord.js"); -exports.run = (client, message, args) => { - var queue = client.music.getGuild(message.guild.id).queue; - - if(queue.length < 1) { - return message.channel.send("<:error:466995152976871434> Nothing is playing."); - } - - let lists = []; - - function generateList(start, number) { - var list = ""; - var timestamp; - var livestream; - - if(start == 1 && queue.length == 1) { - return ["There's nothing else waiting to be played!", 1]; - } - - if(number == 1 && queue.length + 1 < start) { - return false; - }; - - let q = queue.slice(start); - - let i = 0; - - for(i = 0; i < q.length; i++) { - let song = q[i]; - - if(song.duration == 0) { - timestamp = "LIVE"; - livestream = true; - } else { - timestamp = client.createTimestamp(song.duration); - }; - - let aaa = list + `\`${(i + 1) + start - 1}:\` **[${song.title}](https://www.youtube.com/watch?v=${song.id})** added by ${song.requestedBy} \`[${timestamp}]\`\n`; - - if(aaa.length > 1024) { - return [list, start + i - 1]; - } else { - list = aaa; - } - - //totalDuration = totalDuration + song.duration; - }; - - return [list, start + i + 1]; - }; - - let songsInQueue = queue.length - 1; - let songsInQueueEnglish = "song"; - let timeRemaining = 0; - - function generatePage(list, page) { - if(!list || list == "") { - return false; - } - - var embed = new Discord.MessageEmbed(); - embed.setTitle(`Queue for: ${message.guild.name}`); - embed.setColor(client.embedColour(message)); - - var elapsedTime = client.music.getGuild(message.guild.id).dispatcher.streamTime / 1000 - var totalDuration = queue[0].duration - elapsedTime; - - let timeRemaining = ""; - - for(let i = 1; i < queue.length; i++) { - let b = queue[i]; - - if(b.duration == 0) { - timeRemaining = "∞"; - - break; - } - - totalDuration += b.duration; - } - - if(timeRemaining == "") { - let queueDuration = client.createTimestamp(totalDuration); - - timeRemaining = queueDuration; - } - - let timestamp; - - if(queue[0].duration == 0) { - timestamp = "LIVE"; - livestream = true; - } else { - timestamp = client.createTimestamp(elapsedTime) + '/' + client.createTimestamp(queue[0].duration); - }; - - embed.addField(`Now playing:`, `**[${queue[0].title}](https://www.youtube.com/watch?v=${queue[0].id})** added by ${queue[0].requestedBy} \`[${timestamp}]\``) - - embed.addField(`Up next:`, list); - - if(songsInQueue > 1 || songsInQueue == 0) { - songsInQueueEnglish = "songs"; - } - - embed.setFooter(`Page ${page}/${lists.length} | ${songsInQueue + " " + songsInQueueEnglish} in queue | ${timeRemaining} time remaining`); - - return embed; - }; - - var myMessage = null; - - function displayPage(number) { - let page = generatePage(lists[number - 1], number); - - if(page) { - if(myMessage) { - myMessage.edit(page); - } else { - myMessage = message.channel.send(page); - } - - return true; - } else { - return false; - } - }; - - function aFunction(start) { - // start - index of song, which we should start with - // end - index of song, which we ended with - - let [list, end] = generateList(start, lists.length + 1); - - if(list && list != "") { - lists.push(list); - - if(queue[end + 1]) { - aFunction(end + 1); - } - } - }; - - aFunction(1); - - let page = 1; - - if(args[0]) { - let userPage = Number(args[0]); - - if(userPage) { - page = userPage; - } else { - return message.channel.send( - `<:error:466995152976871434> Invalid page. Usage: \`${client.commands.get(`queue`).help.usage}\`` - ); - } - }; - - if(displayPage(page)) { - - } else { - return message.channel.send( - `<:error:466995152976871434> Page ${page} doesn't exist!` - ); - } -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: [], - permLevel: "User", - requiredPerms: [] -}; - -exports.help = { - name: "queue", - category: "Music", - description: "Displays what songs are in the queue.", - usage: "queue " -}; diff --git a/src/commands/raidmode.js b/src/commands/raidmode.js deleted file mode 100644 index 68a70ec..0000000 --- a/src/commands/raidmode.js +++ /dev/null @@ -1,70 +0,0 @@ -const Discord = require("discord.js") -exports.run = async (client, message, args, level) => { - - const settings = message.settings; - const defaults = client.config.defaultSettings; - const overrides = client.settings.get(message.guild.id); - if (!client.settings.has(message.guild.id)) client.settings.set(message.guild.id, {}); - - var raidToggle; - var embColour; - var mutedRole = message.guild.roles.cache.get(settings.mutedRole) - - if(!mutedRole) { - return message.channel.send( - "<:error:466995152976871434> This command requires a muted role to be set! Please ask an admin or the owner to set this with `" + message.settings.prefix + "mutedrole `" - ) - } - if(args[0] == "strict") { - client.settings.set(message.guild.id, "on", "raidModeStrict"); - client.settings.set(message.guild.id, "on", "raidMode"); - message.channel.send(`<:success:466995111885144095> Strict raid mode enabled! New users will now be automatically kicked.`); - raidToggle = "Strict raid mode activated!" - embColour = "#777B7E" - } else { - if (settings.raidMode === "off") { - client.settings.set(message.guild.id, "on", "raidMode") - message.channel.send(`<:success:466995111885144095> Raid mode enabled! New users will now be automatically muted.`); - raidToggle = "Raid mode activated!" - embColour = "#777B7E" - } else { - client.settings.set(message.guild.id, "off", "raidMode") - client.settings.set(message.guild.id, "off", "raidModeStrict"); - message.channel.send(`<:success:466995111885144095> Raid mode disabled.`); - raidToggle = "Raid mode deactivated!" - embColour = "#48494b" - }; -}; - if (settings.modlogsChannel !== "off") { - const channel = message.guild.channels.cache.find( - channel => channel.name === settings.modlogsChannel - ); - - if (channel) { - let embed = new Discord.MessageEmbed(); - embed.setColor(embColour); - embed.setAuthor(raidToggle, message.author.avatarURL({format: "png", dynamic: true, size: 2048})); - embed.setDescription(`• Mod: ${message.author} (${message.author.id})`) - try { - channel.send({ embed }); - } catch (err) { - // probably no permissions to send messages/embeds there - } - } - } -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: [], - permLevel: "Administrator", - requiredPerms: ["MANAGE_ROLES", "KICK_MEMBERS"] -}; - -exports.help = { - name: "raidmode", - category: "Moderation", - description: "Enables/disables raid mode in your server, which automatically mutes new members. Strict raidmode automatically kicks new members.", - usage: "raidmode **OR** raidmode strict" -}; diff --git a/src/commands/randurban.js b/src/commands/randurban.js deleted file mode 100644 index 1a6a42b..0000000 --- a/src/commands/randurban.js +++ /dev/null @@ -1,41 +0,0 @@ -const urban = require("urban"); -exports.run = (client, message) => { - urban.random().first(json => { - if(message.channel.nsfw === false) return message.channel.send( - "<:error:466995152976871434> This command can only be executed in channels marked as NSFW!" - ); - if(json.definition.length > 2000) return message.channel.send( - `<:error:466995152976871434> Definition cannot exceed 2000 characters! Use this link instead: ${json.permalink}` - ); - if(json.example.length > 2000) return message.channel.send( - "<:error:466995152976871434> Example cannot exceed 2000 characters!" - ); - - embed = new Discord.MessageEmbed() - .setTitle(json.word) - .setURL(json.permalink) - .setColor("#EFFF00") - .setDescription(json.definition || "None") - .addField("Example", json.example || "None") - .addField("Upvotes", json.thumbs_up, true) - .addField("Downvotes", json.thumbs_down, true) - .setFooter(`Submitted by ${json.author}`) - message.channel.send(embed); - - }); -} - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: ["rurban"], - permLevel: "User", - requiredPerms: [] -}; - -exports.help = { - name: "randurban", - category: "Fun", - description: "Grabs a random definition from the Urban Dictonary.", - usage: "randurban" -}; diff --git a/src/commands/rate.js b/src/commands/rate.js deleted file mode 100644 index d4f0eac..0000000 --- a/src/commands/rate.js +++ /dev/null @@ -1,36 +0,0 @@ -exports.run = async (client, message, args) => { - if (!args[0]) - return message.channel.send( - `<:error:466995152976871434> What am I meant to rate? Usage: \`${client.commands.get(`rate`).help.usage}\`` - ); -var rating = [ - "0/10", - "1/10", - "2/10", - "3/10", - "4/10", - "5/10", - "6/10", - "7/10", - "8/10", - "9/10", - "10/10" -]; - let mess = rating.random(); - message.channel.send(`<:star:618393201501536258> I give ${args.join(" ")} a **${mess}**`); -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: [], - permLevel: "User", - requiredPerms: [] -}; - -exports.help = { - name: "rate", - category: "Fun", - description: "Gives something a rating from 0-10", - usage: "rate [thing]" -}; \ No newline at end of file diff --git a/src/commands/reload.js b/src/commands/reload.js deleted file mode 100644 index 8cefd15..0000000 --- a/src/commands/reload.js +++ /dev/null @@ -1,28 +0,0 @@ -exports.run = async (client, message, args) => {// eslint-disable-line no-unused-vars - if (!args || args.length < 1) return message.channel.send( - `<:error:466995152976871434> You must provide a command to reload! Usage: \`${client.commands.get(`reload`).help.usage}\`` - ); - - let response = await client.unloadCommand(args[0]); - if (response) return message.channel.send(`<:error:466995152976871434> Error unloading: ${response}`); - - response = client.loadCommand(args[0]); - if (response) return message.channel.send(`<:error:466995152976871434> Error loading: ${response}`); - - message.channel.send(`<:success:466995111885144095> \`${args[0]}\` has been reloaded!`); -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: [], - permLevel: "Developer", - requiredPerms: [] -}; - -exports.help = { - name: "reload", - category: "Owner", - description: "Reloads the specified command.", - usage: "reload [command]" -}; diff --git a/src/commands/removesong.js b/src/commands/removesong.js deleted file mode 100644 index d576c7d..0000000 --- a/src/commands/removesong.js +++ /dev/null @@ -1,49 +0,0 @@ -const util = require("util") -const Discord = require("discord.js") - -module.exports.run = (client, message, args, level) =>{ - var queue = client.music.getGuild(message.guild.id).queue; - - if(queue.length < 2) { - return message.channel.send(`<:error:466995152976871434> Not enough songs are in the queue for this command to work!`); - } - - if(!args[0]) { - return message.channel.send(`<:error:466995152976871434> You didn't tell me what song to remove! Usage: \`${client.commands.get(`removesong`).help.usage}\``); - }; - - var input = +args[0]; - - if(isNaN(input) == true) { - return message.channel.send(`<:error:466995152976871434> That isn't a number! You need to tell me the songs position in the queue (1, 2, etc.)`); - }; - - if(input >= queue.length) { - return message.channel.send("Invalid (too large)"); - }; - - if(input < 1) { - return message.channel.send("Invalid (too small)"); - }; - - var songName = queue[input].title; - - queue.splice(input, 1); - - message.channel.send(`<:success:466995111885144095> Removed from queue: **${songName}**`); -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: ["rmsong"], - permLevel: "Moderator", - requiredPerms: ["SPEAK"] -}; - -exports.help = { - name: "removesong", - category: "Music", - description: "Removes the specified song from the queue.", - usage: "removesong [position]" -}; diff --git a/src/commands/reset.js b/src/commands/reset.js deleted file mode 100644 index ca8fe34..0000000 --- a/src/commands/reset.js +++ /dev/null @@ -1,30 +0,0 @@ -const Discord = require("discord.js") -exports.run = async (client, message) => { - - if (!client.settings.has(message.guild.id)) client.settings.set(message.guild.id, {}); - - const response = await client.awaitReply(message, - "<:reboot:467216876938985482> This will clear the guild config and restore me to my default settings. Are you sure you want to do this?" - ); - if (["y", "yes"].includes(response.toLowerCase())) { - client.settings.set(message.guild.id, {}); - message.channel.send("<:success:466995111885144095> All settings have been restored to their default values.") - } else { - message.channel.send("<:success:466995111885144095> Action cancelled.") - } -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: [], - permLevel: "Administrator", - requiredPerms: [] -}; - -exports.help = { - name: "reset", - category: "Configure", - description: "Resets all settings to their default values.", - usage: "reset" -}; \ No newline at end of file diff --git a/src/commands/restart.js b/src/commands/restart.js deleted file mode 100644 index f3cf1a7..0000000 --- a/src/commands/restart.js +++ /dev/null @@ -1,27 +0,0 @@ -exports.run = async (client, message) => {// eslint-disable-line no-unused-vars - - // This actually shuts down the bot, you'll need to use something like pm2 to get it to restart - - await message.channel.send("<:reboot:467216876938985482> Restarting..."); - - client.commands.forEach( async cmd => { - await client.unloadCommand(cmd); - }); - - process.exit(); -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: [], - permLevel: "Developer", - requiredPerms: [] -}; - -exports.help = { - name: "restart", - category: "Owner", - description: "Restarts the bot.", - usage: "restart" -}; diff --git a/src/commands/resume.js b/src/commands/resume.js deleted file mode 100644 index 9c63f87..0000000 --- a/src/commands/resume.js +++ /dev/null @@ -1,28 +0,0 @@ -const Discord = require("discord.js") -exports.run = (client, message, args, level) => { - let guild = client.music.getGuild(message.guild.id); - if(guild.queue.length < 1) { - return message.channel.send("<:error:466995152976871434> Nothing is playing."); - }; - guild.playing = true; - guild.paused = false; - guild.dispatcher.resume(); - message.channel.send("<:play:467216788187512832> Playback resumed!"); - - -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: ["unpause"], - permLevel: "Moderator", - requiredPerms: ["SPEAK"] -}; - -exports.help = { - name: "resume", - category: "Music", - description: "Unpauses music.", - usage: "resume" -}; \ No newline at end of file diff --git a/src/commands/rip.js b/src/commands/rip.js deleted file mode 100644 index d677655..0000000 --- a/src/commands/rip.js +++ /dev/null @@ -1,25 +0,0 @@ -var request = require('request'); -const Discord = require("discord.js") -exports.run = (client, message) => { - message.channel.startTyping(); - var r = request.get('http://mityurl.com/y/yKsQ/r', function (err, res, body) { - var rip = r.uri.href - message.channel.send(`>:] ${rip}`) - message.channel.stopTyping(); - }); -} - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: [], - permLevel: "User", - requiredPerms: [] - }; - - exports.help = { - name: "rip", - category: "Fun", - description: "nice >:]", - usage: "`rip`" - }; \ No newline at end of file diff --git a/src/commands/rolecolour.js b/src/commands/rolecolour.js deleted file mode 100644 index 31248b6..0000000 --- a/src/commands/rolecolour.js +++ /dev/null @@ -1,52 +0,0 @@ -exports.run = async (client, message, [colour, ...givenRole], query) => { - let role = givenRole.join(" "); - - let gRole = client.findRole(role, message); - - if (!gRole) { - return message.channel.send(`<:error:466995152976871434> That role doesn't seem to exist. Try again!`); - }; - - if(!colour.startsWith('#')) { - colour = `#`+colour; - } - if(colour.length > 7) return message.channel.send( - `<:error:466995152976871434> Colour has to be a hex code. Usage: \`${client.commands.get(`rolecolour`).help.usage}\`` - ); - if(colour.length < 7) return message.channel.send( - `<:error:466995152976871434> Colour has to be a hex code. Usage: \`${client.commands.get(`rolecolour`).help.usage}\`` - ); - - let moderator = message.guild.member(message.author) - if (gRole.position >= moderator.roles.highest.position) { - return message.channel.send( - "<:error:466995152976871434> You cannot modify roles higher than your own!" - ); - } - - var bot = message.guild.members.cache.get(client.user.id) - if (gRole.position >= bot.roles.highest.position) { - return message.channel.send( - `<:error:466995152976871434> I cannot modify roles higher than my own!` - ); - } - - await gRole.edit({color: colour}) - message.channel.send( - `<:success:466995111885144095> The colour of the role \`${gRole.name}\` has been set to \`${colour}\``); -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: ["rolecolor"], - permLevel: "Moderator", - requiredPerms: ["MANAGE_ROLES"] -}; - -exports.help = { - name: "rolecolour", - category: "Utility", - description: "Sets the colour of a role to the specified hex.", - usage: "rolecolour [hex] [role]" -}; diff --git a/src/commands/roleinfo.js b/src/commands/roleinfo.js deleted file mode 100644 index 10d8c4d..0000000 --- a/src/commands/roleinfo.js +++ /dev/null @@ -1,75 +0,0 @@ -const Discord = require("discord.js"); -exports.run = async (client, message, args, level) => { - if (!args[0]) - return message.channel.send( - `<:error:466995152976871434> You didn't provide me with a role name or ID! Usage: \`${client.commands.get(`roleinfo`).help.usage}\`` - ); - - let role = client.findRole(args.join(" "), message); - - if (!role) { - return message.channel.send(`<:error:466995152976871434> That role doesn't seem to exist. Try again!`); - }; - - if(!role) { - return message.channel.send(`<:error:466995152976871434> Role not found.`) - } - - var permissions = "```"; - if(role.permissions.has("ADMINISTRATOR")) permissions += "ADMINISTRATOR, "; - if(role.permissions.has("CREATE_INSTANT_INVITE")) permissions += "CREATE_INSTANT_INVITE, "; - if(role.permissions.has("KICK_MEMBERS")) permissions += "KICK_MEMBERS, "; - if(role.permissions.has("BAN_MEMBERS")) permissions += "BAN_MEMBERS, "; - if(role.permissions.has("MANAGE_CHANNELS")) permissions += "MANAGE_CHANNELS, "; - if(role.permissions.has("MANAGE_GUILD")) permissions += "MANAGE_GUILD, "; - if(role.permissions.has("ADD_REACTIONS")) permissions += "ADD_REACTIONS, "; - if(role.permissions.has("VIEW_AUDIT_LOG")) permissions += "VIEW_AUDIT_LOG, "; - if(role.permissions.has("PRIORITY_SPEAKER")) permissions += "PRIORITY_SPEAKER, "; - if(role.permissions.has("STREAM")) permissions += "STREAM, "; - if(role.permissions.has("VIEW_CHANNEL")) permissions += "VIEW_CHANNEL, "; - if(role.permissions.has("SEND_MESSAGES")) permissions += "SEND_MESSAGES, "; - if(role.permissions.has("SEND_TTS_MESSAGES")) permissions += "SEND_TTS_MESSAGES, "; - if(role.permissions.has("MANAGE_MESSAGES")) permissions += "MANAGE_MESSAGES, "; - if(role.permissions.has("EMBED_LINKS")) permissions += "EMBED_LINKS, "; - if(role.permissions.has("ATTACH_FILES")) permissions += "ATTACH_FILES, "; - if(role.permissions.has("READ_MESSAGE_HISTORY")) permissions += "READ_MESSAGE_HISTORY, "; - if(role.permissions.has("MENTION_EVERYONE")) permissions += "MENTION_EVERYONE, "; - if(role.permissions.has("USE_EXTERNAL_EMOJIS")) permissions += "USE_EXTERNAL_EMOJIS, "; - if(role.permissions.has("CONNECT")) permissions += "CONNECT, "; - if(role.permissions.has("SPEAK")) permissions += "SPEAK, "; - if(role.permissions.has("MUTE_MEMBERS")) permissions += "MUTE_MEMBERS, "; - if(role.permissions.has("DEAFEN_MEMBERS")) permissions += "DEAFEN_MEMBERS, "; - if(role.permissions.has("MOVE_MEMBERS")) permissions += "MOVE_MEMBERS, "; - if(role.permissions.has("USE_VAD")) permissions += "USE_VAD, "; - if(role.permissions.has("CHANGE_NICKNAME")) permissions += "CHANGE_NICKNAME, "; - if(role.permissions.has("MANAGE_NICKNAMES")) permissions += "MANAGE_NICKNAMES, "; - if(role.permissions.has("MANAGE_ROLES")) permissions += "MANAGE_ROLES, "; - if(role.permissions.has("MANAGE_WEBHOOKS")) permissions += "MANAGE_WEBHOOKS, "; - if(role.permissions.has("MANAGE_EMOJIS")) permissions += "MANAGE_EMOJIS, "; - permissions = permissions.slice(0, -2); - permissions += "```"; - - var embed = new Discord.MessageEmbed(); - embed.setColor(role.color); - embed.setTitle(role.name); - embed.setDescription( - `• **ID:** ${role.id}\n• **Hex:** ${role.hexColor}\n• **Members:** ${role.members.size}\n• **Position:** ${role.position}\n• **Hoisted:** ${role.hoist}` - ); - embed.addField(`**Permissions:**`, permissions) - message.channel.send(embed) -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: ["rinfo"], - permLevel: "User", - requiredPerms: [] -}; - -exports.help = { - name: "roleinfo", - category: "Utility", - description: "Gives information about a role.", - usage: "roleinfo [role]" -}; \ No newline at end of file diff --git a/src/commands/sans.js b/src/commands/sans.js deleted file mode 100644 index ae5b3af..0000000 --- a/src/commands/sans.js +++ /dev/null @@ -1,36 +0,0 @@ -const url = "https://demirramon.com/gen/undertale_text_box.png"; -exports.run = (client, message, args) => { - let text = args.join(" "); - if (!text) { - return message.channel.send( - `<:error:466995152976871434> No message provided. Usage: \`${client.commands.get(`sans`).help.usage}\`` - ); - } - - message.channel.startTyping(); - - let params = "box=undertale&boxcolor=white&character=undertale-sans&expression=default&charcolor=white&font=determination&asterisk=true&mode=regular&text=" + encodeURIComponent(text); - - try { - message.channel.stopTyping(); - message.channel.send({files: [new Discord.MessageAttachment(url + "?" + params, "undertale.png")]}); - } catch(err) { - message.channel.stopTyping(); - message.channel.send(`<:error:466995152976871434> Error when generating image: \`${err}\``) - } -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: ["undertale"], - permLevel: "User", - requiredPerms: ["ATTACH_FILES"] -}; - -exports.help = { - name: "sans", - category: "Fun", - description: "Generates a sans text box", - usage: "sans [message]" -}; \ No newline at end of file diff --git a/src/commands/say.js b/src/commands/say.js deleted file mode 100644 index e196847..0000000 --- a/src/commands/say.js +++ /dev/null @@ -1,28 +0,0 @@ -exports.run = (client, message, args, level) => { - if(!args[0]) { - return message.channel.send( - `<:error:466995152976871434> No message provided. Usage: \`${client.commands.get(`echo`).help.usage}\`` - ); - }; - if (message.content.includes("@everyone")) { - return message.channel.send(`<@${message.author.id}>`); - }; - - message.delete().catch(O_o => {}); - message.channel.send(args.join(" ")); -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: ["echo"], - permLevel: "User", - requiredPerms: ["MANAGE_MESSAGES"] -}; - -exports.help = { - name: "say", - category: "Fun", - description: "Makes Woomy copy what the user says.", - usage: "echo <-hide> [message]" -}; diff --git a/src/commands/servericon.js b/src/commands/servericon.js deleted file mode 100644 index 2eb44c4..0000000 --- a/src/commands/servericon.js +++ /dev/null @@ -1,18 +0,0 @@ -exports.run = (client, message) => { - message.channel.send(`**${message.guild}'s** icon is:\n${message.guild.iconURL({format: "png", dynamic: true, size: 2048})}`) -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: ["sicon", "guildicon"], - permLevel: "User", - requiredPerms: ["EMBED_LINKS"] -}; - -exports.help = { - name: "servericon", - category: "Utility", - description: "Displays the icon for the server.", - usage: "servericon" -}; diff --git a/src/commands/serverinfo.js b/src/commands/serverinfo.js deleted file mode 100644 index 89c2230..0000000 --- a/src/commands/serverinfo.js +++ /dev/null @@ -1,99 +0,0 @@ -exports.run = (client, message) => { - - var guild = message.guild - var badges = ""; - var members = `${guild.memberCount} (${guild.memberCount-guild.members.cache.filter(member => member.user.bot).size} users | ${guild.members.cache.filter(member => member.user.bot).size} bots)`; - - var roles = 0; - guild.roles.cache.forEach((role) => { - roles = roles + 1; - }); - - var channels = 0; - var categories = 0; - var text = 0; - var voice = 0; - - guild.channels.cache.forEach((channel) => { - if(channel.type == "category") { - categories = categories + 1; - } else { - if(channel.type == "text") { - text = text + 1; - }; - - if(channel.type == "voice") { - voice = voice + 1; - }; - - channels = channels + 1; - }; - }); - - var channelString = `${channels} (${text} text | ${voice} voice | ${categories} categories)` - - if(guild.premiumTier > 0) { - badges = badges += "<:boosted:685704824175853624> " - } - - if(guild.partnered == true) { - badges = badges += "<:partnered:685704834779054107> " - } - - if(guild.verified == true) { - badges = badges += "<:verified:685704812435734569>" - } - - if(badges.length > 0) { - badges = badges += "\n" - } - - var boosts; - if(guild.premiumTier == 1) { - boosts = `${guild.premiumSubscriptionCount} (level 1)` - } else if(guild.premiumTier == 2) { - boosts = `${guild.premiumSubscriptionCount} (level 2)` - } else if(guild.premiumTier == 3) { - boosts = `${guild.premiumSubscriptionCount} (level 3)` - } else { - boosts = guild.premiumSubscriptionCount; - }; - - var emojis = 0; - var static = 0; - var animated = 0; - - guild.emojis.cache.forEach((emoji) => { - if(emoji.animated == true) { - animated = animated + 1; - } else { - static = static + 1; - }; - emojis = emojis + 1; - }); - - emojiString = `${emojis} (${static} static | ${animated} animated)` - - let embed = new Discord.MessageEmbed() - .setColor(message.guild.member(client.user).displayHexColor) - .setTitle(guild.name) - .setDescription(`${badges}• **ID:** ${guild.id}\n• **Owner:** ${guild.owner}\n• **Region:** ${guild.region.toProperCase()}\n• **Boosts:** ${boosts}\n• **Members:** ${members}\n• **Channels:** ${channelString}\n• **Roles:** ${roles}\n• **Emojis:** ${emojiString}\n• **Creation date:** ${guild.createdAt}`) - .setThumbnail(message.guild.iconURL({format: "png", dynamic: true, size: 2048})); - - message.channel.send(embed); -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: ["sinfo", "guildinfo", "ginfo", "server"], - permLevel: "User", - requiredPerms: ["EMBED_LINKS"] -}; - -exports.help = { - name: "serverinfo", - category: "Utility", - description: "Displays some useful information about the current server.", - usage: "serverinfo" -}; diff --git a/src/commands/settings.js b/src/commands/settings.js deleted file mode 100644 index eb1f66c..0000000 --- a/src/commands/settings.js +++ /dev/null @@ -1,101 +0,0 @@ -exports.run = async (client, message, args) => { - - const settings = message.settings; - if (!client.settings.has(message.guild.id)) client.settings.set(message.guild.id, {}); - - modChan = message.guild.channels.cache.find(channel => channel.name === settings.modlogsChannel) || "__Disabled__"; - chatChan = message.guild.channels.cache.find(channel => channel.name === settings.chatlogsChannel) || "__Disabled__" - greetChan = message.guild.channels.cache.get(settings.welcomeChannel) || "__Disabled__"; - prefix = settings.prefix; - - var raidMode; - var rmDisabled = false; - if(settings.raidMode == "off") { - raidMode = "__Disabled__" - rmDisabled = true; - } else { - raidMode = `\`${settings.raidMode}` - } - - if(settings.raidModeStrict == "on") { - raidMode += " (strict)`" - } else if(rmDisabled != true) { - raidMode += "`" - } - - var modRole = message.guild.roles.cache.get(settings.modRole); - var adminRole = message.guild.roles.cache.get(settings.adminRole); - var autorole = message.guild.roles.cache.get(settings.autorole); - var mutedRole = message.guild.roles.cache.get(settings.mutedRole); - var blacklist = ""; - - if(settings.modRole == "off" || !modRole) { - modRole = "__None set__"; - } else { - modRole = "`" + modRole.name + "`"; - } - - if(settings.adminRole == "off" || !adminRole) { - adminRole = "__None set__"; - } else { - adminRole = "`" + adminRole.name + "`"; - } - - if(settings.autorole == "off" || !autorole) { - autorole = "__None set__"; - } else { - autorole = "`" + autorole.name + "`"; - } - - if(settings.mutedRole == "off" || !mutedRole) { - mutedRole = "__None set__"; - } else { - mutedRole = "`" + mutedRole.name + "`"; - } - - if(settings.welcomeMessage == "off") { - welcomeMessage = "__Disabled__"; - } else { - welcomeMessage = "`" + settings.welcomeMessage + "`"; - } - - if(settings.leaveMessage == "off") { - leaveMessage = "__Disabled__"; - } else { - leaveMessage = "`" + settings.leaveMessage + "`"; - } - - if(settings.blacklisted == "ARRAY" || settings.blacklisted.length < 1) { - blacklist = "__Disabled__"; - } else { - if(settings.blacklisted.length > 0) { - settings.blacklisted.forEach(function(user) { - blacklist += "`" + (client.users.cache.get(user).tag || user.tag) + "`, " - }); - blacklist = blacklist.substring(0, blacklist.length - 2); - }; - }; - - embed = new Discord.MessageEmbed() - embed.setAuthor("Settings for: " + message.guild.name, message.guild.iconURL({dynamic: true})) - embed.setColor(message.guild.member(client.user).displayHexColor) - embed.setDescription("You can edit these settings using the commands in the 'configure' section of the help command.") - embed.addFields({ name: "General:", value: `Prefix: \`${prefix}\`\nChat logging: ${chatChan}\nMod logging: ${modChan}\nRaid mode: ${raidMode}\nJoin/leave channel: ${greetChan}\nWelcome message: ${welcomeMessage}\nLeave message: ${leaveMessage}`, inline: true}, {name: "Roles:", value: `Moderator: ${modRole}\nAdministrator: ${adminRole}\nMuted: ${mutedRole}\nBlacklisted: ${blacklist}\nAutorole: ${autorole}`, inline: true}) - message.channel.send(embed) - -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: ["config"], - permLevel: "Administrator", - requiredPerms: [] -}; - -exports.help = { - name: "settings", - category: "Configure", - description: "View your server's settings.", - usage: "settings" -}; diff --git a/src/commands/sexuality.js b/src/commands/sexuality.js deleted file mode 100644 index c41930b..0000000 --- a/src/commands/sexuality.js +++ /dev/null @@ -1,36 +0,0 @@ -const sexualities = require ("../../resources/other/sexualities.json"); -exports.run = async (client, message, args) => { - var output = ""; - if(!args[0]) { - for (var key of Object.keys(sexualities)) { - output += `${key}, ` - }; - return message.channel.send(`__**Sexualities:**__\n${output.slice(0, -2)}`); - } else { - if(args.join(" ").toLowerCase() == "attack helicopter" || args.join(" ").toLowerCase() == "apache attack helicopter" || args.join(" ").toLowerCase() == "apache") { - return message.channel.send({ - files: [new Discord.MessageAttachment("./resources/images/attackhelicopter.jpg")] - }); - } - output = sexualities[args.join(" ").toLowerCase()]; - if(!output) { - return message.channel.send("<:error:466995152976871434> No results for that query."); - }; - return message.channel.send(`__**${output.name.toProperCase()}:**__\n${output.description}`); - }; -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: ["sexualities"], - permLevel: "User", - requiredPerms: [] -}; - -exports.help = { - name: "sexuality", - category: "Fun", - description: "Gives you information about the specified sexuality.", - usage: "sexuality [sexuality]" -}; diff --git a/src/commands/ship.js b/src/commands/ship.js deleted file mode 100644 index 3850d87..0000000 --- a/src/commands/ship.js +++ /dev/null @@ -1,53 +0,0 @@ -exports.run = async (client, message, args) => { - - var name, name1; - var rating = Math.floor(Math.random() * 100) + 1; - var hearts = [ - "❤️", - "🧡", - "💛", - "💚", - "💙", - "💜" - ]; - - if(args.length < 2) { - return message.channel.send(`<:error:466995152976871434> Please include two names/users.`) - } - - if(message.guild && message.mentions.members && message.mentions.members.size > 0) { - name = message.mentions.members.first().displayName; - }; - - if(message.guild && message.mentions.members && message.mentions.members.size > 1) { - name1 = message.mentions.members.last().displayName; - }; - - if(!name) { - name = args[0]; - }; - - if(!name1) { - name1 = args[1]; - }; - - shipName = name.substr(0, client.intBetween(1,name.length))+name1.substr(client.intBetween(0,name1.length)); - - message.channel.send(`__**Ship Generator:**__\n${hearts.random()} Ship Name: \`${shipName}\`\n${hearts.random()} Compatibility rating: \`${rating}%\``) -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: [], - permLevel: "User", - requiredPerms: [] -}; - -exports.help = { - name: "ship", - category: "Fun", - description: "Ship two people together <3", - usage: "ship [name/user] [name/user]" -}; - diff --git a/src/commands/skip.js b/src/commands/skip.js deleted file mode 100644 index c997c18..0000000 --- a/src/commands/skip.js +++ /dev/null @@ -1,66 +0,0 @@ -const Discord = require("discord.js") -exports.run = (client, message, args, level) => { - let guild = client.music.getGuild(message.guild.id); - - if(guild.queue.length < 1 || !guild.playing || !guild.dispatcher) return message.channel.send( - "<:error:466995152976871434> Nothing is playing." - ); - - let vc = message.guild.members.cache.get(client.user.id).voiceChannel; - - if(vc != message.member.voiceChannel) return message.channel.send( - '<:error:466995152976871434> You need to be in my voice channel to use this command!' - ); - - if(guild.queue[0].requestedBy.id == message.author.id) { - skip_song(guild); - - message.channel.send( - `<:skip:467216735356059660> Song has been skipped by the user who requested it.` - ); - - return; - } - - if (guild.skippers.indexOf(message.author.id) == -1) { - guild.skippers.push(message.author.id); - - if (guild.skippers.length >= Math.ceil(vc.members.filter(member => !member.user.bot).size / 2)) { - - skip_song(guild); - - message.channel.send( - `<:skip:467216735356059660> Song has been skipped.` - ); - - } else { - message.channel.send( - `<:success:466995111885144095> Your vote has been acknowledged! **${guild.skippers.length + "/" + Math.ceil(vc.members.filter(member => !member.user.bot).size / 2)}**` - ); - }; - - } else { - message.channel.send( - "<:denied:466995195150336020> You cannot vote twice!" - ); - }; -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: ["voteskip"], - permLevel: "User", - requiredPerms: ["SPEAK"] -}; - -exports.help = { - name: "skip", - category: "Music", - description: "Vote to skip the currently playing song. Song will be skipped instantly if executed by the user who requested it.", - usage: "skip" -}; - -function skip_song(guild) { - guild.dispatcher.end("silent"); - } \ No newline at end of file diff --git a/src/commands/slap.js b/src/commands/slap.js deleted file mode 100644 index c87c783..0000000 --- a/src/commands/slap.js +++ /dev/null @@ -1,69 +0,0 @@ -const API = require('nekos.life'); -const {sfw} = new API(); -exports.run = async (client, message, args) => { - if(!args[0]) { - return message.channel.send(`<:error:466995152976871434> You didn't say who you wanted to slap! Usage: \`${client.commands.get(`slap`).help.usage}\``) - }; - - var people = ""; - - for (var i = 0; i < args.length; i++) { - var user = client.getUserFromMention(args[i]) - if (user) { - user = message.guild.members.cache.get(user.id).displayName; - } else { - users = client.searchForMembers(message.guild, args[i]); - if (users.length > 1) - return message.channel.send( - "<:error:466995152976871434> Found multiple users for `" + args[i] + "`, Please be more specific or mention the user instead." - ); - else if (users.length == 0) - return message.channel.send( - "<:error:466995152976871434> That user doesn't seem to exist. Try again!" - ); - user = users[0].displayName; - }; - if(i+1 == args.length && args.length > 1) { - people += `**and** ${user}!` - } else if(args.length < 2) { - people += `${user}!`; - } else if(args.length == 2 && i == 0) { - people += `${user} `; - } else { - people += `${user}, `; - }; - }; - - - - message.channel.startTyping(); - try { - sfw.slap().then((json) => { - embed = new Discord.MessageEmbed(); - embed.setImage(json.url) - embed.setColor(client.embedColour(message)); - embed.setDescription(`**${message.guild.members.cache.get(message.author.id).displayName}** slapped **${people}**`) - message.channel.send(embed) - message.channel.stopTyping(); - }); - } catch (err) { - client.logger.error("slap.js: " + err); - message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`) - message.channel.stopTyping(); - }; -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: [], - permLevel: "User", - requiredPerms: ["EMBED_LINKS"] -}; - -exports.help = { - name: "slap", - category: "Action", - description: "Slap someone >:3", - usage: "slap [@user/user] (you can slap as many people as you want!)" -}; diff --git a/src/commands/smug.js b/src/commands/smug.js deleted file mode 100644 index 011f2bd..0000000 --- a/src/commands/smug.js +++ /dev/null @@ -1,33 +0,0 @@ -const API = require('nekos.life'); -const {sfw} = new API(); -exports.run = async (client, message) => { - message.channel.startTyping(); - try { - sfw.smug().then((json) => { - embed = new Discord.MessageEmbed(); - embed.setImage(json.url) - embed.setColor(client.embedColour(message)); - message.channel.send(embed) - message.channel.stopTyping(); - }); - } catch (err) { - client.logger.error("smug.js: " + err); - message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`) - message.channel.stopTyping(); - }; -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: [], - permLevel: "User", - requiredPerms: ["EMBED_LINKS"] -}; - -exports.help = { - name: "smug", - category: "Action", - description: "Sends a smug gif.", - usage: "smug" -}; diff --git a/src/commands/softban.js b/src/commands/softban.js deleted file mode 100644 index 1b602c5..0000000 --- a/src/commands/softban.js +++ /dev/null @@ -1,99 +0,0 @@ -exports.run = async (client, message, args) => { - const settings = (message.settings = client.getSettings(message.guild.id)); - - if(!args[0]) { - return message.channel.send( - `<:error:466995152976871434> No username provided. Usage: \`${client.commands.get(`ban`).help.usage}\`` - ); - }; - - let user = message.mentions.members.first(); - - if (!user) { - let users; - users = client.searchForMembers(message.guild, args[0]); - if (users.length > 1) - return message.channel.send( - "<:error:466995152976871434> Found multiple users! Please be more specific or mention the user instead." - ); - else if (users.length == 0) - return message.channel.send( - "<:error:466995152976871434> That user doesn't seem to exist. Try again!" - ); - user = users[0]; - }; - - if(!user.bannable) { - return message.channel.send(`<:error:466995152976871434> Specified user is not bannable.`) - }; - - let mod = message.guild.member(message.author); - let bot = message.guild.member(client.user); - - if (user.roles.highest.position >= mod.roles.highest.position) { - return message.channel.send( - `<:error:466995152976871434> You can't softban people who are higher ranked than you are!` - ); - }; - - if (user.roles.highest.position >= bot.roles.highest.position) { - return message.channel.send( - `<:error:466995152976871434> I can't softban people who are higher ranked than you myself!` - ); - }; - - if(!user.bannable) { - return message.channel.send(`<:error:466995152976871434> Specified user is not bannable.`) - }; - - var days = args[args.length - 1] - try { - days = Number(days); - } catch(err) {}; - - console.log(typeof days) - console.log(days) - - if(isNaN(days)) { - return message.channel.send(`<:error:466995152976871434> Invalid number. Did you forget to specify how many days worth of messages to clear? Usage: \`${client.commands.get(`softban`).help.usage}\``) - } else if (days < 1 || days > 7) { - return message.channel.send(`<:error:466995152976871434> Number too large/small. The max amount of days I can clear is 7.`) - } else { - await message.guild.members.ban(user, {reason: `Softbanned by ${message.author.tag}`, days: days}); - await message.guild.members.unban(user); - message.channel.send(`<:success:466995111885144095> Softbanned \`${user.user.tag}\``); - - if (settings.modlogsChannel !== "off") { - const channel = message.guild.channels.cache.find( - channel => channel.name === settings.modlogsChannel - ); - - if (channel) { - let embed = new Discord.MessageEmbed(); - embed.setColor("#F38159"); - embed.setAuthor("User softbanned!", user.user.avatarURL({format: "png", dynamic: true, size: 2048})); - embed.setDescription( - `• User: ${user.user.tag} (${user.user.id})\n• Mod: ${message.author} (${message.author.id})\n• Days cleared: ${days}` - ); - try { - channel.send(embed); - } catch (err) {}; - }; - }; - }; -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: [], - permLevel: "Moderator", - requiredPerms: ["BAN_MEMBERS"] -}; - -exports.help = { - name: "softban", - category: "Moderation", - description: "Bans then unbans a user, clearing their messages.", - usage: "softban [user] [days]" -}; diff --git a/src/commands/spoilerise.js b/src/commands/spoilerise.js deleted file mode 100644 index 25ab221..0000000 --- a/src/commands/spoilerise.js +++ /dev/null @@ -1,28 +0,0 @@ -exports.run = async (client, message, args) => { - if(!args[0]) { - return message.channel.send(`<:error:466995152976871434> You didn't provide any text! Usage: \`${client.commands.get(`spoiler`).help.usage}\``) - }; - - var output = `||${[...message.cleanContent.substring(9)].join("||||")}||`; - - if(output.length > 2000) { - output = output.slice(0, -Math.abs(output.length - 2000)) - }; - - message.channel.send(output) -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: ["spoilerize", "spoiler"], - permLevel: "User", - requiredPerms: [] -}; - -exports.help = { - name: "spoilerise", - category: "Fun", - description: "Spoilers every letter in the provided text.", - usage: "spoiler [text]" -}; diff --git a/src/commands/stop.js b/src/commands/stop.js deleted file mode 100644 index 695dd04..0000000 --- a/src/commands/stop.js +++ /dev/null @@ -1,32 +0,0 @@ -const Discord = require("discord.js"); - -exports.run = async (client, message) => { - let guild = client.music.getGuild(message.guild.id); - - if(guild.queue.length < 1 || !guild.playing || !guild.dispatcher) return message.channel.send("<:error:466995152976871434> Nothing is playing."); - if(!message.member.voice.channel) return message.channel.send('<:error:466995152976871434> You need to be in voice channel to use this command!'); - - guild.playing = false; - guild.paused = false; - guild.queue = []; - - guild.dispatcher.end("silent"); - - message.channel.send("<:stop:467639381390262284> Playback stopped!"); -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: [], - permLevel: "Moderator", - requiredPerms: [] -}; - -exports.help = { - name: "stop", - category: "Music", - description: "Clears the queue and disconnects from the voice channel. (run this if music stopS working)", - usage: "stop" -}; - diff --git a/src/commands/support.js b/src/commands/support.js deleted file mode 100644 index c15de88..0000000 --- a/src/commands/support.js +++ /dev/null @@ -1,18 +0,0 @@ -exports.run = async (client, message, args) =>{ - message.channel.send("Use this link to join my support server: https://discord.gg/HCF8mdv") -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: [], - permLevel: "User", - requiredPerms: [] - }; - -exports.help = { - name: "support", - category: "Utility", - description: "Sends a link to Woomy's support/development server.", - usage: "support" - }; diff --git a/src/commands/takerole.js b/src/commands/takerole.js deleted file mode 100644 index 408d0e3..0000000 --- a/src/commands/takerole.js +++ /dev/null @@ -1,86 +0,0 @@ -exports.run = async (client, message, [member, ...role2add], query) => { - if (!member) { - return message.channel.send( - `<:error:466995152976871434> No user specified. Usage: \`${client.commands.get(`takerole`).help.usage}\`` - ); - } - let user = message.mentions.members.first(); - let users; - if (!user) { - users = client.searchForMembers(message.guild, member); - if (users.length > 1) - return message.channel.send( - "<:error:466995152976871434> Found multiple users, please be more specific or mention the user instead." - ); - else if (users.length == 0) - return message.channel.send( - "<:error:466995152976871434> That user doesn't seem to exist. Try again!" - ); - user = users[0]; - } - let role = role2add.join(" "); - - gRole = client.findRole(role, message); - - if (!gRole) { - return message.channel.send(`<:error:466995152976871434> That role doesn't seem to exist. Try again!`); - }; - - let moderator = message.guild.member(message.author) - if (gRole.position >= moderator.roles.highest.position) { - return message.channel.send( - "<:error:466995152976871434> You cannot take roles higher than your own!" - ); - } - - var bot = message.guild.members.cache.get(client.user.id) - if (gRole.position >= bot.roles.highest.position) { - return message.channel.send( - `<:error:466995152976871434> I can't take roles higher than my own!` - ); - } - if (!user.roles.cache.has(gRole.id)) { - return message.channel.send( - "<:error:466995152976871434> They don't have that role!" - ); - } - await user.roles.remove(gRole.id); - message.channel.send( - `<:success:466995111885144095> Took the \`${gRole.name}\` role from \`${ - user.user.tag - }\`` - ); - - if (client.getSettings(message.guild.id).modlogsChannel !== "off") { - const channel = message.guild.channels.cache.find( - channel => channel.name === client.getSettings(message.guild.id).modlogsChannel - ); - - if (channel) { - let embed = new Discord.MessageEmbed(); - embed.setColor("#008369"); - embed.setAuthor("Role taken:", user.user.avatarURL({format: "png", dynamic: true, size: 2048})); - embed.setDescription(`‏‏‎• User: ${user} (${user.user.id})\n‏‏‎• Mod: ${message.author} (${message.author.id})\n‏‏‎• Role: ${gRole}`) - try { - channel.send({ embed }); - } catch (err) { - // probably no permissions to send messages/embeds there - }; - }; - }; -}; - - exports.conf = { - enabled: true, - guildOnly: true, - aliases: ["removerole"], - permLevel: "Moderator", - requiredPerms: ["MANAGE_ROLES"] - }; - - exports.help = { - name: "takerole", - category: "Moderation", - description: "Takes a role from the specified user.", - usage: "takerole [user] [role]" - }; \ No newline at end of file diff --git a/src/commands/tickle.js b/src/commands/tickle.js deleted file mode 100644 index e75a771..0000000 --- a/src/commands/tickle.js +++ /dev/null @@ -1,69 +0,0 @@ -const API = require('nekos.life'); -const {sfw} = new API(); -exports.run = async (client, message, args) => { - if(!args[0]) { - return message.channel.send(`<:error:466995152976871434> You didn't say who you wanted to tickle! Usage: \`${client.commands.get(`tickle`).help.usage}\``) - }; - - var people = ""; - - for (var i = 0; i < args.length; i++) { - var user = client.getUserFromMention(args[i]) - if (user) { - user = message.guild.members.cache.get(user.id).displayName; - } else { - users = client.searchForMembers(message.guild, args[i]); - if (users.length > 1) - return message.channel.send( - "<:error:466995152976871434> Found multiple users for `" + args[i] + "`, Please be more specific or mention the user instead." - ); - else if (users.length == 0) - return message.channel.send( - "<:error:466995152976871434> That user doesn't seem to exist. Try again!" - ); - user = users[0].displayName; - }; - if(i+1 == args.length && args.length > 1) { - people += `**and** ${user}!` - } else if(args.length < 2) { - people += `${user}!`; - } else if(args.length == 2 && i == 0) { - people += `${user} `; - } else { - people += `${user}, `; - }; - }; - - - - message.channel.startTyping(); - try { - sfw.tickle().then((json) => { - embed = new Discord.MessageEmbed(); - embed.setImage(json.url) - embed.setColor(client.embedColour(message)); - embed.setDescription(`**${message.guild.members.cache.get(message.author.id).displayName}** tickled **${people}**`) - message.channel.send(embed) - message.channel.stopTyping(); - }); - } catch (err) { - client.logger.error("tickle.js: " + err); - message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`) - message.channel.stopTyping(); - }; -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: [], - permLevel: "User", - requiredPerms: ["EMBED_LINKS"] -}; - -exports.help = { - name: "tickle", - category: "Action", - description: "Tickle someone!", - usage: "tickle [@user/user] (you can tickle as many people as you want!)" -}; diff --git a/src/commands/unmute.js b/src/commands/unmute.js deleted file mode 100644 index abf38f1..0000000 --- a/src/commands/unmute.js +++ /dev/null @@ -1,90 +0,0 @@ -exports.run = async (client, message, args, level) => { - const settings = message.settings; - - if(!args[0]) { - return message.channel.send("<:error:466995152976871434> Who am I meant to unmute?") - } - let user = message.mentions.members.first(); - let users; - if (!user) { - users = client.searchForMembers(message.guild, args[0]); - if (users.length > 1) - return message.channel.send( - "<:error:466995152976871434> Found multiple users! Please be more specific or mention the user instead." - ); - else if (users.length == 0) - return message.channel.send( - "<:error:466995152976871434> That user doesn't seem to exist. Try again!" - ); - user = users[0]; - } - if (user.user.id === client.user.id) { - return message.channel.send("lol no") - } - - let moderator = message.guild.member(message.author) - if (message.settings.mutedRole.position >= moderator.roles.highest.position && level < 2) { - return message.channel.send( - "<:error:466995152976871434> The muted role is positioned above the moderator role! Please move the muted role below the moderator role." - ); - } - if (user.roles.highest.position >= moderator.roles.highest.position && moderator.user.id !== message.guild.ownerID) { - return message.channel.send( - `<:error:466995152976871434> You can't unmute people who have a higher role than you!` - ); - }; - let bot = message.guild.member(client.user) - if (user.roles.highest.position >= bot.roles.highest.position) { - return message.channel.send( - `<:error:466995152976871434> I can't unmute people who have a higher role than me!` - ); - } - - let role = message.guild.roles.cache.get(settings.mutedRole) - if(!role) { - return message.channel.send( - "<:error:466995152976871434> Mute role not found! Please set one using `~settings edit mutedRole `" - ); - } - - if (!user.roles.cache.has(role.id)) { - return message.channel.send("<:error:466995152976871434> They aren't muted!") - } - - await user.roles.remove(role.id); - message.channel.send(`<:success:466995111885144095> Unmuted \`${user.user.tag}\``) - - - if (settings.modlogsChannel !== "off") { - const channel = message.guild.channels.cache.find( - channel => channel.name === settings.modlogsChannel - ); - - if (channel) { - let embed = new Discord.MessageEmbed(); - embed.setColor("#7a2f8f"); - embed.setAuthor("User unmuted!", user.user.avatarURL({format: "png", dynamic: true, size: 2048})); - embed.setDescription(`• User: ${user} (${user.user.id})\n• Mod: ${message.author} (${message.author.id})`) - try { - channel.send({ embed }); - } catch (err) { - // probably no permissions to send messages/embeds there - } - } - } -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: [], - permLevel: "Moderator", - requiredPerms: ["MANAGE_ROLES", "MANAGE_CHANNELS"] -}; - -exports.help = { - name: "unmute", - category: "Moderation", - description: "Allows a muted user to type again.", - usage: "unmute [user]" -}; diff --git a/src/commands/urban.js b/src/commands/urban.js deleted file mode 100644 index b42f366..0000000 --- a/src/commands/urban.js +++ /dev/null @@ -1,48 +0,0 @@ -Discord = require("discord.js"); -urban = require("relevant-urban"); -exports.run = async (client, message, args) => { - if (message.channel.nsfw === false) return message.channel.send( - "<:error:466995152976871434> This command can only be executed in channels marked as NSFW!" - ); - if (args < 1) return message.channel.send( - `<:error:466995152976871434> You did not tell me what to search for! Usage: \`${client.commands.get(`urban`).help.usage}\` - `); - let phrase = args.join(" "); - let output = await urban(args.join(' ')).catch(e => { - return message.channel.send("<:error:466995152976871434> No results found for `" + phrase + "`") - }); - - if(output.definition.length > 2000) return message.channel.send( - `<:error:466995152976871434> Definition cannot exceed 2000 characters! Use this link instead: ${output.urbanURL}` - ); - if(output.example.length > 2000) return message.channel.send( - "<:error:466995152976871434> Example cannot exceed 2000 characters!" - ); - - embed = new Discord.MessageEmbed() - .setTitle(output.word) - .setURL(output.urbanURL) - .setColor("#EFFF00") - .setDescription(output.definition || "None") - .addFields( - {name: "Example", value: output.example || "None"}, {name: "Upvotes", value: output.thumbsUp, inline: true}, {name: "Downvotes", value: output.thumbsDown, inline: true} - ) - .setFooter(`Submitted by ${output.author}`) - message.channel.send(embed); - -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: [], - permLevel: "User", - requiredPerms: [] -}; - -exports.help = { - name: "urban", - category: "Fun", - description: "Grabs a definition from the urban dictonary.", - usage: "urban [word]" -}; diff --git a/src/commands/userinfo.js b/src/commands/userinfo.js deleted file mode 100644 index 98d6738..0000000 --- a/src/commands/userinfo.js +++ /dev/null @@ -1,129 +0,0 @@ -const Discord = require("discord.js"); -const coolPeople = require('../../resources/other/coolpeople.json') -exports.run = (client, message, args) => { - var user, guild, status, createdAt, avurl, tag, id; - var nick = "", roles = "", presence = "", badges = ""; - var coolPerson = false; - var friendos = coolPeople.coolPeople; - - if(message.guild) { - user = message.mentions.members.first(); - - if(!args[0]) { - user = message.guild.members.cache.get(message.author.id) - }; - - if (!user) { - var users; - users = client.searchForMembers(message.guild, args[0]); - if (users.length > 1) - return message.channel.send( - "<:error:466995152976871434> Found multiple users! Please be more specific or mention the user instead." - ); - else if (users.length == 0) - return message.channel.send( - "<:error:466995152976871434> That user doesn't seem to exist. Try again!" - ); - user = users[0]; - }; - - if(user.nickname) { - nick = `\n• **Nickname:** ${user.nickname}`; - }; - - for (var i = 0; i < friendos.length; i++) { - if (user.user.id == friendos[i]) - coolPerson = true; - }; - - if(coolPerson == true) { - badges += "🌟" - } - - if(user.user.id == message.guild.ownerID) { - badges += "<:owner:685703193694306331>" - } - - if(user.user.bot) { - badges += "<:bot:686489601678114859>" - } - - - if(badges.length > 0) { - badges += "\n" - } - - user.roles.cache.forEach((role) => { - roles = roles + role.name + "`, `" - }); - - roles = roles.substr(0, roles.length -4); - - guild = `\n• **Roles:** \`${roles}\`\n• **Server join date:** ${user.joinedAt}`; - - id = user.user.id; - tag = user.user.tag; - colour = user.displayHexColor; - avurl = user.user.avatarURL({format: "png", dynamic: true, size: 2048}); - createdAt = user.user.createdAt; - } else { - id = user.id; - tag = user.tag; - colour = ["#ff9d68", "#ff97cb", "#d789ff", "#74FFFF"].random(); - avurl = user.avatarURL({format: "png", dynamic: true, size: 2048}); - createdAt = user.createdAt; - }; - - if(user.presence.status == "online") { - status = `online <:status_online:685462758023626762>` - }; - - if(user.presence.status == "idle") { - status = `idle <:status_idle:685462771529154561>` - }; - - if(user.presence.status == "dnd") { - status = `do not disturb <:status_dnd:685462782963220495>` - }; - - if(user.presence.status == "offline") { - status = `offline <:status_offline:685462758229016633>` - }; - - if(user.presence.activities[0]) { - presence = "\n• **Presence:** "; - if(user.presence.activities[0].type == "PLAYING") { - presence += `Playing ${user.presence.activities[0].name}`; - }; - - if(user.presence.activities[0].type == "STREAMING") { - presence += `Streaming ${user.presence.activities[0].name}`; - }; - - if(user.presence.activities[0].type == "CUSTOM_STATUS") { - presence += `${user.presence.activities[0].state}`; - }; - }; - - embed = new Discord.MessageEmbed(); - embed.setTitle(tag); - embed.setThumbnail(avurl); - embed.setDescription(`${badges}• **ID:** ${id}${nick}\n• **Status:** ${status}${presence}${guild}\n• **Account created:** ${createdAt}`) - embed.setColor(colour); - message.channel.send(embed); -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: ["uinfo", "user"], - permLevel: "User", - requiredPerms: ["EMBED_LINKS"] -}; - -exports.help = { - name: "userinfo", - category: "Utility", - description: "Displays some useful information about the specified user.", - usage: "userinfo " -}; diff --git a/src/commands/weather.js b/src/commands/weather.js deleted file mode 100644 index ef01bc8..0000000 --- a/src/commands/weather.js +++ /dev/null @@ -1,64 +0,0 @@ -const weather = require("weather-js"); -exports.run = async (client, message, args, error) => { - if(!args[0]) { - return message.channel.send( - `<:error:466995152976871434> You didn't give me a location. Usage: \`${client.commands.get(`weather`).help.usage}\`` - ); - }; - - message.channel.startTyping(); - - try { - weather.find({search: args.join(" "), degreeType: 'C'}, function(err, result) { - if(err) return message.channel.send(`<:error:466995152976871434> API error: \`${error}\``) - if(result.length < 2 || !result) { - message.channel.stopTyping(); - return message.channel.send("<:error:466995152976871434> City not found!"); - }; - - var location = result[0].location; - var current = result[0].current; - - var warning = (`${location.alert}` || "No warnings"); - - var embedColour; - if (current.temperature < 0) { - embedColour = "#addeff"; - }else if (current.temperature < 20) { - embedColour = "#4fb8ff"; - }else if (current.temperature < 26) { - embedColour = "#ffea4f"; - }else if (current.temperature < 31) { - embedColour = "#ffa14f" - } else { - embedColour = "#ff614f" - }; - - embed = new Discord.MessageEmbed(); - embed.setAuthor(`Weather for ${location.name}:`) - embed.setDescription(`• **Condition:** ${current.skytext}\n• **Temperature:** ${current.temperature}°C\n• **Feels like:** ${current.feelslike}°C\n• **Humidity:** ${current.humidity}%\n• **Wind:** ${current.winddisplay}\n• **Warnings:** ${warning}`) - embed.setThumbnail(current.imageUrl) - embed.setFooter(`Last updated at ${current.observationtime} ${current.date}`) - embed.setColor(embedColour) - message.channel.stopTyping(); - message.channel.send(embed) - }); - } catch(err) { - return message.channel.send(`<:error:466995152976871434> API error: \`${err}\``) - }; -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: [], - permLevel: "User", - requiredPerms: ["EMBED_LINKS"] -}; - -exports.help = { - name: "weather", - category: "Utility", - description: "Tells you the weather", - usage: "weather [location]" -}; \ No newline at end of file diff --git a/src/commands/welcome.js b/src/commands/welcome.js deleted file mode 100644 index b183b59..0000000 --- a/src/commands/welcome.js +++ /dev/null @@ -1,45 +0,0 @@ -const Discord = require("discord.js") -exports.run = async (client, message, args, level) => { - - const settings = message.settings; - const defaults = client.config.defaultSettings; - const overrides = client.settings.get(message.guild.id); - if (!client.settings.has(message.guild.id)) client.settings.set(message.guild.id, {}); - - if (args[0]) { - const joinedValue = args.join(" "); - if (joinedValue === settings.welcomeMessage) return message.channel.send( - "<:error:466995152976871434> The welcome message is already set to that!" - ); - if (!client.settings.has(message.guild.id)) client.settings.set(message.guild.id, {}); - if (joinedValue === "off") { - if (!client.settings.has(message.guild.id)) client.settings.set(message.guild.id, {}); - client.settings.set(message.guild.id, "off", "welcomeMessage"); - return message.channel.send(`<:success:466995111885144095> Welcome messages have been disabled.`); - } - client.settings.set(message.guild.id, joinedValue, "welcomeMessage"); - client.settings.set(message.guild.id, message.channel.id, "welcomeChannel") - message.channel.send(`<:success:466995111885144095> Set the welcome message to \`${joinedValue}\``); - } else { - if (settings.welcomeMessage === "off") { - message.channel.send(`Welcome messages are off.`) - } else { - message.channel.send(`The current welcome message is: \`${settings.welcomeMessage}\``) - } - } -}; - -exports.conf = { - enabled: true, - guildOnly: true, - aliases: [], - permLevel: "Administrator", - requiredPerms: [] -}; - -exports.help = { - name: "welcome", - category: "Configure", - description: "Sets the welcome message for this server. try using [[server]], [[user]] and [[members]] in your message!", - usage: "welcome [message] **OR** welcome off" -}; diff --git a/src/commands/woomy.js b/src/commands/woomy.js deleted file mode 100644 index a9e17c4..0000000 --- a/src/commands/woomy.js +++ /dev/null @@ -1,33 +0,0 @@ -const Discord = require("discord.js") -exports.run = async (client, message) =>{ - message.channel.send("Woomy!") - - const voiceChannel = message.member.voice.channel; - - if (!voiceChannel) return; - if (!voiceChannel.permissionsFor(message.client.user).has('CONNECT')) return; - if (!voiceChannel.permissionsFor(message.client.user).has('SPEAK')) return; - - if (client.music.getGuild(message.guild.id).playing == true || !client.music.getGuild(message.guild.id).queue[0]) return; - - voiceChannel.join() - .then(connection => { - const dispatcher = connection.play(`/home/container/resources/audio/WOOMY.MP3`); - dispatcher.on("finish", end => {voiceChannel.leave()}); - }) -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: [], - permLevel: "User", - requiredPerms: [] - }; - - exports.help = { - name: "woomy", - category: "Fun", - description: "Woomy!", - usage: "woomy" - }; diff --git a/src/commands/yoda.js b/src/commands/yoda.js deleted file mode 100644 index 496b929..0000000 --- a/src/commands/yoda.js +++ /dev/null @@ -1,33 +0,0 @@ - -const fetch = require("node-fetch") -exports.run = async (client, message, args) => { - const speech = args.join(' '); - if (!speech) { - return message.channel.send(`<:error:466995152976871434> Please include text for me to convert to yodish. Yes.`) - }; - message.channel.startTyping(); - try{ - fetch(`http://yoda-api.appspot.com/api/v1/yodish?text=${encodeURIComponent(speech.toLowerCase())}`) - .then(res => res.json()) - .then(json => message.channel.send(json.yodish)); - message.channel.stopTyping(); - } catch(err) { - message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`); - message.channel.stopTyping(); - }; -}; - -exports.conf = { - enabled: true, - guildOnly: false, - aliases: [], - permLevel: "User", - requiredPerms: [] -}; - - exports.help = { - name: "yoda", - category: "Fun", - description: "Turns any text you input into yodish. Yes.", - usage: "yoda " -}; \ No newline at end of file diff --git a/src/commands/zalgo.js b/src/commands/zalgo.js deleted file mode 100644 index e34d404..0000000 --- a/src/commands/zalgo.js +++ /dev/null @@ -1,30 +0,0 @@ -const zalgo = require("to-zalgo") -exports.run = async (client, message, args) => { - if(!args[0]) { - return message.channel.send(`<:error:466995152976871434> You didn't provide any text! Usage: \`${client.commands.get(`zalgo`).help.usage}\``) - }; - - var output = zalgo(args.join(" ")) - - if(output.length > 2000) { - output = output.slice(0, -Math.abs(output.length - 2000)) - }; - - message.channel.send(output) - }; - - exports.conf = { - enabled: false, - guildOnly: false, - aliases: [], - permLevel: "User", - requiredPerms: [] - }; - - exports.help = { - name: "zalgo", - category: "Fun", - description: "Spoilers every letter in the provided text.", - usage: "zalgo [text]" - }; - \ No newline at end of file diff --git a/src/events/error.js b/src/events/error.js deleted file mode 100644 index 23ce03a..0000000 --- a/src/events/error.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = async (client, error) => { - client.logger.log(`d.js err: \n${JSON.stringify(error.stack)}`, "error"); -}; diff --git a/src/events/guildCreate.js b/src/events/guildCreate.js deleted file mode 100644 index 5f0f47f..0000000 --- a/src/events/guildCreate.js +++ /dev/null @@ -1,15 +0,0 @@ -const Discord = require("discord.js"); -module.exports = (client, guild) => { - client.logger.log(`Guild joined.`, "info"); - - client.settings.ensure(guild.id, client.config.defaultSettings); - - if(client.devmode == false) { - channel = client.channels.cache.get("458896120639127552"); - embed = new Discord.MessageEmbed(); - embed.setColor("#F38159"); - embed.setDescription(`Joined a new server with \`${guild.members.cache.size}\` members! I'm now in \`${client.guilds.cache.size}\` servers.`) - channel.send(embed) - }; -}; - diff --git a/src/events/guildDelete.js b/src/events/guildDelete.js deleted file mode 100644 index a4c582d..0000000 --- a/src/events/guildDelete.js +++ /dev/null @@ -1,20 +0,0 @@ -const Discord = require('discord.js'); -module.exports = (client, guild) => { - client.logger.log(`Guild left.`, "info"); - - if(client.devmode === true) return; - - if(!guild.available) { - return; - }; - - channel = client.channels.cache.get("458896120639127552"); - embed = new Discord.MessageEmbed(); - embed.setColor("#9494FF"); - embed.setDescription(`Left a server. I'm now in \`${client.guilds.cache.size}\` servers.`) - channel.send(embed) - - if (client.settings.has(guild.id)) { - client.settings.delete(guild.id); - }; -}; diff --git a/src/events/guildMemberAdd.js b/src/events/guildMemberAdd.js deleted file mode 100644 index 8e0ac6b..0000000 --- a/src/events/guildMemberAdd.js +++ /dev/null @@ -1,94 +0,0 @@ -module.exports = async (client, member) => { - const settings = client.getSettings(member.guild.id); - - if (settings.welcomeMessage !== "off") { - let chanExists = member.guild.channels.cache.get(settings.welcomeChannel) - if (!chanExists) { - return; - }; - welcomeMessage = settings.welcomeMessage.replace("[[user]]", member.user); - welcomeMessage = welcomeMessage.replace("[[server]]", member.guild.name); - welcomeMessage = welcomeMessage.replace("[[members]]", member.guild.memberCount); - - member.guild.channels - .cache.get(settings.welcomeChannel) - .send(welcomeMessage) - .catch(console.error); - } - - if (settings.autorole !== "off") { - let aRole = member.guild.roles.cache.get(settings.autorole) - if (!aRole) { - return; - }; - await member.roles.add(aRole.id).catch(console.error); - }; - - if(settings.raidMode !== "off") { - if(settings.raidModeStrict == "on") { - member.kick("User bounced.") - - if (settings.chatlogsChannel !== "off") { - const channel = member.guild.channels.cache.find( - channel => channel.name === settings.chatlogsChannel - ); - - if (channel) { - let embed = new Discord.MessageEmbed(); - embed.setColor("#1f1f1f"); - embed.setAuthor("User bounced:", member.user.avatarURL({dynamic: true})); - embed.setDescription(`‏‏‎❯ User: ${member} (${member.user.id})`, true); - embed.setFooter(`New users are being automatically kicked because raidmode is enabled.`) - try { - channel.send(embed); - } catch (err) { - // probably no permissions to send messages/embeds there - }; - }; - return; - } - } - let mRole = member.guild.roles.cache.get(settings.mutedRole) - if (!mRole) { - return; - }; - await member.roles.add(mRole.id).catch(console.error); - if (settings.chatlogsChannel !== "off") { - const channel = member.guild.channels.cache.find( - channel => channel.name === settings.chatlogsChannel - ); - - if (channel) { - let embed = new Discord.MessageEmbed(); - embed.setColor("#1f1f1f"); - embed.setAuthor("User automatically muted:", member.user.avatarURL({dynamic: true})); - embed.setDescription(`‏‏‎❯ User: ${member} (${member.user.id})`, true); - embed.setFooter(`New users are being automatically muted because raidmode is enabled.`) - try { - channel.send(embed); - } catch (err) { - // probably no permissions to send messages/embeds there - }; - }; - }; -}; - - if (settings.chatlogsChannel !== "off") { - const channel = member.guild.channels.cache.find( - channel => channel.name === settings.chatlogsChannel - ); - - if (channel) { - let embed = new Discord.MessageEmbed(); - embed.setColor("#0099e1"); - embed.setAuthor("User joined:", member.user.avatarURL({dynamic: true})); - embed.setDescription(`‏‏‎❯ User: ${member} (${member.user.id})`, true); - try { - channel.send({ embed }); - } catch (err) { - // probably no permissions to send messages/embeds there - }; - }; - }; - -}; diff --git a/src/events/guildMemberRemove.js b/src/events/guildMemberRemove.js deleted file mode 100644 index b632ef1..0000000 --- a/src/events/guildMemberRemove.js +++ /dev/null @@ -1,36 +0,0 @@ -module.exports = async (client, member) => { - const settings = client.getSettings(member.guild.id); - - if (settings.leaveMessage !== "off") { - let chanExists = member.guild.channels.cache.get(settings.welcomeChannel) - if (!chanExists) { - return; - }; - leaveMessage = settings.leaveMessage.replace("[[user]]", member.user); - leaveMessage = leaveMessage.replace("[[server]]", member.guild.name); - leaveMessage = leaveMessage.replace("[[members]]", member.guild.memberCount); - - member.guild.channels - .cache.get(settings.welcomeChannel) - .send(leaveMessage) - .catch(console.error); - }; - - if (settings.chatlogsChannel !== "off") { - const channel = member.guild.channels.cache.find( - channel => channel.name === settings.chatlogsChannel - ); - - if (channel) { - let embed = new Discord.MessageEmbed(); - embed.setColor("#006798"); - embed.setAuthor("User left:", member.user.avatarURL({dynamic: true})); - embed.setDescription(`‏‏‎❯ ${member.user.tag} (${member.user.id})`, true); - try { - channel.send({ embed }); - } catch (err) { - // probably no permissions to send messages/embeds there - }; - }; - }; -}; diff --git a/src/events/message.js b/src/events/message.js deleted file mode 100644 index 7c399a8..0000000 --- a/src/events/message.js +++ /dev/null @@ -1,235 +0,0 @@ -const cooldown = new Set(); -module.exports = async (client, message) => { - if (message.author.bot) return; - - var settings; - - if(message.guild) { - settings = message.settings = client.getSettings(message.guild.id) || client.defaultSettings; - } else { - settings= client.config.defaultSettings; - } - - var prefix = settings.prefix; - - if(client.devmode == true) { - prefix = settings.devprefix; - } - - let blacklisted = false; - - if(message.guild) { - - perms = message.channel.permissionsFor(client.user); - - var modRole = message.guild.roles.cache.get(settings.modRole); - var adminRole = message.guild.roles.cache.get(settings.adminRole); - var autorole = message.guild.roles.cache.get(settings.autorole); - var mutedRole = message.guild.roles.cache.get(settings.mutedRole); - var welcomeChannel = message.guild.channels.cache.get(settings.welcomeChannel); - - if(!welcomeChannel && settings.welcomeChannel != "off" || !adminRole && settings.adminRole != "None set" || !modRole && settings.modRole != "None set" || !mutedRole && settings.mutedRole != "None set" || !autorole && settings.autorole != "off") { - - var adminReset = false; - var modReset = false; - var mutedReset = false; - var autoReset = false; - var welcomeReset = false; - - if(!adminRole && settings.adminRole != "None set") { - var role = message.guild.roles.cache.find(r => r.name === settings.adminRole); - if(!role) { - adminReset = true; - client.settings.set(message.guild.id, client.config.defaultSettings.adminRole, "adminRole"); - } else { - client.settings.set(message.guild.id, role.id, "adminRole"); - }; - }; - - if(!mutedRole && settings.mutedRole != "None set") { - var role = message.guild.roles.cache.find(r => r.name === settings.mutedRole); - if(!role) { - mutedReset = true; - client.settings.set(message.guild.id, client.config.defaultSettings.mutedRole, "mutedRole"); - } else { - client.settings.set(message.guild.id, role.id, "mutedRole"); - }; - }; - - if(!modRole && settings.modRole != "None set") { - var role = message.guild.roles.cache.find(r => r.name === settings.modRole); - if(!role) { - modReset = true; - client.settings.set(message.guild.id, client.config.defaultSettings.modRole, "modRole"); - } else { - client.settings.set(message.guild.id, role.id, "modRole"); - }; - }; - - if(!autorole && settings.autorole != "off") { - var role = message.guild.roles.cache.find(r => r.name === settings.autorole); - if(!role) { - autoReset = true; - client.settings.set(message.guild.id, client.config.defaultSettings.autorole, "autorole"); - } else { - client.settings.set(message.guild.id, role.id, "autorole"); - }; - }; - - if(!welcomeChannel && settings.welcomeChannel != "off") { - var channel = message.guild.channels.cache.find(c => c.name === settings.welcomeChannel); - if(!channel) { - welcomeReset = true; - client.settings.set(message.guild.id, client.config.defaultSettings.welcomeChannel, "welcomeChannel"); - } else { - client.settings.set(message.guild.id, channel.id, "welcomeChannel"); - }; - }; - - var errors = ""; - if(adminReset == true) { - adminReset = false; - errors += ", `admin role`"; - }; - - if(modReset == true) { - modReset = false; - errors += ", `mod role`"; - }; - - if(mutedReset == true) { - mutedReset = false; - errors += ", `muted role`"; - }; - - if(autoReset == true) { - autoReset = false; - errors += ", `autorole`"; - }; - - if(welcomeReset == true) { - welcomeReset = false;; - errors += ", `join/leave channel`"; - }; - - if(errors.length > 1) { - var errors = errors.substr(2); - message.channel.send(`<:error:466995152976871434> A role or channel was deleted, and the following settings have been restored to their default values: ${errors}`); - }; - }; - - if (!message.member) { - await message.guild.members.fetch(message.author); - }; - - if(message.settings.blacklisted != "ARRAY" && settings.blacklisted.length > 0) { - settings.blacklisted.forEach(function(ID) { - if(ID == message.author.id) { - blacklisted = true; - } - }); - }; - }; - - //const prefixMention = new RegExp(`^<@!?${client.user.id}>( |)$`); - const myMention = `<@&${client.user.id}>`; - const myMention2 = `<@!${client.user.id}>`; - - if (message.content.startsWith(myMention) || message.content.startsWith(myMention2)) { - if(message.content.length > myMention.length + 1 && (message.content.substr(0, myMention.length + 1) == myMention + ' ' || message.content.substr(0, myMention2.length + 1) == myMention2 + ' ')) { - prefix = message.content.substr(0, myMention.length) + ' '; - } else { - return message.channel.send(`Current prefix: \`${prefix}\``); - }; - }; - - if (message.content.indexOf(prefix) !== 0) return; - - const args = message.content.slice(prefix.length).trim().split(/ +/g); - const command = args.shift().toLowerCase(); - const cmd = client.commands.get(command) || client.commands.get(client.aliases.get(command)); - - if (!cmd) return; - - if (cooldown.has(message.author.id)) { - return message.channel.send( - `⏱️ You are being ratelimited. Please try again in 2 seconds.` - ).then(msg => { - msg.delete({timeout: 2000}); - }); - }; - - if (message.guild && !perms.has('SEND_MESSAGES')) { - return message.author.send(`<:error:466995152976871434> I don't have permission to speak in **#${message.channel.name}**, Please ask a moderator to give me the send messages permission!`); - }; - - if(message.guild && blacklisted == true) { - try { - return message.author.send( - `<:denied:466995195150336020> You have been blacklisted from using commands in \`${message.guild.name}\`` - ); - } catch(err) { - client.logger.log(err, "error") - }; - }; - - if (cmd && !message.guild && cmd.conf.guildOnly) - return message.channel.send("<:denied:466995195150336020> This command is unavailable in DM's. Try running it in a server I'm in!"); - - if (message.guild) { - var missing = cmd.conf.requiredPerms.filter(p => !perms.has(p)) - if(missing.length > 0) { - missing = "`" + (missing.join("`, `")) + "`"; - return message.channel.send(`<:error:466995152976871434> Missing permissions: ${missing}`) - }; - }; - - const level = client.permlevel(message); - - if(cmd.conf.permLevel == "Developer") { - var isDeveloper; - if(message.client.config.owners.includes(message.author.id)) { - isDeveloper = true; - } - if(isDeveloper != true) { - return message.channel.send("<:denied:466995195150336020> This command can only be used by my developers!") - } - } - - if (level < client.levelCache[cmd.conf.permLevel]) { - var usrlvl = client.levelCache[cmd.conf.permLevel]; - if (usrlvl === 1) var displevel = "Moderator"; - if (usrlvl === 2) var displevel = "Administrator"; - if (usrlvl === 3) var displevel = "Server Owner"; - - if (!modRole && usrlvl < 2 && cmd.conf.permLevel == "Moderator" && message.guild) { - return message.channel.send("<:error:466995152976871434> No moderator role set! Please ask the server owner to set one with `" + message.settings.prefix + "modrole `") - } - - if (!adminRole && usrlvl < 3 && cmd.conf.permLevel == "Administrator" && message.guild) { - return message.channel.send("<:error:466995152976871434> No administrator role set! Please ask the server owner to set one with `" + message.settings.prefix + "adminrole `") - } - - var englesh = "a"; - if (displevel === "Administrator") englesh = "an"; - if (displevel === "Server Owner") englesh = "the"; - return message.channel.send(`<:denied:466995195150336020> You need to be ${englesh} ${displevel} to run this command!`); - } - - message.author.permLevel = level; - - message.flags = []; - while (args[0] && args[0][0] === "-") { - message.flags.push(args.shift().slice(1)); - }; - - cooldown.add(message.author.id); - - setTimeout(() => { - cooldown.delete(message.author.id); - }, 2000); - - client.logger.cmd(`${client.config.permLevels.find(l => l.level === level).name} ${message.author.username} (${message.author.id}) ran command ${cmd.help.name}`); - - cmd.run(client, message, args, level); -}; diff --git a/src/events/messageDelete.js b/src/events/messageDelete.js deleted file mode 100644 index c697f3e..0000000 --- a/src/events/messageDelete.js +++ /dev/null @@ -1,40 +0,0 @@ -const Discord = require("discord.js"); - -module.exports = (client, message) => { - if (message.author.bot) return; - - const settings = (message.settings = client.getSettings(message.guild.id)); - - if (settings.chatlogsChannel !== "off") { - const channel = message.guild.channels.cache.find( - channel => channel.name === settings.chatlogsChannel - ) - - var msg = message.content; - - if(!message.member) { - return; - } - - if(msg.length + message.member.user.username.length + message.member.user.id.length + message.channel.name.length + 2 > 2048) { - return; - } - - if (channel) { - let embed = new Discord.MessageEmbed(); - embed.setColor("#f93a2f"); - embed.setAuthor("Message deleted!", message.member.user.avatarURL({dynamic: true})); - if (msg == "") { - msg = "**An image was deleted, but is not shown for privacy reasons.**" - } else { - msg = `\`${msg}\`` - }// image-only; maybe we can add image logging too but depends privacy (if someone sends like personal stuff accidentally) - embed.setDescription(`❯ Author: ${message.member} (${message.member.user.id})\n❯ Channel: ${message.channel}\n❯ Message: ${msg}`) - try { - channel.send({ embed }); - } catch (err) { - // probably no permissions to send messages/embeds there - }; - }; - }; -}; diff --git a/src/events/messageUpdate.js b/src/events/messageUpdate.js deleted file mode 100644 index c6aa6e8..0000000 --- a/src/events/messageUpdate.js +++ /dev/null @@ -1,40 +0,0 @@ -const Discord = require("discord.js"); - -module.exports = (client, omsg, nmsg) => { - if (nmsg.content === omsg.content) return; - - const settings = (omsg.settings = nmsg.settings = client.getSettings( - nmsg.guild.id - )); - - if (settings.chatlogsChannel !== "off") { - const channel = nmsg.guild.channels.cache.find( - channel => channel.name === settings.chatlogsChannel - ); - - if (channel) { - let embed = new Discord.MessageEmbed(); - embed.setColor("#fff937"); - embed.setAuthor("Message Edited!", nmsg.member.user.avatarURL({dynamic: true})); - if (omsg.content == "") { - omsg.content = "**[IMAGE]**" - } else if (nmsg.content == "") { - nmsg.content = `**[IMAGE]**` - } else { - omsg.content = `\`${omsg.content}\`` - nmsg.content = `\`${nmsg.content}\`` - } - - if(omsg.content.length + nmsg.content.length + nmsg.member.user.username.length + nmsg.member.user.id.length + nmsg.channel.name.length + 2 > 2048) { - return; - } - - embed.setDescription(`• Author: ${nmsg.member} (${nmsg.member.user.id})\n• Channel: ${nmsg.channel}\n• Old message: ${omsg.content}\n• New message: ${nmsg.content}`) - try { - channel.send({ embed }); - } catch (err) { - // probably no permissions to send messages/embeds there - }; - }; - }; -}; diff --git a/src/events/ready.js b/src/events/ready.js deleted file mode 100644 index 532cd8c..0000000 --- a/src/events/ready.js +++ /dev/null @@ -1,60 +0,0 @@ -const moment = require("moment"); -module.exports = client => { - - const timestamp = `${moment().format("YYYY-MM-DD HH:mm:ss")}`; - const activityArray = client.commands.keyArray(); - - client.lockActivity = false; - - let guild, channel, channel1; - - if(client.config.loggingServer.length > 0) { - try { - guild = client.guilds.cache.get(client.config.loggingServer) - } catch(err) { - client.logger.error("Could not find loggingServer server (is the ID valid?):\n" + err); - process.exit(1); - }; - - if(client.config.consoleLogs.length > 0) { - try { - channel1 = guild.channels.cache.get(client.config.consoleLogs) - } catch(err) { - client.logger.error("Could not find consoleLogs channel (is the ID valid?):\n" + err); - process.exit(1); - }; - }; - - if(client.config.startupLogs.length > 0) { - try { - channel = guild.channels.cache.get(client.config.startupLogs) - } catch(err) { - client.logger.error("Could not find startupLogs channel (is the ID valid?):\n" + err); - process.exit(1); - }; - }; - }; - - if(client.devmode == true) { - client.logger.warn("Running in development mode.") - prefix = client.config.defaultSettings.devprefix; - } else { - prefix = client.config.defaultSettings.prefix; - if(channel) { - channel.send(`Bot started at \`${timestamp}\``); - }; - }; - - let randomActivity = activityArray.random(); - - client.user.setActivity(`${prefix + randomActivity} | v${client.version.number}`, {type: "PLAYING"}); - - setInterval(() => { - randomActivity = activityArray.random(); - if(client.lockActivity == false) { - client.user.setActivity(`${prefix + randomActivity} | v${client.version.number}`, {type: "PLAYING"}); - }; - }, 30000); - - client.logger.log(`Connected to Discord as ${client.user.tag} | v${client.version.number}`, 'ready'); -}; diff --git a/src/modules/Logger.js b/src/modules/Logger.js deleted file mode 100644 index e924961..0000000 --- a/src/modules/Logger.js +++ /dev/null @@ -1,90 +0,0 @@ -const chalk = require("chalk"); -const moment = require("moment"); - -exports.log = (content, type = "log") => { - const timestamp = `[${moment().format("YYYY-MM-DD HH:mm:ss")}]`; - - let channel; - - try { - channel = client.guilds.cache.get(client.config.loggingServer).channels.cache.get(client.config.consoleLogs); - } catch(err) {}; - - var logToServer = false; - - if(client.devmode === false && channel && client.guilds.cache.get(client.config.loggingServer).available) { - logToServer = true; - }; - - switch (type) { - case "info": { - try { - if (logToServer == true) { - channel.send(`\`${timestamp}\` \`[${type.toUpperCase()}]\` ` + content); - }; - } catch(err) {}; - return console.log(`${timestamp} ${chalk.cyanBright(`[${type.toUpperCase()}]`)} ${content} `); - }; - - case "warn": { - try { - if (logToServer == true) { - channel.send(`\`${timestamp}\` \`[${type.toUpperCase()}]\` ` + content); - }; - } catch(err) {}; - return console.log(`${timestamp} ${chalk.yellowBright(`[${type.toUpperCase()}]`)} ${content} `); - }; - - case "error": { - try { - if (logToServer == true) { - channel.send(`\`${timestamp}\` \`[${type.toUpperCase()}]\` ` + content); - }; - } catch(err) {} - return console.log(`${timestamp} ${chalk.redBright(`[${type.toUpperCase()}]`)} ${content} `); - }; - - case "debug": { - try { - if (logToServer == true) { - channel.send(`\`${timestamp}\` \`[${type.toUpperCase()}]\` ` + content); - }; - } catch(err) {}; - return console.log(`${timestamp} ${chalk.magentaBright(`[${type.toUpperCase()}]`)} ${content} `); - }; - - case "cmd": { - try { - if (logToServer == true) { - channel.send(`\`${timestamp}\` \`[${type.toUpperCase()}]\` ` + content); - }; - } catch(err) {}; - return console.log(`${timestamp} ${chalk.whiteBright(`[${type.toUpperCase()}]`)} ${content}`); - }; - - case "ready": { - try { - if (logToServer == true) { - channel.send(`\`${timestamp}\` \`[${type.toUpperCase()}]\` ` + content); - }; - } catch(err) {}; - return console.log(`${timestamp} ${chalk.greenBright (`[${type.toUpperCase()}]`)} ${content}`); - }; - - default: throw new TypeError("Logger type must be either warn, debug, info, ready, cmd or error."); - }; -}; - -exports.error = (...args) => this.log(...args, "error"); - -exports.warn = (...args) => this.log(...args, "warn"); - -exports.debug = (...args) => this.log(...args, "debug"); - -exports.info = (...args) => this.log(...args, "info"); - -exports.cmd = (...args) => this.log(...args, "cmd"); - -exports.setClient = function(c) { - client = c; -}; diff --git a/src/modules/functions.js b/src/modules/functions.js deleted file mode 100644 index a30dd4b..0000000 --- a/src/modules/functions.js +++ /dev/null @@ -1,382 +0,0 @@ -const ytdl = require('ytdl-core-discord'); -const youtubeInfo = require('youtube-info'); -const getYoutubeId = require('get-youtube-id'); -const fetch = require('node-fetch'); - -module.exports = client => { - // Permission level function - client.permlevel = message => { - let permlvl = 0; - - const permOrder = client.config.permLevels - .slice(0) - .sort((p, c) => (p.level < c.level ? 1 : -1)); - - while (permOrder.length) { - const currentLevel = permOrder.shift(); - if (message.guild && currentLevel.guildOnly) continue; - if (currentLevel.check(message)) { - permlvl = currentLevel.level; - break; - } - } - return permlvl; - }; - - // Guild settings function - client.getSettings = guild => { - const defaults = client.config.defaultSettings || {}; - if (!guild) return defaults; - const guildData = client.settings.get(guild) || {}; - const returnObject = {}; - Object.keys(defaults).forEach(key => { - returnObject[key] = guildData[key] ? guildData[key] : defaults[key]; - }); - return returnObject; - }; - - // Single line await messages - client.awaitReply = async (msg, question, limit = 60000) => { - const filter = m => m.author.id === msg.author.id; - await msg.channel.send(question); - try { - const collected = await msg.channel.awaitMessages(filter, { - max: 1, - time: limit, - errors: ["time"] - }); - return collected.first().content; - } catch (e) { - return false; - } - }; - - // Message clean function - client.clean = async (client, text) => { - if (text && text.constructor.name == "Promise") text = await text; - if (typeof evaled !== "string") - text = require("util").inspect(text, { depth: 1 }); - - text = text - .replace(/`/g, "`" + String.fromCharCode(8203)) - .replace(/@/g, "@" + String.fromCharCode(8203)) - .replace( - client.token, - "NaKzDzgwNDef1Nitl3YmDAy.tHEvdg.r34L.whl7sTok3N.18n4Ryj094p" - ); - - return text; - }; - - client.loadCommand = commandName => { - try { - const props = require(`../commands/${commandName}`); - if (props.init) { - props.init(client); - } - client.commands.set(props.help.name, props); - props.conf.aliases.forEach(alias => { - client.aliases.set(alias, props.help.name); - }); - return false; - } catch (e) { - return `Failed to load command ${commandName}: ${e}`; - }; - }; - - client.unloadCommand = async commandName => { - let command; - if (client.commands.has(commandName)) { - command = client.commands.get(commandName); - } else if (client.aliases.has(commandName)) { - command = client.commands.get(client.aliases.get(commandName)); - }; - if (!command) - return `<:error:466995152976871434> The command \`${commandName}\` could not be found.`; - - if (command.shutdown) { - await command.shutdown(client); - }; - const mod = require.cache[require.resolve(`../commands/${commandName}`)]; - delete require.cache[require.resolve(`../commands/${commandName}.js`)]; - for (let i = 0; i < mod.parent.children.length; i++) { - if (mod.parent.children[i] === mod) { - mod.parent.children.splice(i, 1); - break; - }; - }; - return false; - }; - - // MEMBER SEARCH - client.searchForMembers = function(guild, query) { - if (!query) return; - query = query.toLowerCase(); - - var a = []; - var b; - - try { - b = guild.members.cache.find(x => x.displayName.toLowerCase() == query); - if (!b) guild.members.cache.find(x => x.user.username.toLowerCase() == query); - } catch (err) {}; - if (b) a.push(b); - guild.members.cache.forEach(member => { - if ( - (member.displayName.toLowerCase().startsWith(query) || - member.user.tag.toLowerCase().startsWith(query)) && - member.id != (b && b.id) - ) { - a.push(member); - }; - }); - return a; - }; - - // USER OBJECT FROM MENTION - client.getUserFromMention = mention => { - if (!mention) return; - - if (mention.startsWith('<@') && mention.endsWith('>')) { - mention = mention.slice(2, -1); - - if (mention.startsWith('!')) { - mention = mention.slice(1); - } - - return client.users.cache.get(mention); - } - } - - - // MUSIC - client.music = {guilds: {}}; - - client.music.isYoutubeLink = function(input) { - return input.startsWith('https://www.youtube.com/') || input.startsWith('http://www.youtube.com/') || input.startsWith('https://youtube.com/') || input.startsWith('http://youtube.com/') || input.startsWith('https://youtu.be/') || input.startsWith('http://youtu.be/') || input.startsWith('http://m.youtube.com/') || input.startsWith('https://m.youtube.com/'); - } - - client.music.search = async function(query) - { - return new Promise(function(resolve, reject) - { - try{ - fetch("https://www.googleapis.com/youtube/v3/search?part=id&type=video&q=" + encodeURIComponent(query) + "&key=" + client.config.ytkey) - .then(res => res.json()) - .then(json => { - if(!json.items) { reject(); return; } - resolve(json.items[0]); - }); - } catch (err) { - client.logger.error("Music search err: ", err); - throw err; - }; - }); - } - - client.music.getGuild = function(id) - { - if(client.music.guilds[id]) return client.music.guilds[id]; - - return client.music.guilds[id] = - { - queue: [], - playing: false, - paused: false, - dispatcher: null, - skippers: [] - } - } - - client.music.getMeta = async function(id) - { - return new Promise(function(resolve, reject) - { - youtubeInfo(id, function(err, videoInfo) - { - if(err) throw err; - - resolve(videoInfo); - }); - }); - } - - client.music.play = async function(message, input, bypassQueue) - { - let voiceChannel = message.member.voice.channel; - if(!voiceChannel) return message.channel.send('<:error:466995152976871434> You need to be in a voice channel to use this command!'); - - let permissions = voiceChannel.permissionsFor(client.user); - if (!permissions.has('CONNECT')) { - return message.channel.send('<:error:466995152976871434> I do not have permission to join your voice channel.'); - } - if (!permissions.has('SPEAK')) { - return message.channel.send('<:error:466995152976871434> I do not have permission to join your voice channel.'); - } - if (voiceChannel.joinable != true) { - return message.channel.send("<:error:466995152976871434> I do not have permission to join your voice channel.") - } - - let id = undefined; - - if(client.music.isYoutubeLink(input)) - { - id = await getYoutubeId(input) - } else { - let item = await client.music.search(input); - if(!item) { - return message.channel.send(`<:error:466995152976871434> No results found.`); - }; - id = item.id.videoId; - } - - if(client.music.getGuild(message.guild.id).queue.length == 0 || bypassQueue) - { - let meta = await client.music.getMeta(id); - - if(!bypassQueue) client.music.getGuild(message.guild.id).queue.push({input: input, id: id, requestedBy: message.author, title: meta.title, author: meta.owner, thumbnail: meta.thumbnailUrl, duration: meta.duration}); - - let connection = await new Promise((resolve, reject) => - { - voiceChannel.join().then((connection) => - { - resolve(connection); - }); - }); - - function end(silent) - { - client.music.getGuild(message.guild.id).queue.shift(); - client.music.getGuild(message.guild.id).dispatcher = null; - - if(client.music.getGuild(message.guild.id).queue.length > 0) - { - client.music.play(message, client.music.getGuild(message.guild.id).queue[0].input, true); - } else { - client.music.getGuild(message.guild.id).playing = false; - - if(!silent) { - message.channel.send("<:play:467216788187512832> Queue is empty! Disconnecting from the voice channel."); - } - - connection.disconnect(); - } - } - - client.music.getGuild(message.guild.id).playing = true; - - let song = client.music.getGuild(message.guild.id).queue[0]; - - try - { - let dispatcher = client.music.getGuild(message.guild.id).dispatcher = connection.play(await ytdl("https://www.youtube.com/watch?v=" + id, {highWaterMark: 1024 * 1024 * 32}), {type: 'opus'}); - - dispatcher.on('finish', (a, b) => - { - end(a == "silent"); - }); - } catch(err) { - message.channel.send('<:error:466995152976871434> Failed to play **' + song.title + '** ' + err); - - end(); - } - - client.music.getGuild(message.guild.id).skippers = []; - message.channel.send(`<:play:467216788187512832> Now playing: **${song.title}**`); - } else { - let meta = await client.music.getMeta(id); - let song = {input: input, id: id, requestedBy: message.author, title: meta.title, author: meta.owner, thumbnail: meta.thumbnailUrl, duration: meta.duration}; - - client.music.getGuild(message.guild.id).queue.push(song); - - message.channel.send(`<:success:466995111885144095> Added to queue: **${song.title}**`); - } - } - - // MUSIC - TIMESTAMP - client.createTimestamp = function(duration){ - hrs = ~~(duration / 60 / 60), - min = ~~(duration / 60) % 60, - sec = ~~(duration - min * 60); - - if(String(hrs).length < 2) { - hrs = "0" + String(hrs) + ":"; - }; - - if(String(min).length < 2) { - min = "0" + String(min); - }; - - if(String(sec).length < 2) { - sec = "0" + String(sec); - }; - - if(hrs == "00:") { - hrs = ""; - } - - var time = hrs + min + ":" + sec; - return time; - }; - - //FIND ROLE - client.findRole = function(input, message) { - var role; - role = message.guild.roles.cache.find(r => r.name.toLowerCase() === input.toLowerCase()); - if(!role) { - role = message.guild.roles.cache.get(input.toLowerCase()); - }; - - if(!role) { - return; - }; - - return role; - }; - - // EMBED COLOUR - client.embedColour = function(msg) { - if(!msg.guild) { - return ["#ff9d68", "#ff97cb", "#d789ff", "#74FFFF"].random(); - } else { - return msg.guild.member(client.user).displayHexColor; - }; - }; - - // FIND RANDOM INT BETWEEN TWO INTEGERS - client.intBetween = function(min, max){ - return Math.round((Math.random() * (max - min))+min); - }; - - - // .toPropercase() returns a proper-cased string - Object.defineProperty(String.prototype, "toProperCase", { - value: function() { - return this.replace( - /([^\W_]+[^\s-]*) */g, - txt => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase() - ); - } - }); - - // .random() returns a single random element from an array - Object.defineProperty(Array.prototype, "random", { - value: function() { - return this[Math.floor(Math.random() * this.length)]; - } - }); - - // `await client.wait(1000);` to "pause" for 1 second. - client.wait = require("util").promisify(setTimeout); - - // These 2 process methods will catch exceptions and give *more details* about the error and stack trace. - process.on("uncaughtException", err => { - const errorMsg = err.stack.replace(new RegExp(`${__dirname}/`, "g"), "./"); - client.logger.error(`Uncaught Exception: ${errorMsg}`); - process.exit(1); - }); - - process.on("unhandledRejection", err => { - client.logger.error(`Unhandled rejection: ${err.stack}`); - }); -}; diff --git a/version.json b/version.json deleted file mode 100644 index 6d6b7a3..0000000 --- a/version.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "number": "1.2.3", - "changelog": "**1.2.0 CHANGELOG:**\n> • Added action commands! (`cuddle`, `feed`, `hug`, `kiss`, `pat`, `poke`, `slap`, `smug`, `tickle`)\n> • Added `fact`\n> • Added `catfact`\n> • Added `dogfact`\n> • Added `yoda`\n> • Added `dice`\n> • Added `spoilerise`\n> • Added `zalgo`\n> • Added `dog`\n> • Added `cat`\n> • Added `lizard`\n> • Added `neko`\n> • Added `nekogif`\n> • Added `kemonomimi`\n> • Added `foxgirl`\n> • Added `identity`\n> • Added `pronouns`\n> • Added `sexuality`\n> • Added `ship`\n> • Renamed `flip to `coinflip` (flip remains as an alias)\n> • Renamed `math` to `calculate` (math is an alias)\n> • @Woomy is now a prefix\n> • Added the `inspire` alias to `inspirobot`\n> • Help now displays the amount of commands in each category\n> • Bots now get a badge in `userinfo`\n> • `roleinfo` now displays what permissions a role has\n> • small changes to `weather`\n> • Woomy now has clear logging of issues that prevent her from starting\n> • request npm module has been swapped out for node-fetch\n**NOTES:**\n> Thank you to Terryiscool160 for creating multiple commands used in this update" -}