Added support for multiple processing emojis, fixed issue with local image processing

This commit is contained in:
TheEssem 2021-04-23 15:03:48 -05:00
parent 4e4ae3613f
commit ebfab817d7
4 changed files with 146 additions and 134 deletions

View file

@ -2,6 +2,8 @@ const Command = require("./command.js");
const magick = require("../utils/image.js"); const magick = require("../utils/image.js");
const imageDetect = require("../utils/imagedetect.js"); const imageDetect = require("../utils/imagedetect.js");
const collections = require("../utils/collections.js"); const collections = require("../utils/collections.js");
const { emotes } = require("../messages.json");
const { random } = require("../utils/misc.js");
class ImageCommand extends Command { class ImageCommand extends Command {
/*this.embed = { /*this.embed = {
@ -58,7 +60,7 @@ class ImageCommand extends Command {
magickParams.path = image.path; magickParams.path = image.path;
magickParams.type = image.type; magickParams.type = image.type;
magickParams.url = image.url; // technically not required but can be useful for text filtering 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; if (this.constructor.requiresGIF) magickParams.onlyGIF = true;
} catch (e) { } catch (e) {
collections.runningCommands.delete(this.message.author.id); collections.runningCommands.delete(this.message.author.id);
@ -111,7 +113,7 @@ class ImageCommand extends Command {
} }
processMessage(message) { processMessage(message) {
return message.channel.createMessage(`${process.env.PROCESSING_EMOJI || "<a:processing:479351417102925854>"} Processing... This might take a while`); return message.channel.createMessage(`${random(emotes) || process.env.PROCESSING_EMOJI || "<a:processing:479351417102925854>"} Processing... This might take a while`);
} }
static requiresImage = true; static requiresImage = true;

View file

@ -1,131 +1,140 @@
[ {
"with your sanity", "emotes": [
"h", "<a:processing:818243325891051581>",
"Club Penguin", "<a:glxgears:802272302082293770>",
"Skype", "<a:spunchbob:834829415661568000>"
"with yo mama", ],
"with a bootleg plug-and-play", "messages": [
"FL Studio: SoundCloud Rapper Edition", "with your sanity",
"Funny Fortain", "h",
"Fake Download Button Simulator", "Club Penguin",
"quick i need playing lines for my discord bot", "Skype",
"a game", "with yo mama",
"anime", "with a bootleg plug-and-play",
"absolutely nothing", "FL Studio: SoundCloud Rapper Edition",
"Mozilla Firefox", "Funny Fortain",
"Google Chrome", "Fake Download Button Simulator",
"music bot now I guess", "quick i need playing lines for my discord bot",
"Fortnut", "a game",
"epic mashups bro", "anime",
"Netscape Navigator", "absolutely nothing",
"Ubuntu (worst linux)", "Mozilla Firefox",
"Linux", "Google Chrome",
"Hello Kitty Island Adventure", "music bot now I guess",
"with the Infinity Gauntlet", "Fortnut",
"BLJ Simulator", "epic mashups bro",
"Jake Paul videos on repeat", "Netscape Navigator",
"gniyalP", "Ubuntu (worst linux)",
"HaaH WaaW", "Linux",
"Shrek Extra Large", "Hello Kitty Island Adventure",
"dQw4w9WgXcQ", "with the Infinity Gauntlet",
"Hong Kong 97", "BLJ Simulator",
"Twitter", "Jake Paul videos on repeat",
"Reddit", "gniyalP",
"Super Smash Bros. Ultimate", "HaaH WaaW",
"Ryujinx", "Shrek Extra Large",
"Battletoads for Wii", "dQw4w9WgXcQ",
"MS Paint", "Hong Kong 97",
"Roblox", "Twitter",
"Minecraft", "Reddit",
"Desert Bus", "Super Smash Bros. Ultimate",
"Mega Man Legends 3", "Ryujinx",
"Sonic's Schoolhouse", "Battletoads for Wii",
"Action 52", "MS Paint",
"the funny memes epic", "Roblox",
"Nintendo™", "Minecraft",
"Wario World", "Desert Bus",
"the Cat Piano", "Mega Man Legends 3",
"Pac-Man Championship Edition DX+", "Sonic's Schoolhouse",
"Pac-Man Championship Edition 2", "Action 52",
"Bottom Text", "the funny memes epic",
"The Elder Scrolls 6", "Nintendo™",
"Skyrim", "Wario World",
"Game Boy Advance Video", "the Cat Piano",
"Nintendo Switch Online", "Pac-Man Championship Edition DX+",
"lol 7", "Pac-Man Championship Edition 2",
"Meme Run", "Bottom Text",
"Yoshi for the NES", "The Elder Scrolls 6",
"Family Guy", "Skyrim",
"Deltarune", "Game Boy Advance Video",
"subscribe to obama", "Nintendo Switch Online",
"yeah", "lol 7",
"semicolon", "Meme Run",
"Super Mario Maker 2", "Yoshi for the NES",
"jeff", "Family Guy",
"TikTok", "Deltarune",
"woo yeah", "subscribe to obama",
"Mario", "yeah",
"Microsoft Internet Explorer", "semicolon",
"joe mama", "Super Mario Maker 2",
"Sonic 06", "jeff",
"Wii Speak Channel", "TikTok",
"Metal Gear Solid 4", "woo yeah",
"iPod Music", "Mario",
"Liquid Sun", "Microsoft Internet Explorer",
"with your Discord server", "joe mama",
"Scatman's World", "Sonic 06",
"with a stone, Luigi.", "Wii Speak Channel",
"Doin' Your Mom by FAttY Spins", "Metal Gear Solid 4",
"with a broken god", "iPod Music",
"games with the mortals", "Liquid Sun",
"#BringBackNationalSex", "with your Discord server",
"chiptune", "Scatman's World",
"foobar2000", "with a stone, Luigi.",
"XMPlay", "Doin' Your Mom by FAttY Spins",
"OpenMPT", "with a broken god",
"follow @esmBot_ on Twitter", "games with the mortals",
"with GIFs", "#BringBackNationalSex",
"check out more stuff at projectlounge.pw", "chiptune",
"the", "foobar2000",
"sissy hypnosis", "XMPlay",
"Yandere Simulator", "OpenMPT",
"PogChamp", "follow @esmBot_ on Twitter",
"yourself", "with GIFs",
"sentience", "check out more stuff at projectlounge.pw",
"with Brody Foxx", "the",
"AOL Instant Messenger", "sissy hypnosis",
"beep boop", "Yandere Simulator",
"Animal Crossing: New Horizons", "PogChamp",
"Hello, Gordon!", "yourself",
"the j", "sentience",
"Want esmBot to play some new games? Send suggestions!", "with Brody Foxx",
"MilkyTracker", "AOL Instant Messenger",
"with chimps", "beep boop",
"with the TF2 source code", "Animal Crossing: New Horizons",
"alvin the chipmunk nightcore", "Hello, Gordon!",
"Troll", "the j",
"ay yo the pizza here", "Want esmBot to play some new games? Send suggestions!",
"100 gecs", "MilkyTracker",
"with limited resources", "with chimps",
"messages from 2018", "with the TF2 source code",
"&caption get real", "alvin the chipmunk nightcore",
"Open Fortress", "Troll",
"btw I use arch", "ay yo the pizza here",
"Friday Night Funkin", "100 gecs",
"fgsfds", "with limited resources",
"Doilus Stage", "messages from 2018",
"please report any issues you find thank you", "&caption get real",
"xfce real", "Open Fortress",
"OpenRCT2", "btw I use arch",
"Sus? As in the popular video game Among Us?", "Friday Night Funkin",
"$19 Fortnite Card", "fgsfds",
"Wild Woody", "Doilus Stage",
"RDI Halcyon", "please report any issues you find thank you",
"cry about it", "xfce real",
"KFC", "OpenRCT2",
"Cave Story", "Sus? As in the popular video game Among Us?",
"YouTube ads", "$19 Fortnite Card",
"there are federal agents outside my house", "Wild Woody",
"less goo", "RDI Halcyon",
"WhatsApp" "cry about it",
] "KFC",
"Cave Story",
"YouTube ads",
"there are federal agents outside my house",
"less goo",
"WhatsApp",
"Half Life 3",
"Tower Defense Simulator"
]
}

View file

@ -15,7 +15,7 @@ const database = require("./utils/database.js");
// command collections // command collections
const collections = require("./utils/collections.js"); const collections = require("./utils/collections.js");
// playing messages // playing messages
const messages = require("./messages.json"); const { messages } = require("./messages.json");
// other stuff // other stuff
const misc = require("./utils/misc.js"); const misc = require("./utils/misc.js");
// generate help page // generate help page

View file

@ -2,6 +2,7 @@ const util = require("util");
// random(array) to select a random entry in array // random(array) to select a random entry in array
exports.random = (array) => { exports.random = (array) => {
if (!array || array.length < 1) return null;
return array[Math.floor(Math.random() * array.length)]; return array[Math.floor(Math.random() * array.length)];
}; };