From 6056e49728896629bd7307d24200e438dddd3cdb Mon Sep 17 00:00:00 2001 From: TheEssem Date: Sun, 21 Jun 2020 12:12:58 -0500 Subject: [PATCH] Changed source of flags, added new activity message --- .gitmodules | 6 +++--- commands/flag.js | 5 ++--- messages.json | 3 ++- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.gitmodules b/.gitmodules index b08bac6..512ff03 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "assets/images/country-flags"] - path = assets/images/country-flags - url = https://github.com/hjnilsson/country-flags.git +[submodule "assets/images/region-flags"] + path = assets/images/region-flags + url = https://github.com/behdad/region-flags diff --git a/commands/flag.js b/commands/flag.js index 5879be1..a2392be 100644 --- a/commands/flag.js +++ b/commands/flag.js @@ -10,11 +10,10 @@ exports.run = async (message, args) => { if (image === undefined) return `${message.author.mention}, you need to provide an image to overlay a flag onto!`; if (!args[0].match(emojiRegex)) return `${message.author.mention}, you need to provide an emoji of a flag to overlay!`; const flag = emoji.unemojify(args[0]).replace(/:/g, "").replace("flag-", ""); - let path = `./assets/images/country-flags/png1000px/${flag}.png`; + let path = `./assets/images/region-flags/png/${flag.toUpperCase()}.png`; if (flag === "🏴‍☠️") path = "./assets/images/pirateflag.png"; - console.log(flag); const size = await gm(image.path).sizePromise(); - const buffer = await gm(image.path).coalesce().out("null:").out("(", path, "-alpha", "set", "-channel", "A", "-evaluate", "multiply", "0.4", "+channel", ")").gravity("North").scale(...(size.width < size.height ? ["%[fx:u.w]", null] : [null, "%[fx:u.h]"])).out("-layers", "composite").bufferPromise(image.type, image.delay); + const buffer = await gm(image.path).coalesce().out("null:").out("(", path, "-alpha", "set", "-channel", "A", "-evaluate", "multiply", "0.5", "+channel", ")").gravity("North").scale(...(size.width < size.height ? ["%[fx:u.w]", null] : [null, "%[fx:u.h]"])).out("-layers", "composite").bufferPromise(image.type, image.delay); return { file: buffer, name: `flag.${image.type}` diff --git a/messages.json b/messages.json index 7a807b3..dcb53aa 100644 --- a/messages.json +++ b/messages.json @@ -108,5 +108,6 @@ "with the TF2 source code", "alvin the chipmunk nightcore", "braaaaap", - "Schmelf?" + "Schmelf?", + "Troll" ] \ No newline at end of file