Changed source of flags, added new activity message

This commit is contained in:
TheEssem 2020-06-21 12:12:58 -05:00
parent 2f1c37579e
commit 6056e49728
3 changed files with 7 additions and 7 deletions

6
.gitmodules vendored
View file

@ -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

View file

@ -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}`

View file

@ -108,5 +108,6 @@
"with the TF2 source code",
"alvin the chipmunk nightcore",
"braaaaap",
"Schmelf?"
"Schmelf?",
"Troll"
]