prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  !watch alias is not working.
  The `!watch` alias broke when we changed the watch command to take a note instead of a channel - this is due to converters in the alias. I'll fix it.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `bot/cogs/alias.py`
  Content:
  ```
  1 import inspect
  2 import logging
  3 
  4 from discord import Colour, Embed, TextChannel, User
  5 from discord.ext.commands import (
  6     Command, Context, clean_content, command, group
  7 )
  8 
  9 from bot.converters import TagNameConverter
  10 from bot.pagination import LinePaginator
  11 
  12 log = logging.getLogger(__name__)
  13 
  14 
  15 class Alias:
  16     """
  17     Aliases for more used commands
  18     """
  19 
  20     def __init__(self, bot):
  21         self.bot = bot
  22 
  23     async def invoke(self, ctx, cmd_name, *args, **kwargs):
  24         """
  25         Invokes a command with args and kwargs.
  26         Fail early through `command.can_run`, and logs warnings.
  27 
  28         :param ctx: Context instance for command call
  29         :param cmd_name: Name of command/subcommand to be invoked
  30         :param args: args to be passed to the command
  31         :param kwargs: kwargs to be passed to the command
  32         :return: None
  33         """
  34 
  35         log.debug(f"{cmd_name} was invoked through an alias")
  36         cmd = self.bot.get_command(cmd_name)
  37         if not cmd:
  38             return log.warning(f'Did not find command "{cmd_name}" to invoke.')
  39         elif not await cmd.can_run(ctx):
  40             return log.warning(
  41                 f'{str(ctx.author)} tried to run the command "{cmd_name}"'
  42             )
  43 
  44         await ctx.invoke(cmd, *args, **kwargs)
  45 
  46     @command(name='aliases')
  47     async def aliases_command(self, ctx):
  48         """Show configured aliases on the bot."""
  49 
  50         embed = Embed(
  51             title='Configured aliases',
  52             colour=Colour.blue()
  53         )
  54         await LinePaginator.paginate(
  55             (
  56                 f"• `{ctx.prefix}{value.name}` "
  57                 f"=> `{ctx.prefix}{name[:-len('_alias')].replace('_', ' ')}`"
  58                 for name, value in inspect.getmembers(self)
  59                 if isinstance(value, Command) and name.endswith('_alias')
  60             ),
  61             ctx, embed, empty=False, max_lines=20
  62         )
  63 
  64     @command(name="resources", aliases=("resource",), hidden=True)
  65     async def site_resources_alias(self, ctx):
  66         """
  67         Alias for invoking <prefix>site resources.
  68         """
  69 
  70         await self.invoke(ctx, "site resources")
  71 
  72     @command(name="watch", hidden=True)
  73     async def bigbrother_watch_alias(
  74             self, ctx, user: User, channel: TextChannel = None
  75     ):
  76         """
  77         Alias for invoking <prefix>bigbrother watch user [text_channel].
  78         """
  79 
  80         await self.invoke(ctx, "bigbrother watch", user, channel)
  81 
  82     @command(name="unwatch", hidden=True)
  83     async def bigbrother_unwatch_alias(self, ctx, user: User):
  84         """
  85         Alias for invoking <prefix>bigbrother unwatch user.
  86 
  87         user: discord.User - A user instance to unwatch
  88         """
  89 
  90         await self.invoke(ctx, "bigbrother unwatch", user)
  91 
  92     @command(name="home", hidden=True)
  93     async def site_home_alias(self, ctx):
  94         """
  95         Alias for invoking <prefix>site home.
  96         """
  97 
  98         await self.invoke(ctx, "site home")
  99 
  100     @command(name="faq", hidden=True)
  101     async def site_faq_alias(self, ctx):
  102         """
  103         Alias for invoking <prefix>site faq.
  104         """
  105 
  106         await self.invoke(ctx, "site faq")
  107 
  108     @command(name="rules", hidden=True)
  109     async def site_rules_alias(self, ctx):
  110         """
  111         Alias for invoking <prefix>site rules.
  112         """
  113 
  114         await self.invoke(ctx, "site rules")
  115 
  116     @command(name="reload", hidden=True)
  117     async def cogs_reload_alias(self, ctx, *, cog_name: str):
  118         """
  119         Alias for invoking <prefix>cogs reload cog_name.
  120 
  121         cog_name: str - name of the cog to be reloaded.
  122         """
  123 
  124         await self.invoke(ctx, "cogs reload", cog_name)
  125 
  126     @command(name="defon", hidden=True)
  127     async def defcon_enable_alias(self, ctx):
  128         """
  129         Alias for invoking <prefix>defcon enable.
  130         """
  131 
  132         await self.invoke(ctx, "defcon enable")
  133 
  134     @command(name="defoff", hidden=True)
  135     async def defcon_disable_alias(self, ctx):
  136         """
  137         Alias for invoking <prefix>defcon disable.
  138         """
  139 
  140         await self.invoke(ctx, "defcon disable")
  141 
  142     @group(name="get",
  143            aliases=("show", "g"),
  144            hidden=True,
  145            invoke_without_command=True)
  146     async def get_group_alias(self, ctx):
  147         """
  148         Group for reverse aliases for commands like `tags get`,
  149         allowing for `get tags` or `get docs`.
  150         """
  151 
  152         pass
  153 
  154     @get_group_alias.command(name="tags", aliases=("tag", "t"), hidden=True)
  155     async def tags_get_alias(
  156             self, ctx: Context, *, tag_name: TagNameConverter = None
  157     ):
  158         """
  159         Alias for invoking <prefix>tags get [tag_name].
  160 
  161         tag_name: str - tag to be viewed.
  162         """
  163 
  164         await self.invoke(ctx, "tags get", tag_name)
  165 
  166     @get_group_alias.command(name="docs", aliases=("doc", "d"), hidden=True)
  167     async def docs_get_alias(
  168             self, ctx: Context, symbol: clean_content = None
  169     ):
  170         """
  171         Alias for invoking <prefix>docs get [symbol].
  172 
  173         symbol: str - name of doc to be viewed.
  174         """
  175 
  176         await self.invoke(ctx, "docs get", symbol)
  177 
  178 
  179 def setup(bot):
  180     bot.add_cog(Alias(bot))
  181     log.info("Cog loaded: Alias")
  182
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/bot/cogs/alias.py b/bot/cogs/alias.py
  --- a/bot/cogs/alias.py
  +++ b/bot/cogs/alias.py
  @@ -1,7 +1,7 @@
   import inspect
   import logging
   
  -from discord import Colour, Embed, TextChannel, User
  +from discord import Colour, Embed, User
   from discord.ext.commands import (
       Command, Context, clean_content, command, group
   )
  @@ -71,13 +71,13 @@
   
       @command(name="watch", hidden=True)
       async def bigbrother_watch_alias(
  -            self, ctx, user: User, channel: TextChannel = None
  +            self, ctx, user: User, *, reason: str = None
       ):
           """
           Alias for invoking <prefix>bigbrother watch user [text_channel].
           """
   
  -        await self.invoke(ctx, "bigbrother watch", user, channel)
  +        await self.invoke(ctx, "bigbrother watch", user, reason=reason)
   
       @command(name="unwatch", hidden=True)
       async def bigbrother_unwatch_alias(self, ctx, user: User):
  
verification_info: {"golden_diff": "diff --git a/bot/cogs/alias.py b/bot/cogs/alias.py\n--- a/bot/cogs/alias.py\n+++ b/bot/cogs/alias.py\n@@ -1,7 +1,7 @@\n import inspect\n import logging\n \n-from discord import Colour, Embed, TextChannel, User\n+from discord import Colour, Embed, User\n from discord.ext.commands import (\n     Command, Context, clean_content, command, group\n )\n@@ -71,13 +71,13 @@\n \n     @command(name=\"watch\", hidden=True)\n     async def bigbrother_watch_alias(\n-            self, ctx, user: User, channel: TextChannel = None\n+            self, ctx, user: User, *, reason: str = None\n     ):\n         \"\"\"\n         Alias for invoking <prefix>bigbrother watch user [text_channel].\n         \"\"\"\n \n-        await self.invoke(ctx, \"bigbrother watch\", user, channel)\n+        await self.invoke(ctx, \"bigbrother watch\", user, reason=reason)\n \n     @command(name=\"unwatch\", hidden=True)\n     async def bigbrother_unwatch_alias(self, ctx, user: User):\n", "issue": "!watch alias is not working.\nThe `!watch` alias broke when we changed the watch command to take a note instead of a channel - this is due to converters in the alias. I'll fix it.\n", "before_files": [{"content": "import inspect\nimport logging\n\nfrom discord import Colour, Embed, TextChannel, User\nfrom discord.ext.commands import (\n    Command, Context, clean_content, command, group\n)\n\nfrom bot.converters import TagNameConverter\nfrom bot.pagination import LinePaginator\n\nlog = logging.getLogger(__name__)\n\n\nclass Alias:\n    \"\"\"\n    Aliases for more used commands\n    \"\"\"\n\n    def __init__(self, bot):\n        self.bot = bot\n\n    async def invoke(self, ctx, cmd_name, *args, **kwargs):\n        \"\"\"\n        Invokes a command with args and kwargs.\n        Fail early through `command.can_run`, and logs warnings.\n\n        :param ctx: Context instance for command call\n        :param cmd_name: Name of command/subcommand to be invoked\n        :param args: args to be passed to the command\n        :param kwargs: kwargs to be passed to the command\n        :return: None\n        \"\"\"\n\n        log.debug(f\"{cmd_name} was invoked through an alias\")\n        cmd = self.bot.get_command(cmd_name)\n        if not cmd:\n            return log.warning(f'Did not find command \"{cmd_name}\" to invoke.')\n        elif not await cmd.can_run(ctx):\n            return log.warning(\n                f'{str(ctx.author)} tried to run the command \"{cmd_name}\"'\n            )\n\n        await ctx.invoke(cmd, *args, **kwargs)\n\n    @command(name='aliases')\n    async def aliases_command(self, ctx):\n        \"\"\"Show configured aliases on the bot.\"\"\"\n\n        embed = Embed(\n            title='Configured aliases',\n            colour=Colour.blue()\n        )\n        await LinePaginator.paginate(\n            (\n                f\"\u2022 `{ctx.prefix}{value.name}` \"\n                f\"=> `{ctx.prefix}{name[:-len('_alias')].replace('_', ' ')}`\"\n                for name, value in inspect.getmembers(self)\n                if isinstance(value, Command) and name.endswith('_alias')\n            ),\n            ctx, embed, empty=False, max_lines=20\n        )\n\n    @command(name=\"resources\", aliases=(\"resource\",), hidden=True)\n    async def site_resources_alias(self, ctx):\n        \"\"\"\n        Alias for invoking <prefix>site resources.\n        \"\"\"\n\n        await self.invoke(ctx, \"site resources\")\n\n    @command(name=\"watch\", hidden=True)\n    async def bigbrother_watch_alias(\n            self, ctx, user: User, channel: TextChannel = None\n    ):\n        \"\"\"\n        Alias for invoking <prefix>bigbrother watch user [text_channel].\n        \"\"\"\n\n        await self.invoke(ctx, \"bigbrother watch\", user, channel)\n\n    @command(name=\"unwatch\", hidden=True)\n    async def bigbrother_unwatch_alias(self, ctx, user: User):\n        \"\"\"\n        Alias for invoking <prefix>bigbrother unwatch user.\n\n        user: discord.User - A user instance to unwatch\n        \"\"\"\n\n        await self.invoke(ctx, \"bigbrother unwatch\", user)\n\n    @command(name=\"home\", hidden=True)\n    async def site_home_alias(self, ctx):\n        \"\"\"\n        Alias for invoking <prefix>site home.\n        \"\"\"\n\n        await self.invoke(ctx, \"site home\")\n\n    @command(name=\"faq\", hidden=True)\n    async def site_faq_alias(self, ctx):\n        \"\"\"\n        Alias for invoking <prefix>site faq.\n        \"\"\"\n\n        await self.invoke(ctx, \"site faq\")\n\n    @command(name=\"rules\", hidden=True)\n    async def site_rules_alias(self, ctx):\n        \"\"\"\n        Alias for invoking <prefix>site rules.\n        \"\"\"\n\n        await self.invoke(ctx, \"site rules\")\n\n    @command(name=\"reload\", hidden=True)\n    async def cogs_reload_alias(self, ctx, *, cog_name: str):\n        \"\"\"\n        Alias for invoking <prefix>cogs reload cog_name.\n\n        cog_name: str - name of the cog to be reloaded.\n        \"\"\"\n\n        await self.invoke(ctx, \"cogs reload\", cog_name)\n\n    @command(name=\"defon\", hidden=True)\n    async def defcon_enable_alias(self, ctx):\n        \"\"\"\n        Alias for invoking <prefix>defcon enable.\n        \"\"\"\n\n        await self.invoke(ctx, \"defcon enable\")\n\n    @command(name=\"defoff\", hidden=True)\n    async def defcon_disable_alias(self, ctx):\n        \"\"\"\n        Alias for invoking <prefix>defcon disable.\n        \"\"\"\n\n        await self.invoke(ctx, \"defcon disable\")\n\n    @group(name=\"get\",\n           aliases=(\"show\", \"g\"),\n           hidden=True,\n           invoke_without_command=True)\n    async def get_group_alias(self, ctx):\n        \"\"\"\n        Group for reverse aliases for commands like `tags get`,\n        allowing for `get tags` or `get docs`.\n        \"\"\"\n\n        pass\n\n    @get_group_alias.command(name=\"tags\", aliases=(\"tag\", \"t\"), hidden=True)\n    async def tags_get_alias(\n            self, ctx: Context, *, tag_name: TagNameConverter = None\n    ):\n        \"\"\"\n        Alias for invoking <prefix>tags get [tag_name].\n\n        tag_name: str - tag to be viewed.\n        \"\"\"\n\n        await self.invoke(ctx, \"tags get\", tag_name)\n\n    @get_group_alias.command(name=\"docs\", aliases=(\"doc\", \"d\"), hidden=True)\n    async def docs_get_alias(\n            self, ctx: Context, symbol: clean_content = None\n    ):\n        \"\"\"\n        Alias for invoking <prefix>docs get [symbol].\n\n        symbol: str - name of doc to be viewed.\n        \"\"\"\n\n        await self.invoke(ctx, \"docs get\", symbol)\n\n\ndef setup(bot):\n    bot.add_cog(Alias(bot))\n    log.info(\"Cog loaded: Alias\")\n", "path": "bot/cogs/alias.py"}], "after_files": [{"content": "import inspect\nimport logging\n\nfrom discord import Colour, Embed, User\nfrom discord.ext.commands import (\n    Command, Context, clean_content, command, group\n)\n\nfrom bot.converters import TagNameConverter\nfrom bot.pagination import LinePaginator\n\nlog = logging.getLogger(__name__)\n\n\nclass Alias:\n    \"\"\"\n    Aliases for more used commands\n    \"\"\"\n\n    def __init__(self, bot):\n        self.bot = bot\n\n    async def invoke(self, ctx, cmd_name, *args, **kwargs):\n        \"\"\"\n        Invokes a command with args and kwargs.\n        Fail early through `command.can_run`, and logs warnings.\n\n        :param ctx: Context instance for command call\n        :param cmd_name: Name of command/subcommand to be invoked\n        :param args: args to be passed to the command\n        :param kwargs: kwargs to be passed to the command\n        :return: None\n        \"\"\"\n\n        log.debug(f\"{cmd_name} was invoked through an alias\")\n        cmd = self.bot.get_command(cmd_name)\n        if not cmd:\n            return log.warning(f'Did not find command \"{cmd_name}\" to invoke.')\n        elif not await cmd.can_run(ctx):\n            return log.warning(\n                f'{str(ctx.author)} tried to run the command \"{cmd_name}\"'\n            )\n\n        await ctx.invoke(cmd, *args, **kwargs)\n\n    @command(name='aliases')\n    async def aliases_command(self, ctx):\n        \"\"\"Show configured aliases on the bot.\"\"\"\n\n        embed = Embed(\n            title='Configured aliases',\n            colour=Colour.blue()\n        )\n        await LinePaginator.paginate(\n            (\n                f\"\u2022 `{ctx.prefix}{value.name}` \"\n                f\"=> `{ctx.prefix}{name[:-len('_alias')].replace('_', ' ')}`\"\n                for name, value in inspect.getmembers(self)\n                if isinstance(value, Command) and name.endswith('_alias')\n            ),\n            ctx, embed, empty=False, max_lines=20\n        )\n\n    @command(name=\"resources\", aliases=(\"resource\",), hidden=True)\n    async def site_resources_alias(self, ctx):\n        \"\"\"\n        Alias for invoking <prefix>site resources.\n        \"\"\"\n\n        await self.invoke(ctx, \"site resources\")\n\n    @command(name=\"watch\", hidden=True)\n    async def bigbrother_watch_alias(\n            self, ctx, user: User, *, reason: str = None\n    ):\n        \"\"\"\n        Alias for invoking <prefix>bigbrother watch user [text_channel].\n        \"\"\"\n\n        await self.invoke(ctx, \"bigbrother watch\", user, reason=reason)\n\n    @command(name=\"unwatch\", hidden=True)\n    async def bigbrother_unwatch_alias(self, ctx, user: User):\n        \"\"\"\n        Alias for invoking <prefix>bigbrother unwatch user.\n\n        user: discord.User - A user instance to unwatch\n        \"\"\"\n\n        await self.invoke(ctx, \"bigbrother unwatch\", user)\n\n    @command(name=\"home\", hidden=True)\n    async def site_home_alias(self, ctx):\n        \"\"\"\n        Alias for invoking <prefix>site home.\n        \"\"\"\n\n        await self.invoke(ctx, \"site home\")\n\n    @command(name=\"faq\", hidden=True)\n    async def site_faq_alias(self, ctx):\n        \"\"\"\n        Alias for invoking <prefix>site faq.\n        \"\"\"\n\n        await self.invoke(ctx, \"site faq\")\n\n    @command(name=\"rules\", hidden=True)\n    async def site_rules_alias(self, ctx):\n        \"\"\"\n        Alias for invoking <prefix>site rules.\n        \"\"\"\n\n        await self.invoke(ctx, \"site rules\")\n\n    @command(name=\"reload\", hidden=True)\n    async def cogs_reload_alias(self, ctx, *, cog_name: str):\n        \"\"\"\n        Alias for invoking <prefix>cogs reload cog_name.\n\n        cog_name: str - name of the cog to be reloaded.\n        \"\"\"\n\n        await self.invoke(ctx, \"cogs reload\", cog_name)\n\n    @command(name=\"defon\", hidden=True)\n    async def defcon_enable_alias(self, ctx):\n        \"\"\"\n        Alias for invoking <prefix>defcon enable.\n        \"\"\"\n\n        await self.invoke(ctx, \"defcon enable\")\n\n    @command(name=\"defoff\", hidden=True)\n    async def defcon_disable_alias(self, ctx):\n        \"\"\"\n        Alias for invoking <prefix>defcon disable.\n        \"\"\"\n\n        await self.invoke(ctx, \"defcon disable\")\n\n    @group(name=\"get\",\n           aliases=(\"show\", \"g\"),\n           hidden=True,\n           invoke_without_command=True)\n    async def get_group_alias(self, ctx):\n        \"\"\"\n        Group for reverse aliases for commands like `tags get`,\n        allowing for `get tags` or `get docs`.\n        \"\"\"\n\n        pass\n\n    @get_group_alias.command(name=\"tags\", aliases=(\"tag\", \"t\"), hidden=True)\n    async def tags_get_alias(\n            self, ctx: Context, *, tag_name: TagNameConverter = None\n    ):\n        \"\"\"\n        Alias for invoking <prefix>tags get [tag_name].\n\n        tag_name: str - tag to be viewed.\n        \"\"\"\n\n        await self.invoke(ctx, \"tags get\", tag_name)\n\n    @get_group_alias.command(name=\"docs\", aliases=(\"doc\", \"d\"), hidden=True)\n    async def docs_get_alias(\n            self, ctx: Context, symbol: clean_content = None\n    ):\n        \"\"\"\n        Alias for invoking <prefix>docs get [symbol].\n\n        symbol: str - name of doc to be viewed.\n        \"\"\"\n\n        await self.invoke(ctx, \"docs get\", symbol)\n\n\ndef setup(bot):\n    bot.add_cog(Alias(bot))\n    log.info(\"Cog loaded: Alias\")\n", "path": "bot/cogs/alias.py"}]}