Added support for GIFs in image commands, added caption

This commit is contained in:
TheEssem 2020-01-07 19:17:04 -06:00
parent d97496ef25
commit 4fb8eb4989
5 changed files with 39 additions and 3 deletions

View file

@ -7,7 +7,7 @@ ${process.env.NODE_ENV === "development" ? "\n**You are currently using esmBot D
Default prefix is \`&\`.
> Tip: Use Ctrl+F to find the command you want!
> Tip: You can get more info about a command by using \`help [command]\`.
## Table of Contents
+ [**General**](#💻-general)
@ -25,7 +25,7 @@ module.exports = async (output) => {
moderation: ["## 🔨 Moderation"],
tags: ["## 🏷️ Tags"],
fun: ["## 👌 Fun"],
images: ["## 🖼️ Image Editing", "> These commands support the PNG, JPEG, and WEBP formats."],
images: ["## 🖼️ Image Editing", "> These commands support the PNG, JPEG, WEBP, and GIF formats. (GIF support is currently experimental)"],
soundboard: ["## 🔊 Soundboard"]
};
for (const command of commands) {

View file

@ -11,7 +11,7 @@ const typeCheck = async (image) => {
// get the file type
const imageType = fileType(imageBuffer);
// check if the file is a jpeg, png, or webp
if (imageType && ["image/jpeg", "image/png", "image/webp"].includes(imageType.mime)) {
if (imageType && ["image/jpeg", "image/png", "image/webp", "image/gif"].includes(imageType.mime)) {
// if it is, then return the url with the file type
return {
type: imageType.ext,