From 06f1ef79d7d6acdf0d7057f7ff5738e5fe137edb Mon Sep 17 00:00:00 2001 From: jazlynn Date: Thu, 3 Oct 2024 11:19:24 -0400 Subject: [PATCH 1/3] created /office command to provide information for csc office --- package.json | 3 +- src/commandDetails/miscellaneous/office.ts | 53 ++++++++++++++++++++++ src/commands/miscellaneous/office.ts | 16 +++++++ 3 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 src/commandDetails/miscellaneous/office.ts create mode 100644 src/commands/miscellaneous/office.ts diff --git a/package.json b/package.json index 82389e68..fb8d508d 100644 --- a/package.json +++ b/package.json @@ -63,5 +63,6 @@ "nodemon": "^2.0.22", "prettier": "^2.8.7", "tsc-watch": "^4.6.2" - } + }, + "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" } diff --git a/src/commandDetails/miscellaneous/office.ts b/src/commandDetails/miscellaneous/office.ts new file mode 100644 index 00000000..8bcb0558 --- /dev/null +++ b/src/commandDetails/miscellaneous/office.ts @@ -0,0 +1,53 @@ +import { container } from '@sapphire/framework'; +import { EmbedBuilder } from 'discord.js'; +import { + CodeyCommandDetails, + SapphireMessageExecuteType, + SapphireMessageResponse, +} from '../../codeyCommand'; +import { DEFAULT_EMBED_COLOUR } from '../../utils/embeds'; + + +const officeExecuteCommand: SapphireMessageExecuteType = async( + _client, + _messageFromUser, + _args, + ): Promise => { + + const officeEmbed = new EmbedBuilder() + .setColor(DEFAULT_EMBED_COLOUR) + .setTitle(`About the CSC Office`) + .setThumbnail('https://cdn.discordapp.com/emojis/869377257586704407.png') + .setDescription(`Find us in MC 3036/3037!`) + .addFields([ + { + name: `What we offer:`, + value: ` + • Pop for just 50 cents + • Informative books + • 5 computer terminals + • (sometimes) super knowledgeable people `, + }, + { + name: `Call us!`, + value: `(519) 888-4567 x33870`, + }, + ]); + // look at info.ts about coin to see embded details + return { embeds: [officeEmbed]}; + }; + + + export const officeCommandDetails: CodeyCommandDetails = { + name: 'office', + aliases: [], + description: 'Get information about the CSC office.', + detailedDescription: `no detailed description yet`, + + isCommandResponseEphemeral: false, + messageWhenExecutingCommand: 'Retrieving information about the office...', + executeCommand: officeExecuteCommand, + messageIfFailure: 'Could not retrieve information about office.', + options: [], + subcommandDetails: {}, + }; \ No newline at end of file diff --git a/src/commands/miscellaneous/office.ts b/src/commands/miscellaneous/office.ts new file mode 100644 index 00000000..f8c38e29 --- /dev/null +++ b/src/commands/miscellaneous/office.ts @@ -0,0 +1,16 @@ +import { Command } from '@sapphire/framework'; +import { CodeyCommand } from '../../codeyCommand'; +import { officeCommandDetails } from '../../commandDetails/miscellaneous/office'; + +export class MiscellaneousOfficeCommand extends CodeyCommand { + details = officeCommandDetails; + + public constructor(context: Command.Context, options: Command.Options) { + super(context, { + ...options, + aliases: officeCommandDetails.aliases, + description: officeCommandDetails.description, + detailedDescription: officeCommandDetails.detailedDescription, + }); + } +} From 91e5b5596d092de1c4ce4a5a7f94891e59b8bef6 Mon Sep 17 00:00:00 2001 From: jazlynn Date: Thu, 3 Oct 2024 11:42:03 -0400 Subject: [PATCH 2/3] fixed formatting and linting issues --- docs/COMMAND-WIKI.md | 7 ++ src/commandDetails/miscellaneous/office.ts | 76 ++++++++++------------ 2 files changed, 43 insertions(+), 40 deletions(-) diff --git a/docs/COMMAND-WIKI.md b/docs/COMMAND-WIKI.md index c2cc7eca..89f9db02 100644 --- a/docs/COMMAND-WIKI.md +++ b/docs/COMMAND-WIKI.md @@ -258,6 +258,13 @@ - ``uwid``: The Quest ID of the user. - **Subcommands:** None +## office +- **Aliases:** None +- **Description:** Get information about the CSC office. +- no detailed description yet +- **Options:** None +- **Subcommands:** None + ## ping - **Aliases:** `pong` - **Description:** Ping the bot to see if it is alive. :ping_pong: diff --git a/src/commandDetails/miscellaneous/office.ts b/src/commandDetails/miscellaneous/office.ts index 8bcb0558..d341e691 100644 --- a/src/commandDetails/miscellaneous/office.ts +++ b/src/commandDetails/miscellaneous/office.ts @@ -1,4 +1,3 @@ -import { container } from '@sapphire/framework'; import { EmbedBuilder } from 'discord.js'; import { CodeyCommandDetails, @@ -7,47 +6,44 @@ import { } from '../../codeyCommand'; import { DEFAULT_EMBED_COLOUR } from '../../utils/embeds'; - -const officeExecuteCommand: SapphireMessageExecuteType = async( - _client, - _messageFromUser, - _args, - ): Promise => { - - const officeEmbed = new EmbedBuilder() - .setColor(DEFAULT_EMBED_COLOUR) - .setTitle(`About the CSC Office`) - .setThumbnail('https://cdn.discordapp.com/emojis/869377257586704407.png') - .setDescription(`Find us in MC 3036/3037!`) - .addFields([ - { - name: `What we offer:`, - value: ` +const officeExecuteCommand: SapphireMessageExecuteType = async ( + _client, + _messageFromUser, + _args, +): Promise => { + const officeEmbed = new EmbedBuilder() + .setColor(DEFAULT_EMBED_COLOUR) + .setTitle(`About the CSC Office`) + .setThumbnail('https://cdn.discordapp.com/emojis/869377257586704407.png') + .setDescription(`Find us in MC 3036/3037!`) + .addFields([ + { + name: `What we offer:`, + value: ` • Pop for just 50 cents • Informative books • 5 computer terminals • (sometimes) super knowledgeable people `, - }, - { - name: `Call us!`, - value: `(519) 888-4567 x33870`, - }, - ]); - // look at info.ts about coin to see embded details - return { embeds: [officeEmbed]}; - }; + }, + { + name: `Call us!`, + value: `(519) 888-4567 x33870`, + }, + ]); + // look at info.ts about coin to see embded details + return { embeds: [officeEmbed] }; +}; + +export const officeCommandDetails: CodeyCommandDetails = { + name: 'office', + aliases: [], + description: 'Get information about the CSC office.', + detailedDescription: `no detailed description yet`, - - export const officeCommandDetails: CodeyCommandDetails = { - name: 'office', - aliases: [], - description: 'Get information about the CSC office.', - detailedDescription: `no detailed description yet`, - - isCommandResponseEphemeral: false, - messageWhenExecutingCommand: 'Retrieving information about the office...', - executeCommand: officeExecuteCommand, - messageIfFailure: 'Could not retrieve information about office.', - options: [], - subcommandDetails: {}, - }; \ No newline at end of file + isCommandResponseEphemeral: false, + messageWhenExecutingCommand: 'Retrieving information about the office...', + executeCommand: officeExecuteCommand, + messageIfFailure: 'Could not retrieve information about office.', + options: [], + subcommandDetails: {}, +}; From 4b6cbd4f820a3642b356bab6cb68d51c7bfd9dec Mon Sep 17 00:00:00 2001 From: jazlynn Date: Fri, 29 Nov 2024 15:53:38 -0500 Subject: [PATCH 3/3] removed line in package.json, adding example use into detailed description --- docs/COMMAND-WIKI.md | 2 +- package.json | 3 +-- src/commandDetails/miscellaneous/office.ts | 6 +++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/COMMAND-WIKI.md b/docs/COMMAND-WIKI.md index 89f9db02..90690aa7 100644 --- a/docs/COMMAND-WIKI.md +++ b/docs/COMMAND-WIKI.md @@ -261,7 +261,7 @@ ## office - **Aliases:** None - **Description:** Get information about the CSC office. -- no detailed description yet +- **Examples:**
`.office` - **Options:** None - **Subcommands:** None diff --git a/package.json b/package.json index fb8d508d..82389e68 100644 --- a/package.json +++ b/package.json @@ -63,6 +63,5 @@ "nodemon": "^2.0.22", "prettier": "^2.8.7", "tsc-watch": "^4.6.2" - }, - "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" + } } diff --git a/src/commandDetails/miscellaneous/office.ts b/src/commandDetails/miscellaneous/office.ts index d341e691..9edf82b6 100644 --- a/src/commandDetails/miscellaneous/office.ts +++ b/src/commandDetails/miscellaneous/office.ts @@ -1,3 +1,4 @@ +import { container } from '@sapphire/framework'; import { EmbedBuilder } from 'discord.js'; import { CodeyCommandDetails, @@ -30,7 +31,6 @@ const officeExecuteCommand: SapphireMessageExecuteType = async ( value: `(519) 888-4567 x33870`, }, ]); - // look at info.ts about coin to see embded details return { embeds: [officeEmbed] }; }; @@ -38,8 +38,8 @@ export const officeCommandDetails: CodeyCommandDetails = { name: 'office', aliases: [], description: 'Get information about the CSC office.', - detailedDescription: `no detailed description yet`, - + detailedDescription: `**Examples:** + \`${container.botPrefix}office\``, isCommandResponseEphemeral: false, messageWhenExecutingCommand: 'Retrieving information about the office...', executeCommand: officeExecuteCommand,