From ad87722fd2bdeb4607333044f14d53f31c8f1319 Mon Sep 17 00:00:00 2001 From: TheEssem Date: Thu, 13 May 2021 17:19:28 -0500 Subject: [PATCH] Changed blurple to reflect the new Discord rebrand --- commands/image-editing/blurple.js | 7 +++++++ natives/blurple.cc | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/commands/image-editing/blurple.js b/commands/image-editing/blurple.js index e411c5f..fb88a6c 100644 --- a/commands/image-editing/blurple.js +++ b/commands/image-editing/blurple.js @@ -1,7 +1,14 @@ const ImageCommand = require("../../classes/imageCommand.js"); class BlurpleCommand extends ImageCommand { + params(args) { + return { + old: args.length !== 0 && args[0].toLowerCase() === "old" ? true : false + }; + } + static description = "Turns an image blurple"; + static arguments = ["{old}"]; static noImage = "you need to provide an image to make blurple!"; static command = "blurple"; diff --git a/natives/blurple.cc b/natives/blurple.cc index 0f9a4df..3e5605b 100644 --- a/natives/blurple.cc +++ b/natives/blurple.cc @@ -12,6 +12,8 @@ Napi::Value Blurple(const Napi::CallbackInfo &info) { try { Napi::Object obj = info[0].As(); Napi::Buffer data = obj.Get("data").As>(); + bool old = + obj.Has("old") ? obj.Get("old").As().Value() : false; string type = obj.Get("type").As().Utf8Value(); int delay = obj.Has("delay") ? obj.Get("delay").As().Int32Value() : 0; @@ -26,7 +28,7 @@ Napi::Value Blurple(const Napi::CallbackInfo &info) { for (Image &image : coalesced) { image.threshold(49151.25); - image.levelColors("#7289DA", "white"); + image.levelColors(old ? "#7289DA" : "#5865F2", "white"); image.magick(type); image.animationDelay(delay == 0 ? image.animationDelay() : delay); blurpled.push_back(image);