diff --git a/assets/images/retro.png b/assets/images/retro.png deleted file mode 100644 index 2152ae8..0000000 Binary files a/assets/images/retro.png and /dev/null differ diff --git a/assets/images/trump.png b/assets/images/trump.png deleted file mode 100644 index 119d7dc..0000000 Binary files a/assets/images/trump.png and /dev/null differ diff --git a/assets/images/whodidthis.png b/assets/images/whodidthis.png deleted file mode 100644 index ae04d53..0000000 Binary files a/assets/images/whodidthis.png and /dev/null differ diff --git a/commands/fun/cowsay.js b/commands/fun/cowsay.js deleted file mode 100644 index db56987..0000000 --- a/commands/fun/cowsay.js +++ /dev/null @@ -1,23 +0,0 @@ -import { say } from "cowsay2"; -import cows from "cowsay2/cows/index.js"; -import Command from "../../classes/command.js"; - -class CowsayCommand extends Command { - async run() { - if (this.args.length === 0) { - return "You need to provide some text for the cow to say!"; - } else if (cows[this.args[0].toLowerCase()] != undefined) { - const cow = cows[this.args.shift().toLowerCase()]; - return `\`\`\`\n${say(this.args.join(" "), { cow })}\n\`\`\``; - } else { - return `\`\`\`\n${say(this.args.join(" "))}\n\`\`\``; - } - } - - static description = "Makes an ASCII cow say a message"; - static aliases = ["cow"]; - static arguments = ["{cow}", "[text]"]; - static slashAllowed = false; -} - -export default CowsayCommand; \ No newline at end of file diff --git a/commands/fun/fullwidth.js b/commands/fun/fullwidth.js deleted file mode 100644 index 4b49c79..0000000 --- a/commands/fun/fullwidth.js +++ /dev/null @@ -1,15 +0,0 @@ -import Command from "../../classes/command.js"; - -class FullwidthCommand extends Command { - async run() { - if (this.args.length === 0) return "You need to provide some text to convert to fullwidth!"; - return this.args.join("").replaceAll(/[A-Za-z0-9]/g, (s) => { return String.fromCharCode(s.charCodeAt(0) + 0xFEE0); }); - } - - static description = "Converts a message to fullwidth/aesthetic text"; - static aliases = ["aesthetic", "aesthetics", "aes"]; - static arguments = ["[text]"]; - static slashAllowed = false; -} - -export default FullwidthCommand; \ No newline at end of file diff --git a/commands/fun/retro.js b/commands/fun/retro.js deleted file mode 100644 index b949d31..0000000 --- a/commands/fun/retro.js +++ /dev/null @@ -1,33 +0,0 @@ -import wrap from "../../utils/wrap.js"; -import ImageCommand from "../../classes/imageCommand.js"; - -class RetroCommand extends ImageCommand { - params() { - let [line1, line2, line3] = this.args.join(" ").replaceAll("&", "\\&").replaceAll(">", "\\>").replaceAll("<", "\\<").replaceAll("\"", "\\"").replaceAll("'", "\\'").replaceAll("%", "\\%").split(",").map(elem => elem.trim()); - if (!line2 && line1.length > 15) { - const [split1, split2, split3] = wrap(line1, { width: 15, indent: "" }).split("\n"); - line1 = split1; - line2 = split2 ?? ""; - line3 = split3 ?? ""; - } else { - if (!line2) { - line2 = ""; - } - if (!line3) { - line3 = ""; - } - } - return { line1, line2, line3 }; - } - - static description = "Generates a retro text image (separate lines with a comma)"; - static arguments = ["[top text]", "{middle text}", "{bottom text}"]; - - static requiresImage = false; - static requiresText = true; - static noText = "You need to provide some text to make retro!"; - static command = "retro"; - static slashAllowed = false; -} - -export default RetroCommand; diff --git a/commands/fun/rps.js b/commands/fun/rps.js deleted file mode 100644 index 07052ed..0000000 --- a/commands/fun/rps.js +++ /dev/null @@ -1,35 +0,0 @@ -import { random } from "../../utils/misc.js"; -import Command from "../../classes/command.js"; - -class RPSCommand extends Command { - async run() { - if (this.args.length === 0 || (this.args[0] !== "rock" && this.args[0] !== "paper" && this.args[0] !== "scissors")) return "You need to choose whether you want to be rock, paper, or scissors!"; - let emoji; - let winOrLose; - const result = random(["rock", "paper", "scissors"]); - switch (result) { - case "rock": - emoji = "✊"; - if (this.args[0].toLowerCase() === "paper") winOrLose = true; - break; - case "paper": - emoji = "✋"; - if (this.args[0].toLowerCase() === "scissors") winOrLose = true; - break; - case "scissors": - emoji = "✌"; - if (this.args[0].toLowerCase() === "rock") winOrLose = true; - break; - default: - break; - } - return this.args[0].toLowerCase() === result ? `${emoji} I chose ${result}. It's a tie!` : `${emoji} I chose ${result}. ${winOrLose ? "You win!" : "You lose!"}`; - } - - static description = "Plays rock, paper, scissors with me"; - static aliases = ["rockpaperscissors"]; - static arguments = ["[rock/paper/scissors]"]; - static slashAllowed = false; -} - -export default RPSCommand; \ No newline at end of file diff --git a/commands/fun/xkcd.js b/commands/fun/xkcd.js deleted file mode 100644 index eb32b5c..0000000 --- a/commands/fun/xkcd.js +++ /dev/null @@ -1,31 +0,0 @@ -import fetch from "node-fetch"; -import Command from "../../classes/command.js"; - -class XKCDCommand extends Command { - async run() { - const url = this.args.length > 0 && this.args[0].match(/^\d+$/) ? `http://xkcd.com/${this.args[0]}/info.0.json` : "http://xkcd.com/info.0.json"; - try { - const request = await fetch(url); - const json = await request.json(); - return { - embeds: [{ - title: json.safe_title, - url: `https://xkcd.com/${json.num}`, - color: 16711680, - description: json.alt, - image: { - url: json.img - } - }] - }; - } catch { - return "I couldn't get that XKCD!"; - } - } - - static description = "Gets an XKCD comic"; - static arguments = ["{id}"]; - static slashAllowed = false; -} - -export default XKCDCommand; \ No newline at end of file diff --git a/commands/general/invite.js b/commands/general/invite.js deleted file mode 100644 index 80fddcb..0000000 --- a/commands/general/invite.js +++ /dev/null @@ -1,13 +0,0 @@ -import Command from "../../classes/command.js"; - -class InviteCommand extends Command { - async run() { - return "You can invite me to your server here: "; - } - - static description = "Gets my invite link"; - static aliases = ["botinfo", "credits"]; - static slashAllowed = false; -} - -export default InviteCommand; \ No newline at end of file diff --git a/commands/image-editing/wdt.js b/commands/image-editing/wdt.js deleted file mode 100644 index 956d992..0000000 --- a/commands/image-editing/wdt.js +++ /dev/null @@ -1,11 +0,0 @@ -import ImageCommand from "../../classes/imageCommand.js"; - -class WhoDidThisCommand extends ImageCommand { - static description = "Creates a \"WHO DID THIS\" meme from an image"; - static aliases = ["whodidthis"]; - - static noImage = "You need to provide an image/GIF to make a \"who did this\" meme!"; - static command = "wdt"; -} - -export default WhoDidThisCommand; diff --git a/natives/blur.cc b/natives/blur.cc index 6856b06..0052a89 100644 --- a/natives/blur.cc +++ b/natives/blur.cc @@ -1,7 +1,5 @@ #include -#include -#include #include using namespace std; diff --git a/natives/image.cc b/natives/image.cc index 983dc42..dab0e2a 100644 --- a/natives/image.cc +++ b/natives/image.cc @@ -1,5 +1,4 @@ #include -#include #include "blur.h" #include "colors.h" #include "caption.h" @@ -23,7 +22,6 @@ #include "motivate.h" #include "reddit.h" #include "resize.h" -#include "retro.h" #include "reverse.h" #include "scott.h" #include "snapchat.h" @@ -34,7 +32,6 @@ #include "uncaption.h" #include "wall.h" #include "watermark.h" -#include "wdt.h" #include "whisper.h" #include "zamn.h" @@ -72,7 +69,6 @@ Napi::Object Init(Napi::Env env, Napi::Object exports) exports.Set(Napi::String::New(env, "motivate"), Napi::Function::New(env, Motivate)); exports.Set(Napi::String::New(env, "reddit"), Napi::Function::New(env, Reddit)); exports.Set(Napi::String::New(env, "resize"), Napi::Function::New(env, Resize)); - exports.Set(Napi::String::New(env, "retro"), Napi::Function::New(env, Retro)); exports.Set(Napi::String::New(env, "reverse"), Napi::Function::New(env, Reverse)); exports.Set(Napi::String::New(env, "scott"), Napi::Function::New(env, Scott)); exports.Set(Napi::String::New(env, "snapchat"), Napi::Function::New(env, Snapchat)); @@ -84,7 +80,6 @@ Napi::Object Init(Napi::Env env, Napi::Object exports) exports.Set(Napi::String::New(env, "uncaption"), Napi::Function::New(env, Uncaption)); exports.Set(Napi::String::New(env, "wall"), Napi::Function::New(env, Wall)); exports.Set(Napi::String::New(env, "watermark"), Napi::Function::New(env, Watermark)); - exports.Set(Napi::String::New(env, "wdt"), Napi::Function::New(env, Wdt)); exports.Set(Napi::String::New(env, "whisper"), Napi::Function::New(env, Whisper)); exports.Set(Napi::String::New(env, "zamn"), Napi::Function::New(env, Zamn)); return exports; diff --git a/natives/retro.cc b/natives/retro.cc deleted file mode 100644 index f636b54..0000000 --- a/natives/retro.cc +++ /dev/null @@ -1,91 +0,0 @@ -#include -#include - -#include - -using namespace std; -using namespace Magick; - -Napi::Value Retro(const Napi::CallbackInfo &info) { - Napi::Env env = info.Env(); - - try { - Napi::Object obj = info[0].As(); - string line1 = obj.Get("line1").As().Utf8Value(); - string line2 = obj.Get("line2").As().Utf8Value(); - string line3 = obj.Get("line3").As().Utf8Value(); - string basePath = obj.Get("basePath").As().Utf8Value(); - - Blob blob; - - Image image; - Image line1_text; - Image line2_text; - Image line3_text; - - image.read(basePath + "assets/images/retro.png"); - - line2_text.backgroundColor("none"); - line2_text.fontPointsize(128); - line2_text.textGravity(Magick::CenterGravity); - line2_text.font("Comic Sans MS"); - line2_text.read("pango:" + - (line2 == "" ? line1 : line2) + ""); - line2_text.extent(Geometry("1260x859+0+0"), Magick::CenterGravity); - Image line2_text_fill = line2_text; - line2_text_fill.channel(Magick::AlphaChannel); - line2_text_fill.morphology(Magick::EdgeOutMorphology, "Octagon:10"); - line2_text_fill.backgroundColor("gray"); - line2_text_fill.alphaChannel(Magick::ShapeAlphaChannel); - line2_text.composite(line2_text_fill, Magick::CenterGravity, - Magick::DstOverCompositeOp); - image.composite(line2_text, Geometry("+0-100"), Magick::OverCompositeOp); - - if (line2 != "") { - line1_text.backgroundColor("none"); - line1_text.fontPointsize(64); - line1_text.textGravity(Magick::CenterGravity); - line1_text.font("Comic Sans MS"); - line1_text.read("pango:" + line1 + ""); - line1_text.extent(Geometry("1260x859+0+0"), Magick::CenterGravity); - Image line1_text_fill = line1_text; - line1_text_fill.channel(Magick::AlphaChannel); - line1_text_fill.morphology(Magick::EdgeOutMorphology, "Octagon:10"); - line1_text_fill.backgroundColor("gray"); - line1_text_fill.alphaChannel(Magick::ShapeAlphaChannel); - line1_text.composite(line1_text_fill, Magick::CenterGravity, - Magick::DstOverCompositeOp); - image.composite(line1_text, Geometry("+0-250"), Magick::OverCompositeOp); - } - - if (line3 != "") { - line3_text.backgroundColor("none"); - line3_text.fontPointsize(64); - line3_text.textGravity(Magick::CenterGravity); - line3_text.font("Comic Sans MS"); - line3_text.read("pango:" + line3 + ""); - line3_text.extent(Geometry("1260x859+0+0"), Magick::CenterGravity); - Image line3_text_fill = line3_text; - line3_text_fill.channel(Magick::AlphaChannel); - line3_text_fill.morphology(Magick::EdgeOutMorphology, "Octagon:10"); - line3_text_fill.backgroundColor("gray"); - line3_text_fill.alphaChannel(Magick::ShapeAlphaChannel); - line3_text.composite(line3_text_fill, Magick::CenterGravity, - Magick::DstOverCompositeOp); - image.composite(line3_text, Geometry("+0+50"), Magick::OverCompositeOp); - } - - image.magick("PNG"); - image.write(&blob); - - Napi::Object result = Napi::Object::New(env); - result.Set("data", Napi::Buffer::Copy(env, (char *)blob.data(), - blob.length())); - result.Set("type", "png"); - return result; - } catch (std::exception const &err) { - throw Napi::Error::New(env, err.what()); - } catch (...) { - throw Napi::Error::New(env, "Unknown error"); - } -} \ No newline at end of file diff --git a/natives/retro.h b/natives/retro.h deleted file mode 100644 index 824d284..0000000 --- a/natives/retro.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#include - -Napi::Value Retro(const Napi::CallbackInfo& info); diff --git a/natives/reverse.cc b/natives/reverse.cc index b3ef222..1ebb6f8 100644 --- a/natives/reverse.cc +++ b/natives/reverse.cc @@ -1,7 +1,5 @@ #include -#include -#include #include using namespace std; diff --git a/natives/wdt.cc b/natives/wdt.cc deleted file mode 100644 index 0a09dff..0000000 --- a/natives/wdt.cc +++ /dev/null @@ -1,66 +0,0 @@ -#include -#include - -#include -#include - -using namespace std; -using namespace Magick; - -Napi::Value Wdt(const Napi::CallbackInfo &info) { - Napi::Env env = info.Env(); - - try { - Napi::Object obj = info[0].As(); - Napi::Buffer data = obj.Get("data").As>(); - string type = obj.Get("type").As().Utf8Value(); - string basePath = obj.Get("basePath").As().Utf8Value(); - - Blob blob; - - list frames; - list coalesced; - list mid; - Image watermark; - try { - readImages(&frames, Blob(data.Data(), data.Length())); - } catch (Magick::WarningCoder &warning) { - cerr << "Coder Warning: " << warning.what() << endl; - } catch (Magick::Warning &warning) { - cerr << "Warning: " << warning.what() << endl; - } - watermark.read(basePath + "assets/images/whodidthis.png"); - coalesceImages(&coalesced, frames.begin(), frames.end()); - - for (Image &image : coalesced) { - Image watermark_new = watermark; - image.scale(Geometry("374x374>")); - watermark_new.composite(image, Magick::CenterGravity, - Magick::OverCompositeOp); - watermark_new.magick(type); - watermark_new.animationDelay(image.animationDelay()); - mid.push_back(watermark_new); - } - - optimizeTransparency(mid.begin(), mid.end()); - - if (type == "gif") { - for (Image &image : mid) { - image.quantizeDitherMethod(FloydSteinbergDitherMethod); - image.quantize(); - } - } - - writeImages(mid.begin(), mid.end(), &blob); - - Napi::Object result = Napi::Object::New(env); - result.Set("data", Napi::Buffer::Copy(env, (char *)blob.data(), - blob.length())); - result.Set("type", type); - return result; - } catch (std::exception const &err) { - throw Napi::Error::New(env, err.what()); - } catch (...) { - throw Napi::Error::New(env, "Unknown error"); - } -} \ No newline at end of file diff --git a/natives/wdt.h b/natives/wdt.h deleted file mode 100644 index 5c85164..0000000 --- a/natives/wdt.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#include - -Napi::Value Wdt(const Napi::CallbackInfo& info);