generated from nhcarrigan/template
All checks were successful
Node.js CI / Lint and Test (pull_request) Successful in 1m17s
59 lines
3.2 KiB
JavaScript
59 lines
3.2 KiB
JavaScript
/**
|
|
* @copyright nhcarrigan
|
|
* @license Naomi's Public License
|
|
* @author Naomi Carrigan
|
|
*/
|
|
import { TextDisplayBuilder, SeparatorBuilder, SeparatorSpacingSize, ContainerBuilder, ButtonBuilder, ButtonStyle, ActionRowBuilder, MessageFlags, } from "discord.js";
|
|
import { errorHandler } from "../utils/errorHandler.js";
|
|
/**
|
|
* Handles the `/about` command interaction.
|
|
* @param _hikari - Hikari's Discord instance (unused).
|
|
* @param interaction - The command interaction payload from Discord.
|
|
*/
|
|
// eslint-disable-next-line max-lines-per-function -- It's mostly components.
|
|
export const about = async (_hikari, interaction) => {
|
|
try {
|
|
const components = [
|
|
new ContainerBuilder().
|
|
addTextDisplayComponents(new TextDisplayBuilder().setContent("# About Hikari")).
|
|
addTextDisplayComponents(new TextDisplayBuilder().setContent(
|
|
// eslint-disable-next-line stylistic/max-len -- Big boi string.
|
|
"Hi there~! I am Hikari, an AI agent specifically tailored to help you understand and use NHCarrigan's products!")).
|
|
addSeparatorComponents(new SeparatorBuilder().
|
|
setSpacing(SeparatorSpacingSize.Small).
|
|
setDivider(true)).
|
|
addTextDisplayComponents(new TextDisplayBuilder().setContent("## What can I do?")).
|
|
addTextDisplayComponents(new TextDisplayBuilder().setContent(
|
|
// eslint-disable-next-line stylistic/max-len -- Big boi string.
|
|
"To get started, you will need to purchase the user subscription from my Discord store. Then you can send me a direct message to ask questions about NHCarrigan's work.\n\nIf you cannot find our DM channel, run the `/dm` command and I will ping you!")).
|
|
addSeparatorComponents(new SeparatorBuilder().
|
|
setSpacing(SeparatorSpacingSize.Small).
|
|
setDivider(true)).
|
|
addTextDisplayComponents(new TextDisplayBuilder().setContent("## What if I need more help?")).
|
|
addTextDisplayComponents(new TextDisplayBuilder().setContent(
|
|
// eslint-disable-next-line stylistic/max-len -- Big boi string.
|
|
"My deepest apologies! I am not perfect, though I do try my best. If you have a question that I just cannot answer, you should save yourself some time and reach out to the team via one of the support channels!")),
|
|
new ActionRowBuilder().addComponents(new ButtonBuilder().
|
|
setStyle(ButtonStyle.Link).
|
|
setLabel("Discord Server").
|
|
setURL("https://chat.nhcarrigan.com"), new ButtonBuilder().
|
|
setStyle(ButtonStyle.Link).
|
|
setLabel("Forum").
|
|
setURL("https://forum.nhcarrigan.com")),
|
|
];
|
|
await interaction.reply({
|
|
components,
|
|
flags: MessageFlags.IsComponentsV2,
|
|
});
|
|
}
|
|
catch (error) {
|
|
await errorHandler(error, "about command");
|
|
await interaction.reply({
|
|
content:
|
|
// eslint-disable-next-line stylistic/max-len -- Big boi string.
|
|
"An error occurred while processing your request. Please try again later.",
|
|
ephemeral: true,
|
|
});
|
|
}
|
|
};
|