diff options
| author | 2021-04-12 19:30:55 +0100 | |
|---|---|---|
| committer | 2021-04-12 19:30:55 +0100 | |
| commit | 806a057eb97e02ccfd14e1f7644f5c04d4e749cd (patch) | |
| tree | 4597cad33f489d78341ba71e09d1749a0b465cf5 | |
| parent | Remove reactions from everyone when paginating and waiting for trashcan react... (diff) | |
| parent | Merge branch 'main' into dont-use-startswith (diff) | |
Merge pull request #1521 from ToxicKidz/dont-use-startswith
Use == instead of str.startswith when getting the source for a Command
| -rw-r--r-- | bot/exts/info/source.py | 5 | 
1 files changed, 3 insertions, 2 deletions
| diff --git a/bot/exts/info/source.py b/bot/exts/info/source.py index 78a6f68ac..ef07c77a1 100644 --- a/bot/exts/info/source.py +++ b/bot/exts/info/source.py @@ -14,9 +14,10 @@ SourceType = Union[commands.HelpCommand, commands.Command, commands.Cog, str, co  class SourceConverter(commands.Converter):      """Convert an argument into a help command, tag, command, or cog.""" -    async def convert(self, ctx: commands.Context, argument: str) -> SourceType: +    @staticmethod +    async def convert(ctx: commands.Context, argument: str) -> SourceType:          """Convert argument into source object.""" -        if argument.lower().startswith("help"): +        if argument.lower() == "help":              return ctx.bot.help_command          cog = ctx.bot.get_cog(argument) | 
