The helper bot for LHT https://lhtranslation.net
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Senko/util/misc/embed.js

32 lines
1.4 KiB

const {EmbedBuilder} = require("discord.js");
const getFooterIcon = (client, message, options) => options
? options.footerIcon === "bot"
? client.user.avatarURL()
: options.footerIcon === "user"
? message.member
? message.member.displayAvatarURL({dynamic: true})
: message.author.displayAvatarURL({dynamic: true})
: options.footerIcon === "server"
? message.guild
? message.guild.iconURL({dynamic: true})
: client.user.avatarURL()
: client.user.avatarURL()
: client.user.avatarURL();
module.exports = client => {
client.embeds = {
base: (message, options) => new EmbedBuilder()
.setColor(client.config.embed.colors.base)
.setFooter({text: client.config.bot.name, iconURL: getFooterIcon(client, message, options)})
.setTimestamp(),
success: (message, options) => new EmbedBuilder()
.setColor(client.config.embed.colors.success)
.setFooter({text: client.config.bot.name, iconURL: getFooterIcon(client, message, options)})
.setTimestamp(),
fail: (message, options) => new EmbedBuilder()
.setColor(client.config.embed.colors.fail)
.setFooter({text: client.config.bot.name, iconURL: getFooterIcon(client, message, options)})
.setTimestamp()
}
};