diff --git a/commands/ping.js b/commands/ping.js index 45537ca..42cd008 100644 --- a/commands/ping.js +++ b/commands/ping.js @@ -2,7 +2,7 @@ const client = require("../utils/client.js"); exports.run = async (message) => { const pingMessage = await client.createMessage(message.channel.id, "🏓 Ping?"); - return pingMessage.edit(`🏓 Pong! Latency is ${pingMessage.timestamp - message.timestamp}ms. API Latency is ${Math.round(client.shards.get(client.guildShardMap[message.channel.guild.id]).latency)}ms.`); + return pingMessage.edit(`🏓 Pong!\n\`\`\`\nLatency: ${pingMessage.timestamp - message.timestamp}ms\nAPI Latency: ${Math.round(client.shards.get(client.guildShardMap[message.channel.guild.id]).latency)}ms\n\`\`\``); }; exports.aliases = ["pong"]; diff --git a/commands/stretch.js b/commands/stretch.js new file mode 100644 index 0000000..0204b0d --- /dev/null +++ b/commands/stretch.js @@ -0,0 +1,20 @@ +const gm = require("gm").subClass({ + imageMagick: true +}); +const gmToBuffer = require("../utils/gmbuffer.js"); + +exports.run = async (message) => { + message.channel.sendTyping(); + const image = await require("../utils/imagedetect.js")(message); + if (image === undefined) return `${message.author.mention}, you need to provide an image to stretch!`; + const data = gm(image.data).resize("512x512!"); + const resultBuffer = await gmToBuffer(data); + return message.channel.createMessage("", { + file: resultBuffer, + name: `stretch.${image.type}` + }); +}; + +exports.aliases = ["aspect", "ratio", "aspect43", "43"]; +exports.category = 5; +exports.help = "Stretches an image to 4:3 aspect ratio"; \ No newline at end of file diff --git a/commands/tags.js b/commands/tags.js index 91d56f0..9d33c56 100644 --- a/commands/tags.js +++ b/commands/tags.js @@ -49,6 +49,7 @@ exports.run = async (message, args) => { "text": `Page ${i + 1} of ${groups.length}` }, "description": value.join("\n"), + "fields": [process.env.NODE_ENV === "development" ? {"name": "Note", "value": "Tags created in this version of esmBot will not carry over to the final release."} : null], "author": { "name": message.author.username, "icon_url": message.author.avatarURL diff --git a/commands/wide.js b/commands/wide.js new file mode 100644 index 0000000..c804295 --- /dev/null +++ b/commands/wide.js @@ -0,0 +1,24 @@ +const gm = require("gm").subClass({ + imageMagick: true +}); +const gmToBuffer = require("../utils/gmbuffer.js"); + +exports.run = async (message) => { + message.channel.sendTyping(); + const image = await require("../utils/imagedetect.js")(message); + if (image === undefined) return `${message.author.mention}, you need to provide an image to stretch!`; + gm(image.data).size(async (error, size) => { + if (error) throw error; + const data = gm(image.data).resize(`${(size.width * 19) / 2}x${size.height / 2}!`); + //.gravity("Center").extent(size.width, size.height) + const resultBuffer = await gmToBuffer(data); + return message.channel.createMessage("", { + file: resultBuffer, + name: `wide.${image.type}` + }); + }); +}; + +exports.aliases = ["w19", "wide19"]; +exports.category = 5; +exports.help = "Stretches an image to 19x its width"; \ No newline at end of file diff --git a/package.json b/package.json index ecaae7a..d22e1c7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "esmbot", - "version": "2.0.0", + "version": "1.0.0", "description": "A Discord bot with miscellaneous features", "main": "app.js", "engines": {