forked from syntaxbullet/AuroraBot-discord
58 lines
1.9 KiB
TypeScript
58 lines
1.9 KiB
TypeScript
import { EmbedBuilder, Colors } from "discord.js";
|
||
|
||
/**
|
||
* Creates a standardized error embed.
|
||
* @param message The error message to display.
|
||
* @param title Optional title for the embed. Defaults to "Error".
|
||
* @returns An EmbedBuilder instance configured as an error.
|
||
*/
|
||
export function createErrorEmbed(message: string, title: string = "Error"): EmbedBuilder {
|
||
return new EmbedBuilder()
|
||
.setTitle(`❌ ${title}`)
|
||
.setDescription(message)
|
||
.setColor(Colors.Red)
|
||
.setTimestamp();
|
||
}
|
||
|
||
/**
|
||
* Creates a standardized warning embed.
|
||
* @param message The warning message to display.
|
||
* @param title Optional title for the embed. Defaults to "Warning".
|
||
* @returns An EmbedBuilder instance configured as a warning.
|
||
*/
|
||
export function createWarningEmbed(message: string, title: string = "Warning"): EmbedBuilder {
|
||
return new EmbedBuilder()
|
||
.setTitle(`⚠️ ${title}`)
|
||
.setDescription(message)
|
||
.setColor(Colors.Yellow)
|
||
.setTimestamp();
|
||
}
|
||
|
||
/**
|
||
* Creates a standardized success embed.
|
||
* @param message The success message to display.
|
||
* @param title Optional title for the embed. Defaults to "Success".
|
||
* @returns An EmbedBuilder instance configured as a success.
|
||
*/
|
||
export function createSuccessEmbed(message: string, title: string = "Success"): EmbedBuilder {
|
||
return new EmbedBuilder()
|
||
.setTitle(`✅ ${title}`)
|
||
.setDescription(message)
|
||
.setColor(Colors.Green)
|
||
.setTimestamp();
|
||
}
|
||
|
||
/**
|
||
* Creates a standardized info embed.
|
||
* @param message The info message to display.
|
||
* @param title Optional title for the embed. Defaults to "Info".
|
||
* @returns An EmbedBuilder instance configured as info.
|
||
*/
|
||
export function createInfoEmbed(message: string, title: string = "Info"): EmbedBuilder {
|
||
return new EmbedBuilder()
|
||
.setTitle(`ℹ️ ${title}`)
|
||
.setDescription(message)
|
||
.setColor(Colors.Blue)
|
||
.setTimestamp();
|
||
}
|