diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5925c3bc8c..627c7717b1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -57,7 +57,7 @@ follows PEP-8 guidelines (mostly) with a column limit of 120. ## Use of "type: ignore" comments In some cases, it might be necessary to ignore type checker warnings for one reason or -another. If that is that case, it is **required** that a comment is left explaining why +another. If that is the case, it is **required** that a comment is left explaining why you are deciding to ignore type checking warnings. ### Licensing diff --git a/discord/appinfo.py b/discord/appinfo.py index e3a415ef98..943b6d7468 100644 --- a/discord/appinfo.py +++ b/discord/appinfo.py @@ -166,7 +166,7 @@ class AppInfo: tags: Optional[List[:class:`str`]] The list of tags describing the content and functionality of the app, if set. - Maximium of 5 tags. + Maximum of 5 tags. .. versionadded:: 2.7 diff --git a/discord/bot.py b/discord/bot.py index 6c3632d9eb..d50c5cf2ff 100644 --- a/discord/bot.py +++ b/discord/bot.py @@ -213,7 +213,7 @@ def get_application_command( name: :class:`str` The qualified name of the command to get. guild_ids: List[:class:`int`] - The guild ids associated to the command to get. + The guild ids associated with the command to get. type: Type[:class:`.ApplicationCommand`] The type of the command to get. Defaults to :class:`.ApplicationCommand`. @@ -710,8 +710,9 @@ async def sync_commands( commands in the most efficient way possible, unless ``force`` is set to ``True``, in which case it will always register all commands. - By default, this coroutine is called inside the :func:`.on_connect` event. If you choose to override the - :func:`.on_connect` event, then you should invoke this coroutine as well such as the following: + By default, this coroutine is called inside the :func:`.on_connect` event. If the + :func:`.on_connect` event is overridden, this coroutine must be invoked manually, + as shown in the following example: .. code-block:: python diff --git a/discord/commands/core.py b/discord/commands/core.py index f122117558..88cbbbb1c6 100644 --- a/discord/commands/core.py +++ b/discord/commands/core.py @@ -197,9 +197,7 @@ def __init__(self, func: Callable, **kwargs) -> None: elif isinstance(cooldown, CooldownMapping): buckets = cooldown else: - raise TypeError( - "Cooldown must be a an instance of CooldownMapping or None." - ) + raise TypeError("Cooldown must be an instance of CooldownMapping or None.") self._buckets: CooldownMapping = buckets @@ -717,7 +715,7 @@ class SlashCommand(ApplicationCommand): integration_types: Set[:class:`IntegrationType`] The type of installation this command should be available to. For instance, if set to :attr:`IntegrationType.user_install`, the command will only be available to users with - the application installed on their account. Unapplicable for guild commands. + the application installed on their account. Not applicable for guild commands. contexts: Set[:class:`InteractionContextType`] The location where this command can be used. Cannot be set if this is a guild command. """ @@ -1222,9 +1220,9 @@ class SlashCommandGroup(ApplicationCommand): integration_types: Set[:class:`IntegrationType`] The type of installation this command should be available to. For instance, if set to :attr:`IntegrationType.user_install`, the command will only be available to users with - the application installed on their account. Unapplicable for guild commands. + the application installed on their account. Not applicable for guild commands. contexts: Set[:class:`InteractionContextType`] - The location where this command can be used. Unapplicable for guild commands. + The location where this command can be used. Not applicable for guild commands. """ __initial_commands__: list[SlashCommand | SlashCommandGroup] @@ -1318,20 +1316,18 @@ def __init__( # similar to ApplicationCommand from ..ext.commands.cooldowns import BucketType, CooldownMapping, MaxConcurrency - # no need to getattr, since slash cmds groups cant be created using a decorator + # no need to getattr, since slash cmds groups can't be created using a decorator if cooldown is None: buckets = CooldownMapping(cooldown, BucketType.default) elif isinstance(cooldown, CooldownMapping): buckets = cooldown else: - raise TypeError( - "Cooldown must be a an instance of CooldownMapping or None." - ) + raise TypeError("Cooldown must be an instance of CooldownMapping or None.") self._buckets: CooldownMapping = buckets - # no need to getattr, since slash cmds groups cant be created using a decorator + # no need to getattr, since slash cmds groups can't be created using a decorator if max_concurrency is not None and not isinstance( max_concurrency, MaxConcurrency @@ -1654,9 +1650,9 @@ class ContextMenuCommand(ApplicationCommand): The name localizations for this command. The values of this should be ``"locale": "name"``. See `here `_ for a list of valid locales. integration_types: Set[:class:`IntegrationType`] - The installation contexts where this command is available. Unapplicable for guild commands. + The installation contexts where this command is available. Not applicable for guild commands. contexts: Set[:class:`InteractionContextType`] - The interaction contexts where this command is available. Unapplicable for guild commands. + The interaction contexts where this command is available. Not applicable for guild commands. """ def __new__(cls, *args, **kwargs) -> ContextMenuCommand: @@ -1794,9 +1790,9 @@ class UserCommand(ContextMenuCommand): The name localizations for this command. The values of this should be ``"locale": "name"``. See `here `_ for a list of valid locales. integration_types: Set[:class:`IntegrationType`] - The installation contexts where this command is available. Unapplicable for guild commands. + The installation contexts where this command is available. Not applicable for guild commands. contexts: Set[:class:`InteractionContextType`] - The interaction contexts where this command is available. Unapplicable for guild commands. + The interaction contexts where this command is available. Not applicable for guild commands. """ type = 2 @@ -1909,9 +1905,9 @@ class MessageCommand(ContextMenuCommand): The name localizations for this command. The values of this should be ``"locale": "name"``. See `here `_ for a list of valid locales. integration_types: Set[:class:`IntegrationType`] - The installation contexts where this command is available. Unapplicable for guild commands. + The installation contexts where this command is available. Not applicable for guild commands. contexts: Set[:class:`InteractionContextType`] - The interaction contexts where this command is available. Unapplicable for guild commands. + The interaction contexts where this command is available. Not applicable for guild commands. """ type = 3 diff --git a/discord/ext/bridge/core.py b/discord/ext/bridge/core.py index e61daa576f..2c574a0c1b 100644 --- a/discord/ext/bridge/core.py +++ b/discord/ext/bridge/core.py @@ -151,7 +151,7 @@ class BridgeExtGroup(BridgeExtCommand, Group): class BridgeCommand: - """Compatibility class between prefixed-based commands and slash commands. + """Compatibility class between prefix-based commands and slash commands. Parameters ---------- @@ -341,7 +341,7 @@ def after_invoke(self, coro): class BridgeCommandGroup(BridgeCommand): - """Compatibility class between prefixed-based commands and slash commands. + """Compatibility class between prefix-based commands and slash commands. Parameters ---------- @@ -527,7 +527,7 @@ def is_nsfw(): .. warning:: - In DMs, the prefixed-based command will always run as the user's privacy settings cannot be checked directly. + In DMs, the prefix-based command will always run as the user's privacy settings cannot be checked directly. """ def predicate(func: Callable | ApplicationCommand): diff --git a/discord/ext/commands/converter.py b/discord/ext/commands/converter.py index ca5a109f3f..75a8c4b9ce 100644 --- a/discord/ext/commands/converter.py +++ b/discord/ext/commands/converter.py @@ -614,7 +614,7 @@ async def convert(self, ctx: Context, argument: str) -> discord.ForumChannel: class ThreadConverter(IDConverter[discord.Thread]): - """Coverts to a :class:`~discord.Thread`. + """Converts to a :class:`~discord.Thread`. All lookups are via the local guild. diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index 4a58ecfca3..f64762aa27 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -378,9 +378,7 @@ def __init__( elif isinstance(cooldown, CooldownMapping): buckets = cooldown else: - raise TypeError( - "Cooldown must be a an instance of CooldownMapping or None." - ) + raise TypeError("Cooldown must be an instance of CooldownMapping or None.") self._buckets: CooldownMapping = buckets try: diff --git a/discord/ext/commands/flags.py b/discord/ext/commands/flags.py index ec218b891f..a5b8e20bf4 100644 --- a/discord/ext/commands/flags.py +++ b/discord/ext/commands/flags.py @@ -632,7 +632,7 @@ def parse_flags(cls, argument: str) -> dict[str, list[str]]: async def convert(cls: type[F], ctx: Context, argument: str) -> F: """|coro| - The method that actually converters an argument to the flag mapping. + The method that actually converts an argument to the flag mapping. Parameters ---------- diff --git a/discord/ext/pages/pagination.py b/discord/ext/pages/pagination.py index ab40be08ec..9575cadd2b 100644 --- a/discord/ext/pages/pagination.py +++ b/discord/ext/pages/pagination.py @@ -170,7 +170,7 @@ def __init__( async def callback(self, interaction: discord.Interaction | None = None): """|coro| - The coroutine associated to a specific page. If `Paginator.page_action()` is used, this coroutine is called. + The coroutine associated with a specific page. If `Paginator.page_action()` is used, this coroutine is called. Parameters ---------- diff --git a/discord/poll.py b/discord/poll.py index fcc94cc4b4..a6878275b6 100644 --- a/discord/poll.py +++ b/discord/poll.py @@ -146,7 +146,7 @@ def emoji(self) -> GuildEmoji | AppEmoji | PartialEmoji | None: @property def count(self) -> int | None: - """This answer's vote count, if recieved from Discord.""" + """This answer's vote count, if received from Discord.""" if not (self._poll and self.id): return None if self._poll.results is None: @@ -189,7 +189,7 @@ def voters( self, *, limit: int | None = None, after: Snowflake | None = None ) -> VoteIterator: """Returns an :class:`AsyncIterator` representing the users that have voted with this answer. - Only works if this poll was recieved from Discord. + Only works if this poll was received from Discord. The ``after`` parameter must represent a member and meet the :class:`abc.Snowflake` abc. @@ -216,7 +216,7 @@ def voters( HTTPException Getting the voters for the answer failed. RuntimeError - This poll wasn't recieved from a message. + This poll wasn't received from a message. Examples -------- @@ -336,7 +336,7 @@ class Poll: layout_type: :class:`PollLayoutType` The poll's layout type. Only one exists at the moment. results: Optional[:class:`PollResults`] - The results of this poll recieved from Discord. If ``None``, this should be considered "unknown" rather than "no" results. + The results of this poll received from Discord. If ``None``, this should be considered "unknown" rather than "no" results. """ def __init__( @@ -521,10 +521,10 @@ async def end(self) -> Message: HTTPException Ending this poll failed. RuntimeError - This poll wasn't recieved from a message. + This poll wasn't received from a message. """ if not self._message: - raise RuntimeError("You can only end a poll recieved from a message.") + raise RuntimeError("You can only end a poll received from a message.") return await self._message.end_poll() diff --git a/discord/raw_models.py b/discord/raw_models.py index 9a50795573..291a44fadc 100644 --- a/discord/raw_models.py +++ b/discord/raw_models.py @@ -473,7 +473,7 @@ class RawVoiceChannelStatusUpdateEvent(_RawReprMixin): guild_id: :class:`int` The guild ID where the voice channel status update originated from. status: Optional[:class:`str`] - The new new voice channel status. + The new voice channel status. data: :class:`dict` The raw data sent by the `gateway `__. """ diff --git a/discord/reaction.py b/discord/reaction.py index 8a2e000c8c..975122598b 100644 --- a/discord/reaction.py +++ b/discord/reaction.py @@ -120,7 +120,7 @@ def burst_colours(self) -> list[Colour]: There is an alias for this named :attr:`burst_colors`. """ - # We recieve a list of #FFFFFF, so omit the # and convert to base 16 + # We receive a list of #FFFFFF, so omit the # and convert to base 16 return [Colour(int(c[1:], 16)) for c in self._burst_colours] @property diff --git a/discord/role.py b/discord/role.py index 0508a87671..c37c2f5a4f 100644 --- a/discord/role.py +++ b/discord/role.py @@ -104,7 +104,7 @@ def _parse_tag_int(data: RoleTagPayload, key: str) -> int | None: """ if value := data.get(key): with suppress(ValueError): - # value error means it's not an number string (None or "") + # value error means it's not a number string (None or "") return int(value) # pyright: ignore[reportUnknownArgumentType] return None diff --git a/discord/ui/container.py b/discord/ui/container.py index 0ebd72a2b4..3a0dbe6797 100644 --- a/discord/ui/container.py +++ b/discord/ui/container.py @@ -234,7 +234,7 @@ def add_row( ---------- *items: Union[:class:`Button`, :class:`Select`] The items this action row contains. - id: Optiona[:class:`int`] + id: Optional[:class:`int`] The action row's ID. """ @@ -276,7 +276,7 @@ def add_text(self, content: str, id: int | None = None) -> Self: ---------- content: :class:`str` The content of the TextDisplay - id: Optiona[:class:`int`] + id: Optional[:class:`int`] The text displays' ID. """ @@ -297,7 +297,7 @@ def add_gallery( ---------- *items: :class:`MediaGalleryItem` The media this gallery contains. - id: Optiona[:class:`int`] + id: Optional[:class:`int`] The gallery's ID. """ @@ -314,7 +314,7 @@ def add_file(self, url: str, spoiler: bool = False, id: int | None = None) -> Se The URL of this file's media. This must be an ``attachment://`` URL that references a :class:`~discord.File`. spoiler: Optional[:class:`bool`] Whether the file has the spoiler overlay. Defaults to ``False``. - id: Optiona[:class:`int`] + id: Optional[:class:`int`] The file's ID. """ diff --git a/discord/ui/file.py b/discord/ui/file.py index bb00fa9adc..fd1109295d 100644 --- a/discord/ui/file.py +++ b/discord/ui/file.py @@ -93,7 +93,7 @@ def _generate_underlying( @property def file(self) -> UnfurledMediaItem: - """The file's unerlying media item.""" + """The file's underlying media item.""" return self.underlying.file @file.setter diff --git a/discord/ui/thumbnail.py b/discord/ui/thumbnail.py index 1a1af505df..ea72969703 100644 --- a/discord/ui/thumbnail.py +++ b/discord/ui/thumbnail.py @@ -103,7 +103,7 @@ def _generate_underlying( @property def media(self) -> UnfurledMediaItem: - """The thumbnail's unerlying media item.""" + """The thumbnail's underlying media item.""" return self.underlying.media @media.setter diff --git a/discord/voice/_types.py b/discord/voice/_types.py index 71015900f2..1426e1d6e8 100644 --- a/discord/voice/_types.py +++ b/discord/voice/_types.py @@ -97,7 +97,7 @@ async def on_voice_state_update(self, data: RawVoiceStateUpdateEvent) -> None: async def on_voice_server_update(self, data: RawVoiceServerUpdateEvent) -> None: """|coro| - A method called when the client's intially connecting to voice. This corresponds + A method called when the client is initially connecting to voice. This corresponds to the ``VOICE_SERVER_UPDATE`` event. Parameters @@ -117,11 +117,11 @@ async def connect(self, *, timeout: float, reconnect: bool) -> None: A method called to initialise the connection. The library initialises this class and calls ``__init__``, and then :meth:`connect` when attempting - to start a connection to the voice. If an error ocurrs, it calls :meth:`disconnect`, so if you need + to start a connection to the voice. If an error occurs, it calls :meth:`disconnect`, so if you need to implement any cleanup, you should manually call it in :meth:`disconnect` as the library will not do so for you. - Within this method, to start the voice connection flow, it is recommened to use :meth:`Guild.change_voice_state` + Within this method, to start the voice connection flow, it is recommended to use :meth:`Guild.change_voice_state` to start the flow. After which :meth:`on_voice_server_update` and :meth:`on_voice_state_update` will be called, although this could vary and cause unexpected behaviour, but that falls under Discord's way of handling the voice connection. @@ -140,7 +140,7 @@ async def disconnect(self, *, force: bool) -> None: A method called to terminate the voice connection. - This can be either called manually when forcing a disconnection, or when an exception in :meth:`connect` ocurrs. + This can be either called manually when forcing a disconnection, or when an exception in :meth:`connect` occurs. It is recommended to call :meth:`cleanup` here. diff --git a/discord/voice/client.py b/discord/voice/client.py index cea26eb1ad..01f59fbf32 100644 --- a/discord/voice/client.py +++ b/discord/voice/client.py @@ -99,7 +99,7 @@ class VoiceClient(VoiceProtocol): In order to use PCM based AudioSources, you must have the opus library installed on your system and loaded through :func:`opus.load_opus`. Otherwise, your AudioSources must be opus encoded (e.g. using :class:`FFmpegOpusAudio`) - or the library will not be able ot transmit audio. + or the library will not be able to transmit audio. """ def __init__( @@ -342,9 +342,9 @@ def wait_until_connected(self, timeout: float | None = 30.0) -> bool: @property def latency(self) -> float: - """Latency between a HEARTBEAT and a HEARBEAT_ACK in seconds. + """Latency between a HEARTBEAT and a HEARTBEAT_ACK in seconds. - This chould be referred to as the Discord Voice WebSocket latency and is + This should be referred to as the Discord Voice WebSocket latency and is and analogue of user's voice latencies as seen in the Discord client. .. versionadded:: 1.4 @@ -354,7 +354,7 @@ def latency(self) -> float: @property def average_latency(self) -> float: - """Average of most recent 20 HEARBEAT latencies in seconds. + """Average of most recent 20 HEARTBEAT latencies in seconds. .. versionadded:: 1.4 """ @@ -708,7 +708,7 @@ def start_recording( sink: :class:`~.Sink` A Sink in which all audio packets will be processed in. callback: Callable[[:class:`Exception` | None], Any] - A function which is called after the bot has stopped recording. This must take exactly one positonal(-only) + A function which is called after the bot has stopped recording. This must take exactly one positional(-only) parameter, ``exception``, which is the exception that was raised during the recording of the Sink. .. versionchanged:: 2.7 diff --git a/discord/voice/gateway.py b/discord/voice/gateway.py index d277917d2f..7b2aa3a17d 100644 --- a/discord/voice/gateway.py +++ b/discord/voice/gateway.py @@ -312,7 +312,7 @@ async def received_binary_message(self, msg: bytes) -> None: _log.debug("Processed MLS commit for transition %s", transt_id) except Exception as exc: _log.debug( - "An exception ocurred while processing a MLS commit, this should be safe to ignore: %s", + "An exception occurred while processing a MLS commit, this should be safe to ignore: %s", exc, ) await state.recover_dave_from_invalid_commit(transt_id) @@ -333,7 +333,7 @@ async def received_binary_message(self, msg: bytes) -> None: _log.debug("Processed MLS welcome for transition %s", transt_id) except Exception as exc: _log.debug( - "An exception ocurred while processing a MLS welcome, this should be safe to ignore: %s", + "An exception occurred while processing a MLS welcome, this should be safe to ignore: %s", exc, ) await state.recover_dave_from_invalid_commit(transt_id) diff --git a/discord/voice/receive/reader.py b/discord/voice/receive/reader.py index 7ec0300c66..bf3b88f6c6 100644 --- a/discord/voice/receive/reader.py +++ b/discord/voice/receive/reader.py @@ -135,13 +135,13 @@ def _stop(self) -> None: self.packet_router.stop() except Exception as exc: self.error = exc - _log.exception("An error ocurred while stopping packet router.") + _log.exception("An error occurred while stopping packet router.") try: self.event_router.stop() except Exception as exc: self.error = exc - _log.exception("An error ocurred while stopping event router.") + _log.exception("An error occurred while stopping event router.") self.speaking_timer.stop() self.keep_alive.stop() @@ -151,7 +151,7 @@ def _stop(self) -> None: self.after(self.error) except Exception: _log.exception( - "An error ocurred while calling the after callback on audio reader" + "An error occurred while calling the after callback on audio reader" ) """for sink in self.sink.root.walk_children(with_self=True): @@ -196,7 +196,7 @@ def callback(self, packet_data: bytes) -> None: _log.debug("Received an IP Discovery Packet, ignoring...") return _log.exception( - "An exception ocurred while decoding voice packets", exc_info=exc + "An exception occurred while decoding voice packets", exc_info=exc ) finally: if self.error: @@ -237,7 +237,7 @@ def callback(self, packet_data: bytes) -> None: self.packet_router.feed_rtp(rtp_packet) # type: ignore except Exception as exc: _log.exception( - "An error ocurred while processing RTP packet %s", rtp_packet + "An error occurred while processing RTP packet %s", rtp_packet ) self.error = exc self.stop() @@ -323,7 +323,7 @@ def decrypt_rtcp(self, packet: bytes) -> bytes: offset = 0 while offset < len(data): - # offset will allow us to read the compund packets + # offset will allow us to read the compound packets current_data = data[offset:] if len(current_data) < 8: break diff --git a/discord/voice/state.py b/discord/voice/state.py index 8bb8af1478..e6d622df56 100644 --- a/discord/voice/state.py +++ b/discord/voice/state.py @@ -141,7 +141,7 @@ def run(self) -> None: self._do_run() except Exception: _log.exception( - "An error ocurred while running the socket reader %s", + "An error occurred while running the socket reader %s", self.name, ) finally: diff --git a/docs/api/audit_logs.rst b/docs/api/audit_logs.rst index af90f95c18..02c585467c 100644 --- a/docs/api/audit_logs.rst +++ b/docs/api/audit_logs.rst @@ -69,7 +69,7 @@ this goal, it must make use of a couple of data classes that aid in this goal. map to certain attributes being set. Note that accessing an attribute that does not match the specified action - will lead to an attribute error. + will lead to an :exc:`AttributeError`. To get a list of attributes that have been set, you can iterate over them. To see a list of all possible attributes that could be set based diff --git a/docs/api/events.rst b/docs/api/events.rst index 9242f8ff5d..48a4542e61 100644 --- a/docs/api/events.rst +++ b/docs/api/events.rst @@ -64,7 +64,7 @@ Application Commands .. versionadded:: 2.0 - :param context: The ApplicationContext associated to the command being received. + :param context: The ApplicationContext associated with the command being received. :type context: :class:`ApplicationContext` .. function:: on_application_command_completion(context) @@ -73,7 +73,7 @@ Application Commands .. versionadded:: 2.0 - :param context: The ApplicationContext associated to the command that was completed. + :param context: The ApplicationContext associated with the command that was completed. :type context: :class:`ApplicationContext` .. function:: on_application_command_error(context, exception) @@ -82,10 +82,10 @@ Application Commands .. versionadded:: 2.0 - :param context: The ApplicationContext associated to the command that has an error. + :param context: The ApplicationContext associated with the command that has an error. :type context: :class:`ApplicationContext` - :param exception: The DiscordException associated to the error. + :param exception: The DiscordException associated with the error. :type exception: :class:`DiscordException` .. function:: on_unknown_application_command(interaction) @@ -94,7 +94,7 @@ Application Commands .. versionadded:: 2.0 - :param interaction: The interaction associated to the unknown command. + :param interaction: The interaction associated with the unknown command. :type interaction: :class:`Interaction` Audit Logs @@ -937,7 +937,7 @@ Reactions .. note:: - To get the :class:`Message` being reacted, access it via :attr:`Reaction.message`. + To retrieve the :class:`Message` that received the reaction, access :attr:`Reaction.message`. This requires :attr:`Intents.reactions` to be enabled. @@ -966,13 +966,13 @@ Reactions .. function:: on_reaction_remove(reaction, user) - Called when a message has a reaction removed from it. Similar to on_message_edit, + Called when a message has a reaction removed from it. Similar to :func:`on_message_edit`, if the message is not found in the internal message cache, then this event will not be called. .. note:: - To get the message being reacted, access it via :attr:`Reaction.message`. + To retrieve the :class:`Message` that received the reaction, access :attr:`Reaction.message`. This requires both :attr:`Intents.reactions` and :attr:`Intents.members` to be enabled. @@ -1173,7 +1173,7 @@ Scheduled Events .. function:: on_scheduled_event_user_remove(event, member) - Called when a user unsubscribes to an event. If the member or event is + Called when a user unsubscribes from an event. If the member or event is not found in the internal cache, then this event will not be called. Consider using :func:`on_raw_scheduled_event_user_remove` instead. @@ -1186,7 +1186,7 @@ Scheduled Events .. function:: on_raw_scheduled_event_user_remove(payload) - Called when a user unsubscribes to an event. Unlike + Called when a user unsubscribes from an event. Unlike :meth:`on_scheduled_event_user_remove`, this will be called regardless of the state of the internal cache. @@ -1408,7 +1408,7 @@ Voice Channel Status Update .. function:: on_raw_voice_channel_status_update(payload) - Called when someone updates a voice channels status. + Called when someone updates a voice channel status. .. versionadded:: 2.5 diff --git a/docs/ext/commands/commands.rst b/docs/ext/commands/commands.rst index ed2046fe10..9f9e120a89 100644 --- a/docs/ext/commands/commands.rst +++ b/docs/ext/commands/commands.rst @@ -840,7 +840,7 @@ decorator. For example: """A bad example of an eval command""" await ctx.send(eval(code)) -This would only evaluate the command if the function ``is_owner`` returns ``True``. Sometimes we re-use a check often and +This would only evaluate the command if the function ``is_owner`` returns ``True``. Sometimes we reuse a check often and want to split it into its own decorator. To do that we can just add another level of depth: .. code-block:: python3 diff --git a/docs/migrating_to_v1.rst b/docs/migrating_to_v1.rst index dc61aa10c7..889b3e5699 100644 --- a/docs/migrating_to_v1.rst +++ b/docs/migrating_to_v1.rst @@ -383,7 +383,7 @@ They will be enumerated here. - :attr:`Member.avatar_url` and :attr:`User.avatar_url` now return the default avatar if a custom one is not set. - :attr:`Message.embeds` is now a list of :class:`Embed` instead of :class:`dict` objects. -- :attr:`Message.attachments` is now a list of :class:`Attachment` instead of :class:`dict` object. +- :attr:`Message.attachments` is now a list of :class:`Attachment` instead of :class:`dict` objects. - :attr:`Guild.roles` is now sorted through hierarchy. The first element is always the ``@everyone`` role. **Added** @@ -981,7 +981,7 @@ Certain subclasses can implement more customisable methods. The old ``HelpFormatter`` was replaced with :class:`~.commands.DefaultHelpCommand`\, which implements all of the logic of the old help command. The customisable methods can be found in the accompanying documentation. -The library now provides a new more minimalistic :class:`~.commands.HelpCommand` implementation that doesn't take as much space, :class:`~.commands.MinimalHelpCommand`. The customisable methods can also be found in the accompanying documentation. +The library now provides a newer, more minimalistic :class:`~.commands.HelpCommand` implementation that doesn't take as much space, :class:`~.commands.MinimalHelpCommand`. The customisable methods can also be found in the accompanying documentation. A frequent request was if you could associate a help command with a cog. The new design allows for dynamically changing of cog through binding it to the :attr:`.HelpCommand.cog` attribute. After this assignment the help command will pretend to be part of the cog and everything should work as expected. When the cog is unloaded then the help command will be "unbound" from the cog. @@ -1089,8 +1089,8 @@ Basically: :: # do something after a command is called pass -The after invocation is hook always called, **regardless of an error in the command**. This makes it ideal for some error -handling or clean up of certain resources such a database connection. +The "after" invocation hook is always called, **regardless of an error in the command**. This makes it ideal for some error +handling or clean up of certain resources, such as a database connection. The per-command registration is as follows: :: diff --git a/examples/soundboard.py b/examples/soundboard.py index d19faa666d..edda65cf5f 100644 --- a/examples/soundboard.py +++ b/examples/soundboard.py @@ -84,7 +84,7 @@ async def add_sound( name=name, sound=sound_bytes, volume=1.0, emoji=emoji ) - await ctx.respons(f"Added new sound: {new_sound.emoji} {new_sound.name}") + await ctx.respond(f"Added new sound: {new_sound.emoji} {new_sound.name}") except Exception as e: await ctx.respond(f"Failed to add sound: {str(e)}")