Adjusted flag sizing some more, removed fortnite, added some database connection args

This commit is contained in:
TheEssem 2020-06-26 09:36:03 -05:00
parent 6056e49728
commit 56faea8d59
4 changed files with 2 additions and 12 deletions

Binary file not shown.

View file

@ -12,8 +12,7 @@ exports.run = async (message, args) => {
const flag = emoji.unemojify(args[0]).replace(/:/g, "").replace("flag-", "");
let path = `./assets/images/region-flags/png/${flag.toUpperCase()}.png`;
if (flag === "🏴‍☠️") path = "./assets/images/pirateflag.png";
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.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);
const buffer = await gm(image.path).coalesce().out("null:").out("(", path, "-alpha", "set", "-channel", "A", "-evaluate", "multiply", "0.5", "+channel", ")").gravity("North").scale("%[fx:u.w]x%[fx:u.h]!").out("-layers", "composite").bufferPromise(image.type, image.delay);
return {
file: buffer,
name: `flag.${image.type}`

View file

@ -1,9 +0,0 @@
const playSound = require("../utils/soundplayer.js");
exports.run = async (message) => {
return playSound("./assets/audio/fortnite.opus", message);
};
exports.aliases = ["dance", "defaultdance"];
exports.category = 6;
exports.help = "Plays the Fortnite default dance sound";

View file

@ -1,6 +1,6 @@
// database stuff
const mongoose = require("mongoose");
mongoose.connect(process.env.MONGO);
mongoose.connect(process.env.MONGO, { poolSize: 10, bufferMaxEntries: 0, reconnectTries: 5000, useNewUrlParser: true, useUnifiedTopology: true });
const guildSchema = new mongoose.Schema({
id: String,
tags: Map,