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

44 lines
1.5 KiB
TypeScript
Raw Normal View History

2022-11-23 13:23:25 +01:00
import pack from "../../package.json";
2022-11-29 19:05:24 +01:00
import { EmbedBuilder, GuildTextBasedChannel } from "discord.js";
2022-11-23 13:23:25 +01:00
import client from "../client";
2022-11-24 16:25:20 +01:00
import { Color, Emoji } from "./design";
2022-11-23 13:23:25 +01:00
// const _coolColors = [0x054566];
export default function getDefaultEmbed(): EmbedBuilder {
const embed = new EmbedBuilder();
embed.setFooter({
2022-11-25 16:20:12 +01:00
text: `Channel filter V${pack.version}`,
2022-11-23 13:23:25 +01:00
iconURL: client.user?.avatarURL() || undefined,
});
embed.setTimestamp(new Date());
2022-11-24 16:25:20 +01:00
embed.setColor(Color.ANONYMOUS_GRAY);
2022-11-23 13:23:25 +01:00
return embed;
}
export function getSuccessEmbed(): EmbedBuilder {
const embed = getDefaultEmbed();
2022-11-24 16:25:20 +01:00
embed.setTitle(`${Emoji.CHAT_APPROVE} Success`);
embed.setColor(Color.SUCCESSFUL_GREEN);
2022-11-23 13:23:25 +01:00
return embed;
2022-11-24 15:36:33 +01:00
}
export function getFailedEmbed(): EmbedBuilder {
const embed = getDefaultEmbed();
2022-11-24 16:25:20 +01:00
embed.setTitle(`${Emoji.CHAT_DENY} Failed`);
embed.setColor(Color.STOPSIGN_RED);
2022-11-29 19:05:24 +01:00
return embed;
}
export function getUserReportEmbed(channel: GuildTextBasedChannel): 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 ${channel.guild.name} server. \
However, your channel name (#${channel.name}) contained a word that is not allowed so your channel got deleted.
Please make sure to keep channel names friendly for everyone!`);
2022-11-24 15:36:33 +01:00
return embed;
2022-11-23 13:23:25 +01:00
}