generated from nhcarrigan/template
feat: build out discord support agent (#4)
All checks were successful
Node.js CI / Lint and Test (push) Successful in 1m20s
All checks were successful
Node.js CI / Lint and Test (push) Successful in 1m20s
### Explanation _No response_ ### Issue _No response_ ### Attestations - [x] I have read and agree to the [Code of Conduct](https://docs.nhcarrigan.com/community/coc/) - [x] I have read and agree to the [Community Guidelines](https://docs.nhcarrigan.com/community/guide/). - [x] My contribution complies with the [Contributor Covenant](https://docs.nhcarrigan.com/dev/covenant/). ### Dependencies - [x] I have pinned the dependencies to a specific patch version. ### Style - [x] I have run the linter and resolved any errors. - [x] My pull request uses an appropriate title, matching the conventional commit standards. - [x] My scope of feat/fix/chore/etc. correctly matches the nature of changes in my pull request. ### Tests - [ ] My contribution adds new code, and I have added tests to cover it. - [ ] My contribution modifies existing code, and I have updated the tests to reflect these changes. - [ ] All new and existing tests pass locally with my changes. - [ ] Code coverage remains at or above the configured threshold. ### Documentation _No response_ ### Versioning _No response_ Reviewed-on: #4 Co-authored-by: Naomi Carrigan <commits@nhcarrigan.com> Co-committed-by: Naomi Carrigan <commits@nhcarrigan.com>
This commit is contained in:
58
bot/prod/commands/about.js
Normal file
58
bot/prod/commands/about.js
Normal file
@ -0,0 +1,58 @@
|
||||
/**
|
||||
* @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,
|
||||
});
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user