sravan1946 / sravan-cogs

Some random cogs made by me for my bot made using Red-DiscordBot
MIT License
6 stars 10 forks source link

[Prefix] Add Check to PrefixConverter to Prevent `/` Prefixes #37

Closed mellow-org closed 2 months ago

mellow-org commented 2 months ago

Prefixes cannot start with a slash (/) because it raises a ValueError, indicating a conflict with Discord slash commands. This check has been added to the converter to prevent the issue.

Summary by Sourcery

Prevent prefixes from starting with a slash in the PrefixConverter to avoid conflicts with Discord slash commands and update the version of the Prefix management cog.

Bug Fixes:

Enhancements:

sourcery-ai[bot] commented 2 months ago

Reviewer's Guide by Sourcery

This pull request adds a new check to the PrefixConverter class to prevent prefixes that start with a forward slash (/). The change is implemented by adding a conditional statement in the convert method of the PrefixConverter class. Additionally, the version number of the Prefix cog has been updated.

File-Level Changes

Files Changes
prefix/converters.py Added a new check in the PrefixConverter's convert method to raise a BadArgument if the prefix starts with a slash
prefix/prefix.py Updated the version number of the Prefix cog from 1.0.4 to 1.0.5

Tips - Trigger a new Sourcery review by commenting `@sourcery-ai review` on the pull request. - Continue your discussion with Sourcery by replying directly to review comments. - You can change your review settings at any time by accessing your [dashboard](https://app.sourcery.ai): - Enable or disable the Sourcery-generated pull request summary or reviewer's guide; - Change the review language; - You can always [contact us](mailto:support@sourcery.ai) if you have any questions or feedback.
sravan1946 commented 2 months ago

LGTM, could you run pre-commit on it @mellow-org

mellow-org commented 2 months ago

Done! @sravan1946