mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 12:18:59 +00:00
Add coro tag to docstrings that were missing it
This commit is contained in:
parent
dc34a8f1dc
commit
95b6bd8782
@ -983,7 +983,9 @@ class CommandTree(Generic[ClientT]):
|
|||||||
return self._state._translator
|
return self._state._translator
|
||||||
|
|
||||||
async def set_translator(self, translator: Optional[Translator]) -> None:
|
async def set_translator(self, translator: Optional[Translator]) -> None:
|
||||||
"""Sets the translator to use for translating commands.
|
"""|coro|
|
||||||
|
|
||||||
|
Sets the translator to use for translating commands.
|
||||||
|
|
||||||
If a translator was previously set, it will be unloaded using its
|
If a translator was previously set, it will be unloaded using its
|
||||||
:meth:`Translator.unload` method.
|
:meth:`Translator.unload` method.
|
||||||
|
@ -594,7 +594,8 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable):
|
|||||||
return Webhook.from_state(data, state=self._state)
|
return Webhook.from_state(data, state=self._state)
|
||||||
|
|
||||||
async def follow(self, *, destination: TextChannel, reason: Optional[str] = None) -> Webhook:
|
async def follow(self, *, destination: TextChannel, reason: Optional[str] = None) -> Webhook:
|
||||||
"""
|
"""|coro|
|
||||||
|
|
||||||
Follows a channel using a webhook.
|
Follows a channel using a webhook.
|
||||||
|
|
||||||
Only news channels can be followed.
|
Only news channels can be followed.
|
||||||
|
@ -1059,7 +1059,9 @@ class BotBase(GroupMixin[None]):
|
|||||||
await self._call_module_finalizers(lib, name)
|
await self._call_module_finalizers(lib, name)
|
||||||
|
|
||||||
async def reload_extension(self, name: str, *, package: Optional[str] = None) -> None:
|
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
|
This replaces the extension with the same extension, only refreshed. This is
|
||||||
equivalent to a :meth:`unload_extension` followed by a :meth:`load_extension`
|
equivalent to a :meth:`unload_extension` followed by a :meth:`load_extension`
|
||||||
|
@ -579,7 +579,9 @@ class Cog(metaclass=CogMeta):
|
|||||||
|
|
||||||
@_cog_special_method
|
@_cog_special_method
|
||||||
async def cog_command_error(self, ctx: Context[BotT], error: Exception) -> None:
|
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.
|
is dispatched inside this cog.
|
||||||
|
|
||||||
This is similar to :func:`.on_command_error` except only applying
|
This is similar to :func:`.on_command_error` except only applying
|
||||||
@ -598,7 +600,9 @@ class Cog(metaclass=CogMeta):
|
|||||||
|
|
||||||
@_cog_special_method
|
@_cog_special_method
|
||||||
async def cog_app_command_error(self, interaction: discord.Interaction, error: app_commands.AppCommandError) -> None:
|
async def cog_app_command_error(self, interaction: discord.Interaction, error: app_commands.AppCommandError) -> None:
|
||||||
"""A special method that is called whenever an error within
|
"""|coro|
|
||||||
|
|
||||||
|
A special method that is called whenever an error within
|
||||||
an application command is dispatched inside this cog.
|
an application command is dispatched inside this cog.
|
||||||
|
|
||||||
This is similar to :func:`discord.app_commands.CommandTree.on_error` except
|
This is similar to :func:`discord.app_commands.CommandTree.on_error` except
|
||||||
@ -617,7 +621,9 @@ class Cog(metaclass=CogMeta):
|
|||||||
|
|
||||||
@_cog_special_method
|
@_cog_special_method
|
||||||
async def cog_before_invoke(self, ctx: Context[BotT]) -> None:
|
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`.
|
This is similar to :meth:`.Command.before_invoke`.
|
||||||
|
|
||||||
@ -632,7 +638,9 @@ class Cog(metaclass=CogMeta):
|
|||||||
|
|
||||||
@_cog_special_method
|
@_cog_special_method
|
||||||
async def cog_after_invoke(self, ctx: Context[BotT]) -> None:
|
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`.
|
This is similar to :meth:`.Command.after_invoke`.
|
||||||
|
|
||||||
|
@ -1172,7 +1172,10 @@ class DefaultHelpCommand(HelpCommand):
|
|||||||
self.paginator.add_line(entry)
|
self.paginator.add_line(entry)
|
||||||
|
|
||||||
async def send_pages(self) -> None:
|
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()
|
destination = self.get_destination()
|
||||||
for page in self.paginator.pages:
|
for page in self.paginator.pages:
|
||||||
await destination.send(page)
|
await destination.send(page)
|
||||||
@ -1334,7 +1337,10 @@ class MinimalHelpCommand(HelpCommand):
|
|||||||
super().__init__(**options)
|
super().__init__(**options)
|
||||||
|
|
||||||
async def send_pages(self) -> None:
|
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()
|
destination = self.get_destination()
|
||||||
for page in self.paginator.pages:
|
for page in self.paginator.pages:
|
||||||
await destination.send(page)
|
await destination.send(page)
|
||||||
|
@ -508,7 +508,9 @@ class View:
|
|||||||
return self.timeout is None and all(item.is_persistent() for item in self._children)
|
return self.timeout is None and all(item.is_persistent() for item in self._children)
|
||||||
|
|
||||||
async def wait(self) -> bool:
|
async def wait(self) -> bool:
|
||||||
"""Waits until the view has finished interacting.
|
"""|coro|
|
||||||
|
|
||||||
|
Waits until the view has finished interacting.
|
||||||
|
|
||||||
A view is considered finished when :meth:`stop` is called
|
A view is considered finished when :meth:`stop` is called
|
||||||
or it times out.
|
or it times out.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user