Skip to content

Commit

Permalink
feat: add optional description to /locate panels (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
ExampleWasTaken authored Jul 27, 2024
1 parent 547b51a commit b631a81
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ MONGODB_DATABASE=fbw
MONGODB_URL=mongodb://admin:1234@localhost:27017/fbw?authSource=admin

# Below are examples of what this .env entry could be.
IMAGE_BASE_URL=https://assets.discord.flybywirecdn.com/assets/images
IMAGE_BASE_URL=https://assets-staging.discord.flybywirecdn.com/assets/images
IMAGE_BASE_URL=https://assets.discord.flybywirecdn.com/utils/assets/images
IMAGE_BASE_URL=https://assets-staging.discord.flybywirecdn.com/utils/assets/images/
IMAGE_BASE_URL=YourOwnLocationForLocalDev

# You will need the following to upload to cloudflare
Expand Down
4 changes: 4 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Changelog

Update <small>_ July 2024</small>

- feat: add optional description to `/locate` panels. (27/07/2024)

Update <small>_ May 2024</small>

- fix: keep footer on embed expire (29/05/2024)
Expand Down
1 change: 1 addition & 0 deletions src/commands/utils/locate/functions/handleCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const locateEmbed = (panel: Panel) => makeEmbed({
`* [${panel.name} Documentation](${panel.docsUrl})`,
`* [Flight Deck Overview](${panel.flightDeckUrl})`,
]),
fields: panel.description ? [panel.description] : [],
image: { url: panel.imageUrl },
footer: { text: 'Tip: Click the image to view in full size' },
});
Expand Down
9 changes: 9 additions & 0 deletions src/commands/utils/locate/panels/a32nx/overhead.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { makeLines } from '../../../../../lib';
import { LOCATE_DOCS_BASE_URLS, LOCATE_IMAGE_BASE_URLS } from '../../base-urls';
import { Panel } from '../panel';

Expand Down Expand Up @@ -142,6 +143,14 @@ export const fltCtlPanel: Panel = {
export const adirsPanel: Panel = {
name: 'ADIRS Panel',
title: 'FlyByWire A32NX | ADIRS Panel',
description: {
name: 'Aligning the ADIRSs',
value: makeLines([
'On the overhead panel you will see the three switches under \'ADIRS\'. Turn these three to the \'NAV\' position. It takes several minutes for the ADIRUs to align.',
'You can check how long you have to wait by looking at the align time on your Upper Ecam.',
]),
inline: false,
},
docsUrl: `${OVHD_DOCS_BASE_URL}/adirs/`,
flightDeckUrl: LOCATE_DOCS_BASE_URLS.a32nx.flightdeck,
imageUrl: `${OVHD_IMAGE_BASE_URL}/adirs.png`,
Expand Down
7 changes: 7 additions & 0 deletions src/commands/utils/locate/panels/panel.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { EmbedField } from 'discord.js';

export interface Panel {
/**
* The name of the Panel. This should be usable in sentences.
Expand All @@ -9,6 +11,11 @@ export interface Panel {
*/
title: string;

/**
* Optional description for a panel such as instructions on aligning the ADIRSs.
*/
description?: EmbedField;

/**
* The URL to the relevant documentation.
*/
Expand Down

0 comments on commit b631a81

Please sign in to comment.