nyx/commands/Fun/quote.js

42 lines
1.2 KiB
JavaScript
Raw Normal View History

2021-06-24 09:53:19 +02:00
const {
Client,
Message,
MessageEmbed,
MessageAttachment,
} = require("discord.js");
const { Canvas } = require("canvacord");
module.exports = {
name: "quote",
description: "Quote a message",
usage: "{User} (Message)",
category: "Fun",
run: async (client, message, args) => {
const member = message.mentions.users.first() || message.author;
if (message.mentions.users.first()) {
const imgae = await Canvas.quote({
image: member.displayAvatarURL({
format: "png",
}),
message: args.slice(1).join(" "),
username: member.displayName ? member.displayName : member.username,
color: "ffffff",
});
const attach = new MessageAttachment(imgae, "quote.png");
2021-09-06 12:38:25 +02:00
message.reply(attach);
2021-06-24 09:53:19 +02:00
} else {
const imgae = await Canvas.quote({
image: message.author.displayAvatarURL({
format: "png",
}),
message: args.join(" "),
username: message.member.nickname
? message.member.nickname
: member.username,
color: "ffffff",
});
const attach = new MessageAttachment(imgae, "quote.png");
2021-09-06 12:38:25 +02:00
message.reply(attach);
2021-06-24 09:53:19 +02:00
}
},
};