diff --git a/package.json b/package.json index c447427..6a56556 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "canvacord": "^5.4.8", "chalk": "^4.1.2", "discord-giveaways": "^6.0.1", - "discord-image-generation": "^1.4.15", + "discord-image-generation": "^1.4.21", "discord.js": "^14.7.1", "dompurify": "^2.4.1", "dotenv": "^16.0.3", diff --git a/src/commands/images/ad.js b/src/commands/images/ad.js index ec9f298..3a6012b 100644 --- a/src/commands/images/ad.js +++ b/src/commands/images/ad.js @@ -5,12 +5,11 @@ module.exports = async (client, interaction, args) => { const member = interaction.options.getUser('user'); - const userAvatar = member.displayAvatarURL({ dynamic: false, size: 1024, format: 'png' }); + const userAvatar = member.displayAvatarURL({ dynamic: false, size: 1024, extension: 'png' }); const image = await pop.ad(userAvatar); let attach = new Discord.AttachmentBuilder(image, { name: "ad.png" }); - interaction.editReply({ files: [attach] }) - -} - + const embed = client.templateEmbed().setImage("attachment://ad.png"); + interaction.editReply({ files: [attach], embeds: [embed] }); +} \ No newline at end of file diff --git a/src/commands/images/bed.js b/src/commands/images/bed.js index 883599c..9083a51 100644 --- a/src/commands/images/bed.js +++ b/src/commands/images/bed.js @@ -5,11 +5,12 @@ module.exports = async (client, interaction, args) => { const member = interaction.options.getUser('user'); - const userAvatar = member.displayAvatarURL({ dynamic: false, size: 1024, format: 'png' }); + const userAvatar = member.displayAvatarURL({ dynamic: false, size: 1024, extension: 'png' }); - const img = await Canvas.bed(interaction.user.avatarURL({ size: 1024, format: 'png' }), userAvatar); + const img = await Canvas.bed(interaction.user.avatarURL({ size: 1024, extension: 'png' }), userAvatar); let attach = new Discord.AttachmentBuilder(img, { name: "bed.png" }); - interaction.editReply({ files: [attach] }) + const embed = client.templateEmbed().setImage("attachment://bed.png"); + interaction.editReply({ files: [attach], embeds: [embed] }); } diff --git a/src/commands/images/blur.js b/src/commands/images/blur.js index 5558b46..f900e17 100644 --- a/src/commands/images/blur.js +++ b/src/commands/images/blur.js @@ -5,13 +5,14 @@ module.exports = async (client, interaction, args) => { const member = interaction.options.getUser('user'); - const userAvatar = member.displayAvatarURL({ dynamic: false, size: 1024, format: 'png' }); + const userAvatar = member.displayAvatarURL({ dynamic: false, size: 1024, extension: 'png' }); const lvl = 4 const img = await Canvas.blur(userAvatar, lvl) let attach = new Discord.AttachmentBuilder(img, { name: "blurred.png" }); - interaction.editReply({ files: [attach] }) + const embed = client.templateEmbed().setImage("attachment://blurred.png"); + interaction.editReply({ files: [attach], embeds: [embed] }); } diff --git a/src/commands/images/burn.js b/src/commands/images/burn.js index f75637a..79f3be2 100644 --- a/src/commands/images/burn.js +++ b/src/commands/images/burn.js @@ -5,13 +5,14 @@ module.exports = async (client, interaction, args) => { const member = interaction.options.getUser('user'); - const userAvatar = member.displayAvatarURL({ dynamic: false, size: 1024, format: 'png' }); + const userAvatar = member.displayAvatarURL({ dynamic: false, size: 1024, extension: 'png' }); const lvl = 4 const img = await Canvas.burn(userAvatar, lvl); - let attach = new Discord.AttachmentBuilder(img, { name: "blurred.png" }); - interaction.editReply({ files: [attach] }) + let attach = new Discord.AttachmentBuilder(img, { name: "burn.png" }); + const embed = client.templateEmbed().setImage("attachment://burn.png"); + interaction.editReply({ files: [attach], embeds: [embed] }); } diff --git a/src/commands/images/car.js b/src/commands/images/car.js index b0e2a8c..08e10da 100644 --- a/src/commands/images/car.js +++ b/src/commands/images/car.js @@ -6,5 +6,6 @@ module.exports = async (client, interaction, args) => { const image = await pop.car(); let attach = new Discord.AttachmentBuilder(image.image, { name: "car.png" }); - interaction.editReply({ files: [attach] }) + const embed = client.templateEmbed().setImage("attachment://car.png"); + interaction.editReply({ files: [attach], embeds: [embed] }); }; \ No newline at end of file diff --git a/src/commands/images/clown.js b/src/commands/images/clown.js index 9a07a72..f822ec0 100644 --- a/src/commands/images/clown.js +++ b/src/commands/images/clown.js @@ -5,11 +5,12 @@ module.exports = async (client, interaction, args) => { const member = interaction.options.getUser('user'); - const userAvatar = member.displayAvatarURL({ dynamic: false, size: 1024, format: 'png' }); + const userAvatar = member.displayAvatarURL({ dynamic: false, size: 1024, extension: 'png' }); const image = await pop.clown(userAvatar); let attach = new Discord.AttachmentBuilder(image, { name: "clown.png" }); - interaction.editReply({ files: [attach] }) + const embed = client.templateEmbed().setImage("attachment://clown.png"); + interaction.editReply({ files: [attach], embeds: [embed] }); } diff --git a/src/commands/images/clyde.js b/src/commands/images/clyde.js index efc8d98..01eb3de 100644 --- a/src/commands/images/clyde.js +++ b/src/commands/images/clyde.js @@ -8,7 +8,8 @@ module.exports = async (client, interaction, args) => { const attachment = new Discord.AttachmentBuilder(image, "clyde.png"); - interaction.editReply({ files: [attachment] }); + const embed = client.templateEmbed().setImage("attachment://clyde.png"); + interaction.editReply({ files: [attachment], embeds: [embed] }); } \ No newline at end of file diff --git a/src/commands/images/colorify.js b/src/commands/images/colorify.js index 403f678..3f82631 100644 --- a/src/commands/images/colorify.js +++ b/src/commands/images/colorify.js @@ -5,11 +5,12 @@ module.exports = async (client, interaction, args) => { const member = interaction.options.getUser('user'); - const userAvatar = member.displayAvatarURL({ dynamic: false, size: 1024, format: 'png' }); + const userAvatar = member.displayAvatarURL({ dynamic: false, size: 1024, extension: 'png' }); const image = await Canvas.colorfy(userAvatar, "#ff0000") let attach = new Discord.AttachmentBuilder(image, { name: "colorify.png" }); - interaction.editReply({ files: [attach] }) + const embed = client.templateEmbed().setImage("attachment://colorify.png"); + interaction.editReply({ files: [attach], embeds: [embed] }); } diff --git a/src/commands/images/darkness.js b/src/commands/images/darkness.js index 2395fce..49aee49 100644 --- a/src/commands/images/darkness.js +++ b/src/commands/images/darkness.js @@ -5,13 +5,14 @@ module.exports = async (client, interaction, args) => { const member = interaction.options.getUser('user'); - const userAvatar = member.displayAvatarURL({ dynamic: false, size: 1024, format: 'png' }); + const userAvatar = member.displayAvatarURL({ dynamic: false, size: 1024, extension: 'png' }); const amount = 60 const image = await Canvas.darkness(userAvatar, amount); - let attach = new Discord.AttachmentBuilder(image, { name: "blurred.gif" }); + let attach = new Discord.AttachmentBuilder(image, { name: "darkness.gif" }); - interaction.editReply({ files: [attach] }) + const embed = client.templateEmbed().setImage("attachment://darkness.gif"); + interaction.editReply({ files: [attach], embeds: [embed] }); } diff --git a/src/commands/images/drake.js b/src/commands/images/drake.js index 32e6c6c..de42a21 100644 --- a/src/commands/images/drake.js +++ b/src/commands/images/drake.js @@ -9,6 +9,7 @@ module.exports = async (client, interaction, args) => { const image = await pop.drake(splitArgs1, splitArgs2); let attach = new Discord.AttachmentBuilder(image, { name: "drake.png" }); - interaction.editReply({ files: [attach] }) + const embed = client.templateEmbed().setImage("attachment://drake.png"); + interaction.editReply({ files: [attach], embeds: [embed] }); } diff --git a/src/commands/images/facepalm.js b/src/commands/images/facepalm.js index f5e63a1..570f8fe 100644 --- a/src/commands/images/facepalm.js +++ b/src/commands/images/facepalm.js @@ -5,11 +5,12 @@ module.exports = async (client, interaction, args) => { const member = interaction.options.getUser('user'); - const userAvatar = member.displayAvatarURL({ dynamic: false, size: 1024, format: 'png' }); + const userAvatar = member.displayAvatarURL({ dynamic: false, size: 1024, extension: 'png' }); const image = await Canvas.facepalm(userAvatar); let attach = new Discord.AttachmentBuilder(image, { name: "facepalm.png" }); - interaction.editReply({ files: [attach] }) + const embed = client.templateEmbed().setImage("attachment://facepalm.png"); + interaction.editReply({ files: [attach], embeds: [embed] }); } diff --git a/src/commands/images/glass.js b/src/commands/images/glass.js index b2311c1..f383fd6 100644 --- a/src/commands/images/glass.js +++ b/src/commands/images/glass.js @@ -2,8 +2,9 @@ const Discord = require('discord.js'); module.exports = async (client, interaction, args) => { - let link = `https://some-random-api.ml/canvas/glass/?avatar=${interaction.user.avatarURL({ size: 1024, format: 'png' })}` + let link = `https://some-random-api.ml/canvas/glass/?avatar=${interaction.user.avatarURL({ size: 1024, extension: 'png' })}` const attachment = new Discord.AttachmentBuilder(link, {name:'glass.png'}); - interaction.editReply({ files: [attachment] }) + const embed = client.templateEmbed().setImage("attachment://glass.png"); + interaction.editReply({ files: [attachment], embeds: [embed] }); }; \ No newline at end of file diff --git a/src/commands/images/greyscale.js b/src/commands/images/greyscale.js index a7c142a..304cf98 100644 --- a/src/commands/images/greyscale.js +++ b/src/commands/images/greyscale.js @@ -4,12 +4,13 @@ module.exports = async (client, interaction, args) => { const member = interaction.options.getUser('user'); - const userAvatar = member.displayAvatarURL({ dynamic: false, size: 1024, format: 'png' }); + const userAvatar = member.displayAvatarURL({ dynamic: false, size: 1024, extension: 'png' }); const image = await Canvas.greyscale(userAvatar) let attach = new Discord.AttachmentBuilder(image, { name: "greyscale.png" }); - - interaction.editReply({ files: [attach] }) + const embed = client.templateEmbed(); + embed.setImage("attachment://greyscale.png"); + interaction.editReply({ files: [attach], embeds: [embed] }) } diff --git a/src/commands/images/image.js b/src/commands/images/image.js index 4dc85a9..73f9b32 100644 --- a/src/commands/images/image.js +++ b/src/commands/images/image.js @@ -14,7 +14,6 @@ module.exports = async (client, interaction, args) => { client.simpleEmbed({ image: `${image}` }, channel) - } \ No newline at end of file diff --git a/src/commands/images/invert.js b/src/commands/images/invert.js index 3f835eb..3cbf7bf 100644 --- a/src/commands/images/invert.js +++ b/src/commands/images/invert.js @@ -5,11 +5,11 @@ module.exports = async (client, interaction, args) => { const member = interaction.options.getUser('user'); - const userAvatar = member.displayAvatarURL({ dynamic: false, size: 1024, format: 'png' }); + const userAvatar = member.displayAvatarURL({ dynamic: false, size: 1024, extension: 'png' }); const image = await pop.invert(userAvatar); let attach = new Discord.AttachmentBuilder(image, { name: "invert.png" }); - - interaction.editReply({ files: [attach] }) + const embed = client.templateEmbed().setImage('attachment://invert.png') + interaction.editReply({ files: [attach], embeds: [embed] }) } diff --git a/src/commands/images/kiss.js b/src/commands/images/kiss.js index b1698c6..821596b 100644 --- a/src/commands/images/kiss.js +++ b/src/commands/images/kiss.js @@ -5,11 +5,13 @@ module.exports = async (client, interaction, args) => { const member = interaction.options.getUser('user'); - let avatar = interaction.user.displayAvatarURL({ dynamic: false, size: 1024, format: 'png' }); - const userAvatar = member.displayAvatarURL({ dynamic: false, size: 1024, format: 'png' }); + const avatar = interaction.user.displayAvatarURL({ dynamic: false, size: 1024, extension: 'png' }); + const userAvatar = member.displayAvatarURL({ dynamic: false, size: 1024, extension: 'png' }); const image = await new DIG.Kiss().getImage(avatar, userAvatar); let attach = new Discord.AttachmentBuilder(image, { name: "kiss.png" }); - - interaction.editReply({ files: [attach] }) + const embed = client.templateEmbed(); + embed.setImage('attachment://kiss.png') + embed.setDescription(`**${interaction.user.username}** kissed **${member.username}**`) + interaction.editReply({ files: [attach], embeds: [embed] }) } diff --git a/src/commands/images/podium.js b/src/commands/images/podium.js index 71314f3..142e1e0 100644 --- a/src/commands/images/podium.js +++ b/src/commands/images/podium.js @@ -12,6 +12,7 @@ module.exports = async (client, interaction, args) => { var img = await new DIG.Podium().getImage(user1Avatar, user2Avatar, user3Avatar, user1.tag, user2.tag, user3.tag); var attach = new Discord.AttachmentBuilder(img, { name: "podium.png" }); - interaction.editReply({ files: [attach] }) + const embed = client.templateEmbed().setImage("attachment://podium.png"); + interaction.editReply({ files: [attach], embeds: [embed] }); } diff --git a/src/commands/images/pooh.js b/src/commands/images/pooh.js index b3e86f1..1f35e64 100644 --- a/src/commands/images/pooh.js +++ b/src/commands/images/pooh.js @@ -9,7 +9,7 @@ module.exports = async (client, interaction, args) => { const image = await pop.pooh(splitArgs1, splitArgs2); let attach = new Discord.AttachmentBuilder(image, { name: "pooh.png" }); - interaction.editReply({ files: [attach] }) - + const embed = client.templateEmbed().setImage("attachment://pooh.png"); + interaction.editReply({ files: [attach], embeds: [embed] }); } diff --git a/src/commands/images/spank.js b/src/commands/images/spank.js index c08a3b1..18c0ed0 100644 --- a/src/commands/images/spank.js +++ b/src/commands/images/spank.js @@ -4,12 +4,13 @@ const DIG = require("discord-image-generation"); module.exports = async (client, interaction, args) => { const user = interaction.options.getUser('user') || interaction.user; - let avatar = interaction.user.displayAvatarURL({ dynamic: false, size: 1024, format: 'png' }); - const userAvatar = user.displayAvatarURL({ dynamic: false, size: 1024, format: 'png' }); + let avatar = interaction.user.displayAvatarURL({ dynamic: false, size: 1024, extension: 'png' }); + const userAvatar = user.displayAvatarURL({ dynamic: false, size: 1024, extension: 'png' }); const image = await new DIG.Spank().getImage(avatar, userAvatar); let attach = new Discord.AttachmentBuilder(image, {name: "spank.png"}); - interaction.editReply({ files: [attach] }) + const embed = client.templateEmbed().setImage("attachment://spank.png"); + interaction.editReply({ files: [attach], embeds: [embed] }); } \ No newline at end of file diff --git a/src/commands/images/triggered.js b/src/commands/images/triggered.js index 1ef07d8..35ed337 100644 --- a/src/commands/images/triggered.js +++ b/src/commands/images/triggered.js @@ -2,8 +2,9 @@ const Discord = require('discord.js'); module.exports = async (client, interaction, args) => { - let link = `https://some-random-api.ml/canvas/triggered/?avatar=${interaction.user.avatarURL({ size: 1024, format: 'png' })}` + let link = `https://some-random-api.ml/canvas/triggered/?avatar=${interaction.user.avatarURL({ size: 1024, extension: 'png' })}` const attachment = new Discord.AttachmentBuilder(link, { name: 'triggered.gif' }); - interaction.editReply({ files: [attachment] }) + const embed = client.templateEmbed().setImage("attachment://triggered.gif"); + interaction.editReply({ files: [attachment], embeds: [embed] }); }; \ No newline at end of file diff --git a/src/commands/images/wallpaper.js b/src/commands/images/wallpaper.js index 532ae47..be64122 100644 --- a/src/commands/images/wallpaper.js +++ b/src/commands/images/wallpaper.js @@ -1,16 +1,9 @@ -const hdqwalls = require("hdqwalls-wrapper"); - +const fetch = require("node-fetch") module.exports = async (client, interaction, args) => { - + var images = [] const query = interaction.options.getString('name'); - const image = await hdqwalls(query); - - client.embed({ - title: `🖼・Your wallpaper`, - image: image[0], - type: 'editreply' - }, interaction) + // Use FREE API + } - \ No newline at end of file diff --git a/src/commands/images/wanted.js b/src/commands/images/wanted.js index 053f370..2798e3b 100644 --- a/src/commands/images/wanted.js +++ b/src/commands/images/wanted.js @@ -4,10 +4,10 @@ const DIG = require("discord-image-generation"); module.exports = async (client, interaction, args) => { const user = interaction.options.getUser('user') || interaction.user; - let userAvatar = user.displayAvatarURL({ size: 1024, dynamic: false, format: 'png' }); + let userAvatar = user.displayAvatarURL({ size: 1024, dynamic: false, extension: 'png' }); let img = await new DIG.Wanted().getImage(userAvatar, `€`); let attach = new Discord.AttachmentBuilder(img, { name: "wanted.png" }); - - interaction.editReply({ files: [attach] }) + const embed = client.templateEmbed().setImage("attachment://wanted.png"); + interaction.editReply({ files: [attach], embeds: [embed] }); } diff --git a/src/commands/images/wasted.js b/src/commands/images/wasted.js index 02f66ac..8568142 100644 --- a/src/commands/images/wasted.js +++ b/src/commands/images/wasted.js @@ -1,6 +1,6 @@ module.exports = async (client, interaction, args) => { - let link = `https://some-random-api.ml/canvas/wasted/?avatar=${interaction.user.avatarURL({ size: 1024, format: 'png' })}` + let link = `https://some-random-api.ml/canvas/wasted/?avatar=${interaction.user.avatarURL({ size: 1024, extension: 'png' })}` client.embed({ title: `🖼・Generated image`, diff --git a/src/commands/levels/rank.js b/src/commands/levels/rank.js index b73a1c2..f8aab3e 100644 --- a/src/commands/levels/rank.js +++ b/src/commands/levels/rank.js @@ -17,7 +17,7 @@ module.exports = async (client, interaction, args) => { let xpRequired = client.xpFor(user.level + 1); const rankCard = new Canvacord.Rank() - .setAvatar(target.displayAvatarURL({ dynamic: false, format: 'png' })) + .setAvatar(target.displayAvatarURL({ dynamic: false, extension: 'png' })) .setRequiredXP(xpRequired) .setCurrentXP(user.xp) .setLevel(user.level) diff --git a/src/commands/serverstats/animated-emoji.js b/src/commands/serverstats/animated-emoji.js index 854c98d..050324a 100644 --- a/src/commands/serverstats/animated-emoji.js +++ b/src/commands/serverstats/animated-emoji.js @@ -3,15 +3,10 @@ const Discord = require('discord.js'); const Schema = require("../../database/models/stats"); module.exports = async (client, interaction, args) => { - let Emojis = ""; let EmojiCount = 0; let Animated = 0; let OverallEmojis = 0; - function Emoji(id) { - return client.emojis.cache.get(id).toString(); - } - interaction.guild.emojis.cache.forEach((emoji) => { OverallEmojis++; if (emoji.animated) {