From ebfab817d77fabfd1093138888cd8a4bf74ac33f Mon Sep 17 00:00:00 2001 From: TheEssem Date: Fri, 23 Apr 2021 15:03:48 -0500 Subject: [PATCH] Added support for multiple processing emojis, fixed issue with local image processing --- classes/imageCommand.js | 6 +- messages.json | 271 +++++++++++++++++++++------------------- shard.js | 2 +- utils/misc.js | 1 + 4 files changed, 146 insertions(+), 134 deletions(-) diff --git a/classes/imageCommand.js b/classes/imageCommand.js index 910b0c5..7d35808 100644 --- a/classes/imageCommand.js +++ b/classes/imageCommand.js @@ -2,6 +2,8 @@ const Command = require("./command.js"); const magick = require("../utils/image.js"); const imageDetect = require("../utils/imagedetect.js"); const collections = require("../utils/collections.js"); +const { emotes } = require("../messages.json"); +const { random } = require("../utils/misc.js"); class ImageCommand extends Command { /*this.embed = { @@ -58,7 +60,7 @@ class ImageCommand extends Command { magickParams.path = image.path; magickParams.type = image.type; magickParams.url = image.url; // technically not required but can be useful for text filtering - magickParams.delay = image.delay; + magickParams.delay = image.delay ? image.delay : 0; if (this.constructor.requiresGIF) magickParams.onlyGIF = true; } catch (e) { collections.runningCommands.delete(this.message.author.id); @@ -111,7 +113,7 @@ class ImageCommand extends Command { } processMessage(message) { - return message.channel.createMessage(`${process.env.PROCESSING_EMOJI || ""} Processing... This might take a while`); + return message.channel.createMessage(`${random(emotes) || process.env.PROCESSING_EMOJI || ""} Processing... This might take a while`); } static requiresImage = true; diff --git a/messages.json b/messages.json index 6b86be5..3aa0bbc 100644 --- a/messages.json +++ b/messages.json @@ -1,131 +1,140 @@ -[ - "with your sanity", - "h", - "Club Penguin", - "Skype", - "with yo mama", - "with a bootleg plug-and-play", - "FL Studio: SoundCloud Rapper Edition", - "Funny Fortain", - "Fake Download Button Simulator", - "quick i need playing lines for my discord bot", - "a game", - "anime", - "absolutely nothing", - "Mozilla Firefox", - "Google Chrome", - "music bot now I guess", - "Fortnut", - "epic mashups bro", - "Netscape Navigator", - "Ubuntu (worst linux)", - "Linux", - "Hello Kitty Island Adventure", - "with the Infinity Gauntlet", - "BLJ Simulator", - "Jake Paul videos on repeat", - "gniyalP", - "HaaH WaaW", - "Shrek Extra Large", - "dQw4w9WgXcQ", - "Hong Kong 97", - "Twitter", - "Reddit", - "Super Smash Bros. Ultimate", - "Ryujinx", - "Battletoads for Wii", - "MS Paint", - "Roblox", - "Minecraft", - "Desert Bus", - "Mega Man Legends 3", - "Sonic's Schoolhouse", - "Action 52", - "the funny memes epic", - "Nintendo™", - "Wario World", - "the Cat Piano", - "Pac-Man Championship Edition DX+", - "Pac-Man Championship Edition 2", - "Bottom Text", - "The Elder Scrolls 6", - "Skyrim", - "Game Boy Advance Video", - "Nintendo Switch Online", - "lol 7", - "Meme Run", - "Yoshi for the NES", - "Family Guy", - "Deltarune", - "subscribe to obama", - "yeah", - "semicolon", - "Super Mario Maker 2", - "jeff", - "TikTok", - "woo yeah", - "Mario", - "Microsoft Internet Explorer", - "joe mama", - "Sonic 06", - "Wii Speak Channel", - "Metal Gear Solid 4", - "iPod Music", - "Liquid Sun", - "with your Discord server", - "Scatman's World", - "with a stone, Luigi.", - "Doin' Your Mom by FAttY Spins", - "with a broken god", - "games with the mortals", - "#BringBackNationalSex", - "chiptune", - "foobar2000", - "XMPlay", - "OpenMPT", - "follow @esmBot_ on Twitter", - "with GIFs", - "check out more stuff at projectlounge.pw", - "the", - "sissy hypnosis", - "Yandere Simulator", - "PogChamp", - "yourself", - "sentience", - "with Brody Foxx", - "AOL Instant Messenger", - "beep boop", - "Animal Crossing: New Horizons", - "Hello, Gordon!", - "the j", - "Want esmBot to play some new games? Send suggestions!", - "MilkyTracker", - "with chimps", - "with the TF2 source code", - "alvin the chipmunk nightcore", - "Troll", - "ay yo the pizza here", - "100 gecs", - "with limited resources", - "messages from 2018", - "&caption get real", - "Open Fortress", - "btw I use arch", - "Friday Night Funkin", - "fgsfds", - "Doilus Stage", - "please report any issues you find thank you", - "xfce real", - "OpenRCT2", - "Sus? As in the popular video game Among Us?", - "$19 Fortnite Card", - "Wild Woody", - "RDI Halcyon", - "cry about it", - "KFC", - "Cave Story", - "YouTube ads", - "there are federal agents outside my house", - "less goo", - "WhatsApp" -] \ No newline at end of file +{ + "emotes": [ + "", + "", + "" + ], + "messages": [ + "with your sanity", + "h", + "Club Penguin", + "Skype", + "with yo mama", + "with a bootleg plug-and-play", + "FL Studio: SoundCloud Rapper Edition", + "Funny Fortain", + "Fake Download Button Simulator", + "quick i need playing lines for my discord bot", + "a game", + "anime", + "absolutely nothing", + "Mozilla Firefox", + "Google Chrome", + "music bot now I guess", + "Fortnut", + "epic mashups bro", + "Netscape Navigator", + "Ubuntu (worst linux)", + "Linux", + "Hello Kitty Island Adventure", + "with the Infinity Gauntlet", + "BLJ Simulator", + "Jake Paul videos on repeat", + "gniyalP", + "HaaH WaaW", + "Shrek Extra Large", + "dQw4w9WgXcQ", + "Hong Kong 97", + "Twitter", + "Reddit", + "Super Smash Bros. Ultimate", + "Ryujinx", + "Battletoads for Wii", + "MS Paint", + "Roblox", + "Minecraft", + "Desert Bus", + "Mega Man Legends 3", + "Sonic's Schoolhouse", + "Action 52", + "the funny memes epic", + "Nintendo™", + "Wario World", + "the Cat Piano", + "Pac-Man Championship Edition DX+", + "Pac-Man Championship Edition 2", + "Bottom Text", + "The Elder Scrolls 6", + "Skyrim", + "Game Boy Advance Video", + "Nintendo Switch Online", + "lol 7", + "Meme Run", + "Yoshi for the NES", + "Family Guy", + "Deltarune", + "subscribe to obama", + "yeah", + "semicolon", + "Super Mario Maker 2", + "jeff", + "TikTok", + "woo yeah", + "Mario", + "Microsoft Internet Explorer", + "joe mama", + "Sonic 06", + "Wii Speak Channel", + "Metal Gear Solid 4", + "iPod Music", + "Liquid Sun", + "with your Discord server", + "Scatman's World", + "with a stone, Luigi.", + "Doin' Your Mom by FAttY Spins", + "with a broken god", + "games with the mortals", + "#BringBackNationalSex", + "chiptune", + "foobar2000", + "XMPlay", + "OpenMPT", + "follow @esmBot_ on Twitter", + "with GIFs", + "check out more stuff at projectlounge.pw", + "the", + "sissy hypnosis", + "Yandere Simulator", + "PogChamp", + "yourself", + "sentience", + "with Brody Foxx", + "AOL Instant Messenger", + "beep boop", + "Animal Crossing: New Horizons", + "Hello, Gordon!", + "the j", + "Want esmBot to play some new games? Send suggestions!", + "MilkyTracker", + "with chimps", + "with the TF2 source code", + "alvin the chipmunk nightcore", + "Troll", + "ay yo the pizza here", + "100 gecs", + "with limited resources", + "messages from 2018", + "&caption get real", + "Open Fortress", + "btw I use arch", + "Friday Night Funkin", + "fgsfds", + "Doilus Stage", + "please report any issues you find thank you", + "xfce real", + "OpenRCT2", + "Sus? As in the popular video game Among Us?", + "$19 Fortnite Card", + "Wild Woody", + "RDI Halcyon", + "cry about it", + "KFC", + "Cave Story", + "YouTube ads", + "there are federal agents outside my house", + "less goo", + "WhatsApp", + "Half Life 3", + "Tower Defense Simulator" + ] +} \ No newline at end of file diff --git a/shard.js b/shard.js index 02b5732..080f9d4 100644 --- a/shard.js +++ b/shard.js @@ -15,7 +15,7 @@ const database = require("./utils/database.js"); // command collections const collections = require("./utils/collections.js"); // playing messages -const messages = require("./messages.json"); +const { messages } = require("./messages.json"); // other stuff const misc = require("./utils/misc.js"); // generate help page diff --git a/utils/misc.js b/utils/misc.js index 2a9d47b..2194825 100644 --- a/utils/misc.js +++ b/utils/misc.js @@ -2,6 +2,7 @@ const util = require("util"); // random(array) to select a random entry in array exports.random = (array) => { + if (!array || array.length < 1) return null; return array[Math.floor(Math.random() * array.length)]; };