From c273f26805a217784ab2ae8a11250e5f046ddcb6 Mon Sep 17 00:00:00 2001 From: ster <67447246+ster-phys@users.noreply.github.com> Date: Mon, 3 Oct 2022 06:52:18 +0900 Subject: [PATCH] Add coro tag to docstrings that were missing it --- discord/channel.py | 3 ++- discord/ext/commands/bot.py | 4 +++- discord/ext/commands/cog.py | 12 +++++++++--- discord/ext/commands/help.py | 10 ++++++++-- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/discord/channel.py b/discord/channel.py index a39a62789..0790f09a5 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -566,7 +566,8 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable): return Webhook.from_state(data, state=self._state) async def follow(self, *, destination: TextChannel, reason: Optional[str] = None) -> Webhook: - """ + """|coro| + Follows a channel using a webhook. Only news channels can be followed. diff --git a/discord/ext/commands/bot.py b/discord/ext/commands/bot.py index dd2b9dcdc..41bbc6a13 100644 --- a/discord/ext/commands/bot.py +++ b/discord/ext/commands/bot.py @@ -902,7 +902,9 @@ class BotBase(GroupMixin[None]): await self._call_module_finalizers(lib, name) async def reload_extension(self, name: str, *, package: Optional[str] = None) -> None: - """Atomically reloads an extension. + """|coro| + + Atomically reloads an extension. This replaces the extension with the same extension, only refreshed. This is equivalent to a :meth:`unload_extension` followed by a :meth:`load_extension` diff --git a/discord/ext/commands/cog.py b/discord/ext/commands/cog.py index ec01937aa..2302b1754 100644 --- a/discord/ext/commands/cog.py +++ b/discord/ext/commands/cog.py @@ -391,7 +391,9 @@ class Cog(metaclass=CogMeta): @_cog_special_method async def cog_command_error(self, ctx: Context[BotT], error: Exception) -> None: - """A special method that is called whenever an error + """|coro| + + A special method that is called whenever an error is dispatched inside this cog. This is similar to :func:`.on_command_error` except only applying @@ -410,7 +412,9 @@ class Cog(metaclass=CogMeta): @_cog_special_method async def cog_before_invoke(self, ctx: Context[BotT]) -> None: - """A special method that acts as a cog local pre-invoke hook. + """|coro| + + A special method that acts as a cog local pre-invoke hook. This is similar to :meth:`.Command.before_invoke`. @@ -425,7 +429,9 @@ class Cog(metaclass=CogMeta): @_cog_special_method async def cog_after_invoke(self, ctx: Context[BotT]) -> None: - """A special method that acts as a cog local post-invoke hook. + """|coro| + + A special method that acts as a cog local post-invoke hook. This is similar to :meth:`.Command.after_invoke`. diff --git a/discord/ext/commands/help.py b/discord/ext/commands/help.py index 516b78ed3..525ded81f 100644 --- a/discord/ext/commands/help.py +++ b/discord/ext/commands/help.py @@ -1169,7 +1169,10 @@ class DefaultHelpCommand(HelpCommand): self.paginator.add_line(entry) async def send_pages(self) -> None: - """A helper utility to send the page output from :attr:`paginator` to the destination.""" + """|coro| + + A helper utility to send the page output from :attr:`paginator` to the destination. + """ destination = self.get_destination() for page in self.paginator.pages: await destination.send(page) @@ -1331,7 +1334,10 @@ class MinimalHelpCommand(HelpCommand): super().__init__(**options) async def send_pages(self) -> None: - """A helper utility to send the page output from :attr:`paginator` to the destination.""" + """|coro| + + A helper utility to send the page output from :attr:`paginator` to the destination. + """ destination = self.get_destination() for page in self.paginator.pages: await destination.send(page)