3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-16 14:11:50 +00:00

fixed default emotes for jumbo

This commit is contained in:
roflmaoqwerty 2020-01-14 23:01:27 +11:00
parent 58e99bad33
commit c4d6556fe4

View file

@ -1509,8 +1509,16 @@ export class UtilityPlugin extends ZeppelinPlugin<TConfigSchema> {
}; };
} }
} else { } else {
const url = CDN_URL + `/${twemoji.convert.toCodePoint(args.emoji)}.svg`; let url = CDN_URL + `/${twemoji.convert.toCodePoint(args.emoji)}.svg`;
const image = await this.resizeBuffer(await this.getBufferFromUrl(url), config.jumbo_size, config.jumbo_size); let image;
try {
image = await this.resizeBuffer(await this.getBufferFromUrl(url), config.jumbo_size, config.jumbo_size);
} catch {
if (url.toLocaleLowerCase().endsWith("fe0f.svg")) {
url = url.slice(0, url.lastIndexOf("-fe0f")) + ".svg";
image = await this.resizeBuffer(await this.getBufferFromUrl(url), config.jumbo_size, config.jumbo_size);
}
}
file = { file = {
name: `emoji.png`, name: `emoji.png`,
file: image, file: image,