Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: auto-generation of the command table #7

Merged
merged 7 commits into from
Jan 25, 2024

Conversation

benw202
Copy link
Member

@benw202 benw202 commented Jan 21, 2024

Description

This PR adds a command which automatically generates a Markdown table populated with command data from the Discord API.

It replaces the previous method of filling in our command table documentation manually. Once the command has been merged, deployed and successfully tested, a bot developer, docs team member, moderator or admin can run the /generate_command_table command, which will generate the table, and upload it to Cloudflare R2 where the FBW docs site can embed it.

4 env to be added to DO:

CLOUDFLARE_BUCKET_NAME
CLOUDFLARE_ACCOUNT_ID
CLOUDFLARE_ACCESS_KEY_ID
CLOUDFLARE_SECRET_ACCESS_KEY

This could be added to the schedular to run every 6/12 hours.

Test Results

N/A yet

Discord Username

benw8484

@benw202 benw202 marked this pull request as ready for review January 24, 2024 22:09
@benw202
Copy link
Member Author

benw202 commented Jan 24, 2024

Do we want to talk about this in the contributing guidelines? If so, I feel we need to talk about the assets/image uploads too

@benw202 benw202 marked this pull request as draft January 24, 2024 22:27
@benw202 benw202 marked this pull request as ready for review January 24, 2024 22:27
Copy link
Collaborator

@pdellaert pdellaert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small change, otherwise looks great!

import { slashCommand, slashCommandStructure, Logger, constantsConfig } from '../../lib';

const data = slashCommandStructure({
name: 'generate_command_table',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we make that with - instead of _, it feels more natural as a command

Suggested change
name: 'generate_command_table',
name: 'generate-command-table',

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

All other commands currently use _. Do we want to refactor all commands?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

All other commands currently use _. Do we want to refactor all commands?

Thought we discussed to do so? Overall, - is used in natural language and easier to use than _, which requires pressing the SHIFT key, seems minor, but it is a difference; and is not something that appears in natural language.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potentially we did - has not happened yet if so!

I can merge this one as is, and I'll go through and refactor all at once in the next PR?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good :)

@benw202 benw202 merged commit edfaf7e into flybywiresim:staging Jan 25, 2024
3 checks passed
@benw202 benw202 deleted the command-table branch January 25, 2024 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants