diff --git a/commands/avatar-edit/3000-years.js b/commands/avatar-edit/3000-years.js index 12c88370..1737313b 100644 --- a/commands/avatar-edit/3000-years.js +++ b/commands/avatar-edit/3000-years.js @@ -41,7 +41,7 @@ module.exports = class YearsCommand extends Command { const avatar = await loadImage(body); ctx.drawImage(base, 0, 0); ctx.drawImage(avatar, 461, 127, 200, 200); - return msg.say({ files: [canvas.toBuffer()] }); + return msg.say({ files: [{ attachment: canvas.toBuffer(), name: '3000-years.png' }] }); } catch (err) { return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); } diff --git a/commands/avatar-edit/approved.js b/commands/avatar-edit/approved.js index 26fe0804..c77a47c9 100644 --- a/commands/avatar-edit/approved.js +++ b/commands/avatar-edit/approved.js @@ -41,7 +41,7 @@ module.exports = class ApprovedCommand extends Command { const avatar = await loadImage(body); ctx.drawImage(avatar, 0, 0, 256, 256); ctx.drawImage(base, 0, 0, 256, 256); - return msg.say({ files: [canvas.toBuffer()] }); + return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'approved.png' }] }); } catch (err) { return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); } diff --git a/commands/avatar-edit/avatar-fusion.js b/commands/avatar-edit/avatar-fusion.js index 70c868d5..36f28da9 100644 --- a/commands/avatar-edit/avatar-fusion.js +++ b/commands/avatar-edit/avatar-fusion.js @@ -51,7 +51,7 @@ module.exports = class AvatarFusionCommand extends Command { ctx.globalAlpha = 0.5; ctx.drawImage(baseAvatar, 0, 0, 256, 256); ctx.drawImage(overlayAvatar, 0, 0, 256, 256); - return msg.say({ files: [canvas.toBuffer()] }); + return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'avatar-fusion.png' }] }); } catch (err) { return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); } diff --git a/commands/avatar-edit/beautiful.js b/commands/avatar-edit/beautiful.js index 84c5f264..5973d7e0 100644 --- a/commands/avatar-edit/beautiful.js +++ b/commands/avatar-edit/beautiful.js @@ -42,7 +42,7 @@ module.exports = class BeautifulCommand extends Command { ctx.drawImage(base, 0, 0); ctx.drawImage(avatar, 341, 35, 117, 135); ctx.drawImage(avatar, 343, 301, 117, 135); - return msg.say({ files: [canvas.toBuffer()] }); + return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'beautiful.png' }] }); } catch (err) { return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); } diff --git a/commands/avatar-edit/bob-ross.js b/commands/avatar-edit/bob-ross.js index 1e1592df..bc121340 100644 --- a/commands/avatar-edit/bob-ross.js +++ b/commands/avatar-edit/bob-ross.js @@ -45,7 +45,7 @@ module.exports = class BobRossCommand extends Command { ctx.drawImage(avatar, 69, 102, 256, 256); ctx.rotate(-3 * (Math.PI / 180)); ctx.drawImage(base, 0, 0); - return msg.say({ files: [canvas.toBuffer()] }); + return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'bob-ross.png' }] }); } catch (err) { return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); } diff --git a/commands/avatar-edit/card.js b/commands/avatar-edit/card.js index 2f4c0816..ddd5da3f 100644 --- a/commands/avatar-edit/card.js +++ b/commands/avatar-edit/card.js @@ -63,7 +63,7 @@ module.exports = class CardCommand extends Command { ctx.font = '14px Noto'; ctx.fillText(user.id, 30, 355); ctx.fillText(`#${user.discriminator}`, 313, 355); - return msg.say({ files: [canvas.toBuffer()] }); + return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'card.png' }] }); } catch (err) { return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); } diff --git a/commands/avatar-edit/challenger.js b/commands/avatar-edit/challenger.js index 495c6c71..1bd3c769 100644 --- a/commands/avatar-edit/challenger.js +++ b/commands/avatar-edit/challenger.js @@ -40,7 +40,7 @@ module.exports = class ChallengerCommand extends Command { const avatar = await loadImage(body); ctx.drawImage(base, 0, 0); ctx.drawImage(avatar, 484, 98, 256, 256); - return msg.say({ files: [canvas.toBuffer()] }); + return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'challenger.png' }] }); } catch (err) { return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); } diff --git a/commands/avatar-edit/christmas-hat.js b/commands/avatar-edit/christmas-hat.js index d80dfe54..ddbfc93d 100644 --- a/commands/avatar-edit/christmas-hat.js +++ b/commands/avatar-edit/christmas-hat.js @@ -40,7 +40,7 @@ module.exports = class ChristmasHatCommand extends Command { const avatar = await loadImage(body); ctx.drawImage(avatar, 0, 0, 256, 256); ctx.drawImage(base, 65, -26, 200, 235); - return msg.say({ files: [canvas.toBuffer()] }); + return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'christmas-hat.png' }] }); } catch (err) { return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); } diff --git a/commands/avatar-edit/dexter.js b/commands/avatar-edit/dexter.js index 670e2edc..2e9f83c0 100644 --- a/commands/avatar-edit/dexter.js +++ b/commands/avatar-edit/dexter.js @@ -42,7 +42,7 @@ module.exports = class DexterCommand extends Command { ctx.rotate(-11 * (Math.PI / 180)); ctx.drawImage(avatar, 234, 274, 225, 225); ctx.rotate(11 * (Math.PI / 180)); - return msg.say({ files: [canvas.toBuffer()] }); + return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'dexter.png' }] }); } catch (err) { return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); } diff --git a/commands/avatar-edit/greyscale.js b/commands/avatar-edit/greyscale.js index 9df9d39f..e30d3470 100644 --- a/commands/avatar-edit/greyscale.js +++ b/commands/avatar-edit/greyscale.js @@ -47,7 +47,7 @@ module.exports = class GreyscaleCommand extends Command { data[i + 2] = brightness; } ctx.putImageData(imgData, 0, 0); - return msg.say({ files: [canvas.toBuffer()] }); + return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'greyscale.png' }] }); } catch (err) { return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); } diff --git a/commands/avatar-edit/invert.js b/commands/avatar-edit/invert.js index a2921258..2d064793 100644 --- a/commands/avatar-edit/invert.js +++ b/commands/avatar-edit/invert.js @@ -45,7 +45,7 @@ module.exports = class InvertCommand extends Command { data[i + 2] = 255 - data[i + 2]; } ctx.putImageData(imgData, 0, 0); - return msg.say({ files: [canvas.toBuffer()] }); + return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'invert.png' }] }); } catch (err) { return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); } diff --git a/commands/avatar-edit/rainbow.js b/commands/avatar-edit/rainbow.js index 1cf4da60..cd9d61cd 100644 --- a/commands/avatar-edit/rainbow.js +++ b/commands/avatar-edit/rainbow.js @@ -41,7 +41,7 @@ module.exports = class RainbowCommand extends Command { const avatar = await loadImage(body); ctx.drawImage(avatar, 0, 0, 256, 256); ctx.drawImage(base, 0, 0, 256, 256); - return msg.say({ files: [canvas.toBuffer()] }); + return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'rainbow.png' }] }); } catch (err) { return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); } diff --git a/commands/avatar-edit/rejected.js b/commands/avatar-edit/rejected.js index 98bbbe2a..3d68f7d1 100644 --- a/commands/avatar-edit/rejected.js +++ b/commands/avatar-edit/rejected.js @@ -41,7 +41,7 @@ module.exports = class RejctedCommand extends Command { const avatar = await loadImage(body); ctx.drawImage(avatar, 0, 0, 256, 256); ctx.drawImage(base, 0, 0, 256, 256); - return msg.say({ files: [canvas.toBuffer()] }); + return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'rejected.png' }] }); } catch (err) { return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); } diff --git a/commands/avatar-edit/rip.js b/commands/avatar-edit/rip.js index a0a37bb8..fc9468a9 100644 --- a/commands/avatar-edit/rip.js +++ b/commands/avatar-edit/rip.js @@ -50,7 +50,7 @@ module.exports = class RIPCommand extends Command { data[i + 2] = brightness; } ctx.putImageData(imgData, 158, 51); - return msg.say({ files: [canvas.toBuffer()] }); + return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'rip.png' }] }); } catch (err) { return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); } diff --git a/commands/avatar-edit/simba.js b/commands/avatar-edit/simba.js index e637e889..3eb31afd 100644 --- a/commands/avatar-edit/simba.js +++ b/commands/avatar-edit/simba.js @@ -42,7 +42,7 @@ module.exports = class SimbaCommand extends Command { ctx.rotate(-24 * (Math.PI / 180)); ctx.drawImage(avatar, 75, 160, 130, 150); ctx.rotate(24 * (Math.PI / 180)); - return msg.say({ files: [canvas.toBuffer()] }); + return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'simba.png' }] }); } catch (err) { return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); } diff --git a/commands/avatar-edit/steam-card.js b/commands/avatar-edit/steam-card.js index bb03f9a5..b9d0af6a 100644 --- a/commands/avatar-edit/steam-card.js +++ b/commands/avatar-edit/steam-card.js @@ -48,7 +48,7 @@ module.exports = class SteamCardCommand extends Command { ctx.drawImage(base, 0, 0); ctx.font = '30px Noto'; ctx.fillText(member.displayName, 35, 48); - return msg.say({ files: [canvas.toBuffer()] }); + return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'steam-card.png' }] }); } catch (err) { return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); } diff --git a/commands/avatar-edit/steam-now-playing.js b/commands/avatar-edit/steam-now-playing.js index 56b6cc73..35d017c1 100644 --- a/commands/avatar-edit/steam-now-playing.js +++ b/commands/avatar-edit/steam-now-playing.js @@ -57,7 +57,7 @@ module.exports = class SteamNowPlayingCommand extends Command { if (ctx.measureText(game).width > 160) shorten = true; while (ctx.measureText(game).width > 160) game = game.substr(0, game.length - 1); ctx.fillText(shorten ? `${game}...` : game, 63, 54); - return msg.say({ files: [canvas.toBuffer()] }); + return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'steam-now-playing.png' }] }); } catch (err) { return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); } diff --git a/commands/avatar-edit/thug-life.js b/commands/avatar-edit/thug-life.js index 813761bd..b1dd093c 100644 --- a/commands/avatar-edit/thug-life.js +++ b/commands/avatar-edit/thug-life.js @@ -49,7 +49,7 @@ module.exports = class ThugLifeCommand extends Command { data[i + 2] = brightness; } ctx.putImageData(imgData, 0, 0); - return msg.say({ files: [canvas.toBuffer()] }); + return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'thug-life.png' }] }); } catch (err) { return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); } diff --git a/commands/avatar-edit/triggered.js b/commands/avatar-edit/triggered.js index 86a24aca..b4c60e04 100644 --- a/commands/avatar-edit/triggered.js +++ b/commands/avatar-edit/triggered.js @@ -46,7 +46,7 @@ module.exports = class TriggeredCommand extends Command { for (let i = 0; i < data.length; i += 4) data[i] = Math.max(255, data[i]); ctx.putImageData(imgData, 0, 0); ctx.drawImage(base, 0, 0); - return msg.say({ files: [canvas.toBuffer()] }); + return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'triggered.png' }] }); } catch (err) { return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); } diff --git a/commands/avatar-edit/wanted.js b/commands/avatar-edit/wanted.js index b25db25c..c3599806 100644 --- a/commands/avatar-edit/wanted.js +++ b/commands/avatar-edit/wanted.js @@ -40,7 +40,7 @@ module.exports = class WantedCommand extends Command { const avatar = await loadImage(body); ctx.drawImage(base, 0, 0); ctx.drawImage(avatar, 150, 360, 430, 430); - return msg.say({ files: [canvas.toBuffer()] }); + return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'wanted.png' }] }); } catch (err) { return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); } diff --git a/commands/avatar-edit/yu-gi-oh-token.js b/commands/avatar-edit/yu-gi-oh-token.js index b1ed40fe..ece00f0e 100644 --- a/commands/avatar-edit/yu-gi-oh-token.js +++ b/commands/avatar-edit/yu-gi-oh-token.js @@ -40,7 +40,7 @@ module.exports = class YuGiOhTokenCommand extends Command { const avatar = await loadImage(body); ctx.drawImage(base, 0, 0); ctx.drawImage(avatar, 45, 102, 293, 294); - return msg.say({ files: [canvas.toBuffer()] }); + return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'yu-gi-oh-token.png' }] }); } catch (err) { return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); } diff --git a/commands/image-edit/achievement.js b/commands/image-edit/achievement.js index 8b95c1fa..d7eacb7a 100644 --- a/commands/image-edit/achievement.js +++ b/commands/image-edit/achievement.js @@ -32,7 +32,7 @@ module.exports = class AchievementCommand extends Command { h: 'Achievement Get!', t: text }); - return msg.say({ files: [body] }); + return msg.say({ files: [{ attachment: body, name: 'achievement.png' }] }); } catch (err) { return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); } diff --git a/commands/image-edit/color.js b/commands/image-edit/color.js index 2aca5d5d..41d3f92c 100644 --- a/commands/image-edit/color.js +++ b/commands/image-edit/color.js @@ -26,6 +26,6 @@ module.exports = class ColorCommand extends Command { const ctx = canvas.getContext('2d'); ctx.fillStyle = color; ctx.fillRect(0, 0, 250, 250); - return msg.say({ files: [canvas.toBuffer()] }); + return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'color.png' }] }); } }; diff --git a/commands/search/map.js b/commands/search/map.js index 687f8918..420eab39 100644 --- a/commands/search/map.js +++ b/commands/search/map.js @@ -40,7 +40,7 @@ module.exports = class MapCommand extends Command { size: '500x500', key: GOOGLE_KEY }); - return msg.say({ files: [body] }); + return msg.say({ files: [{ attachment: body, name: 'map.png' }] }); } catch (err) { return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); } diff --git a/package.json b/package.json index f9e2389e..d5789b27 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiaobot", - "version": "41.2.1", + "version": "41.2.2", "description": "Your personal server companion.", "main": "Shard.js", "scripts": {