eu.astrogd.white-leopard/src/tools/defaultEmbeds.ts

44 lines
1.5 KiB
TypeScript

import pack from "../../package.json";
import { EmbedBuilder, GuildTextBasedChannel } from "discord.js";
import client from "../client";
import { Color, Emoji } from "./design";
// const _coolColors = [0x054566];
export default function getDefaultEmbed(): EmbedBuilder {
const embed = new EmbedBuilder();
embed.setFooter({
text: `Channel filter V${pack.version}`,
iconURL: client.user?.avatarURL() || undefined,
});
embed.setTimestamp(new Date());
embed.setColor(Color.ANONYMOUS_GRAY);
return embed;
}
export function getSuccessEmbed(): EmbedBuilder {
const embed = getDefaultEmbed();
embed.setTitle(`${Emoji.CHAT_APPROVE} Success`);
embed.setColor(Color.SUCCESSFUL_GREEN);
return embed;
}
export function getFailedEmbed(): EmbedBuilder {
const embed = getDefaultEmbed();
embed.setTitle(`${Emoji.CHAT_DENY} Failed`);
embed.setColor(Color.STOPSIGN_RED);
return embed;
}
export function getUserReportEmbed(guildName: string, channelName: string): EmbedBuilder {
const embed = getDefaultEmbed();
embed.setColor(Color.STOPSIGN_RED);
embed.setTitle(`${Emoji.SECURITY_CHALLENGE_FAILED} A channel you modified has been deleted`);
embed.setDescription(`Hey there ${Emoji.WAVING}
You just modified a channel on the ${guildName} server. \
However, your channel name (#${channelName}) contained a word that is not allowed so your channel got deleted.
Please make sure to keep channel names friendly for everyone!`);
return embed;
}