Repel context menu presets - #77
Open
Perp-dev-guy wants to merge 1 commit into
Open
Conversation
hmd-ali
reviewed
Aug 16, 2026
| }, | ||
| }); | ||
|
|
||
| const presetCommands = presets.flatMap(({ frontmatter, content }) => { |
Contributor
There was a problem hiding this comment.
This should be a normal map, and should return createMessageContextMenuCommand directly instead of [createMessageContextMenuCommand...]
Comment on lines
+337
to
+339
| const commandName = interaction.isChatInputCommand() | ||
| ? buildCommandString(interaction) | ||
| : `Repel: ${interaction.commandName}`; |
Contributor
There was a problem hiding this comment.
This should be called commandInfo, and just return the commandName in case if it's a context menu command.
Suggested change
| const commandName = interaction.isChatInputCommand() | |
| ? buildCommandString(interaction) | |
| : `Repel: ${interaction.commandName}`; | |
| const commandInfo = interaction.isChatInputCommand() | |
| ? buildCommandString(interaction) | |
| : interaction.commandName; |
| .setDescription( | ||
| `Used \`repel\` command in ${channelInfo}.\n${buildCommandString(interaction)}` | ||
| ) | ||
| .setDescription(`Used \`repel\` command in ${channelInfo}.\n${commandName}`) |
Contributor
There was a problem hiding this comment.
Suggested change
| .setDescription(`Used \`repel\` command in ${channelInfo}.\n${commandName}`) | |
| .setDescription(`Used \`repel\` command in ${channelInfo}.\n${commandInfo}`) |
| target, | ||
| lookBack: Number(frontmatter.lookBack ?? 10) * MINUTE, | ||
| }); | ||
| const shouldDMUser = frontmatter.dmUser !== 'false'; |
Contributor
There was a problem hiding this comment.
We should explicitly check for dmUser: true in the markdown files, otherwise everything other than false would be treated as true.
Suggested change
| const shouldDMUser = frontmatter.dmUser !== 'false'; | |
| const shouldDMUser = frontmatter.dmUser === 'true' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a folder of markdown files containing dynamic presets for repels. it is shown to all users however it will deny access to users with improper permissions. These presets are then handled inside of the repel.ts file and handled the same as any other repel with the only difference being the preset options.