feat: Add precondition system for command validation#61
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances command validation by implementing a new precondition system. This system allows for custom checks to be run before a command executes, ensuring that commands are only processed when specific criteria are met. It improves user experience by providing immediate and informative feedback when commands are used improperly or without the necessary permissions. Additionally, it includes minor updates to dependency metadata and an example script for easier testing. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a robust precondition system for command validation, which is an excellent feature for the framework. However, a security concern was identified regarding the handling of mentions in precondition error messages for message-based commands, which could be exploited for mention spam. Additionally, I've included a few suggestions to enhance conciseness and make better use of the discord.js API within the example files.
options
BREAKING CHANGE: Preconditions must now return `[boolean]` or
`[boolean, TranslateOptions]` instead of just `boolean`. The
`errorMessage` property has been removed from IPrecondition. Error
messages are now resolved via i18n using the key
`error:precondition.{name}`.
|
Cok ii review yapionus ;3 |
No description provided.