diff --git a/discord/abc.py b/discord/abc.py index d4aa49566..365fcebfc 100644 --- a/discord/abc.py +++ b/discord/abc.py @@ -489,7 +489,7 @@ class GuildChannel: await self._state.http.delete_channel(self.id, reason=reason) async def set_permissions(self, target, *, overwrite=_undefined, reason=None, **permissions): - """|coro| + r"""|coro| Sets the channel specific permission overwrites for a target in the channel. diff --git a/discord/audit_logs.py b/discord/audit_logs.py index 1e7feed4e..06e7b1a3c 100644 --- a/discord/audit_logs.py +++ b/discord/audit_logs.py @@ -178,7 +178,7 @@ class AuditLogChanges: setattr(second, 'roles', data) class AuditLogEntry: - """Represents an Audit Log entry. + r"""Represents an Audit Log entry. You retrieve these via :meth:`Guild.audit_logs`. diff --git a/discord/calls.py b/discord/calls.py index 1c35d5ef6..9231be9eb 100644 --- a/discord/calls.py +++ b/discord/calls.py @@ -58,7 +58,7 @@ class CallMessage: @property def channel(self): - """:class:`GroupChannel`\: The private channel associated with this message.""" + r""":class:`GroupChannel`\: The private channel associated with this message.""" return self.message.channel @property @@ -132,7 +132,7 @@ class GroupCall: @property def channel(self): - """:class:`GroupChannel`\: Returns the channel the group call is in.""" + r""":class:`GroupChannel`\: Returns the channel the group call is in.""" return self.call.channel def voice_state_for(self, user): diff --git a/discord/channel.py b/discord/channel.py index f737b9875..eb157ad91 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -808,7 +808,7 @@ class GroupChannel(discord.abc.Messageable, Hashable): return base async def add_recipients(self, *recipients): - """|coro| + r"""|coro| Adds recipients to this group. @@ -835,7 +835,7 @@ class GroupChannel(discord.abc.Messageable, Hashable): await req(self.id, recipient.id) async def remove_recipients(self, *recipients): - """|coro| + r"""|coro| Removes recipients from this group. diff --git a/discord/ext/commands/bot.py b/discord/ext/commands/bot.py index e7257bbd4..b90f5dce9 100644 --- a/discord/ext/commands/bot.py +++ b/discord/ext/commands/bot.py @@ -234,7 +234,7 @@ class BotBase(GroupMixin): # global check registration def check(self, func): - """A decorator that adds a global check to the bot. + r"""A decorator that adds a global check to the bot. A global check is similar to a :func:`.check` that is applied on a per command basis except it is run before any command checks @@ -302,7 +302,7 @@ class BotBase(GroupMixin): pass def check_once(self, func): - """A decorator that adds a "call once" global check to the bot. + r"""A decorator that adds a "call once" global check to the bot. Unlike regular global checks, this one is called only once per :meth:`.Command.invoke` call. @@ -393,7 +393,7 @@ class BotBase(GroupMixin): return coro def after_invoke(self, coro): - """A decorator that registers a coroutine as a post-invoke hook. + r"""A decorator that registers a coroutine as a post-invoke hook. A post-invoke hook is called directly after the command is called. This makes it a useful function to clean-up database @@ -810,7 +810,7 @@ class BotBase(GroupMixin): return ret async def get_context(self, message, *, cls=Context): - """|coro| + r"""|coro| Returns the invocation context from the message. diff --git a/discord/ext/commands/context.py b/discord/ext/commands/context.py index 4beaa7d6b..73679e52f 100644 --- a/discord/ext/commands/context.py +++ b/discord/ext/commands/context.py @@ -28,7 +28,7 @@ import discord.abc import discord.utils class Context(discord.abc.Messageable): - """Represents the context in which a command is being invoked under. + r"""Represents the context in which a command is being invoked under. This class contains a lot of meta data to help you understand more about the invocation context. This class is not created manually and is instead @@ -87,7 +87,7 @@ class Context(discord.abc.Messageable): self._state = self.message._state async def invoke(self, *args, **kwargs): - """|coro| + r"""|coro| Calls a command with the arguments given. @@ -219,6 +219,6 @@ class Context(discord.abc.Messageable): @property def voice_client(self): - """Optional[:class:`VoiceClient`]: A shortcut to :attr:`Guild.voice_client`\, if applicable.""" + r"""Optional[:class:`VoiceClient`]: A shortcut to :attr:`Guild.voice_client`\, if applicable.""" g = self.guild return g.voice_client if g else None diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index 6d3644ce1..5ea2700d3 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -102,7 +102,7 @@ class _CaseInsensitiveDict(dict): super().__setitem__(k.lower(), v) class Command: - """A class that implements the protocol for a bot text command. + r"""A class that implements the protocol for a bot text command. These are not created manually, instead they are created via the decorator or functional interface. @@ -1078,7 +1078,7 @@ def group(name=None, **attrs): return command(name=name, cls=Group, **attrs) def check(predicate): - """A decorator that adds a check to the :class:`.Command` or its + r"""A decorator that adds a check to the :class:`.Command` or its subclasses. These checks could be accessed via :attr:`.Command.checks`. These checks should be predicates that take in a single parameter taking @@ -1169,7 +1169,7 @@ def has_role(name): return check(predicate) def has_any_role(*names): - """A :func:`.check` that is added that checks if the member invoking the + r"""A :func:`.check` that is added that checks if the member invoking the command has **any** of the roles specified. This means that if they have one out of the three roles specified, then this check will return `True`. diff --git a/discord/ext/commands/errors.py b/discord/ext/commands/errors.py index 195ca38d5..fea81b4aa 100644 --- a/discord/ext/commands/errors.py +++ b/discord/ext/commands/errors.py @@ -35,7 +35,7 @@ __all__ = ['CommandError', 'MissingRequiredArgument', 'BadArgument', 'BadUnionArgument'] class CommandError(DiscordException): - """The base exception type for all command related errors. + r"""The base exception type for all command related errors. This inherits from :exc:`discord.DiscordException`. diff --git a/discord/member.py b/discord/member.py index 19b6038a3..bf461d880 100644 --- a/discord/member.py +++ b/discord/member.py @@ -467,7 +467,7 @@ class Member(discord.abc.Messageable, _BaseUser): await self.edit(voice_channel=channel, reason=reason) async def add_roles(self, *roles, reason=None, atomic=True): - """|coro| + r"""|coro| Gives the member a number of :class:`Role`\s. @@ -505,7 +505,7 @@ class Member(discord.abc.Messageable, _BaseUser): await req(guild_id, user_id, role.id, reason=reason) async def remove_roles(self, *roles, reason=None, atomic=True): - """|coro| + r"""|coro| Removes :class:`Role`\s from this member. diff --git a/discord/message.py b/discord/message.py index c704d9d08..e55b47b44 100644 --- a/discord/message.py +++ b/discord/message.py @@ -110,7 +110,7 @@ class Attachment: return written class Message: - """Represents a message from Discord. + r"""Represents a message from Discord. There should be no need to create one of these manually. @@ -441,7 +441,7 @@ class Message: @utils.cached_slot_property('_cs_system_content') def system_content(self): - """A property that returns the content that is rendered + r"""A property that returns the content that is rendered regardless of the :attr:`Message.type`. In the case of :attr:`MessageType.default`\, this just returns the diff --git a/discord/permissions.py b/discord/permissions.py index 518a31c76..cb546668f 100644 --- a/discord/permissions.py +++ b/discord/permissions.py @@ -169,7 +169,7 @@ class Permissions: return cls(0b00000011111100000000000100000000) def update(self, **kwargs): - """Bulk updates this permission object. + r"""Bulk updates this permission object. Allows you to set multiple attributes by using keyword arguments. The names must be equivalent to the properties @@ -510,7 +510,7 @@ def augment_from_permissions(cls): @augment_from_permissions class PermissionOverwrite: - """A type that is used to represent a channel specific permission. + r"""A type that is used to represent a channel specific permission. Unlike a regular :class:`Permissions`\, the default value of a permission is equivalent to ``None`` and not ``False``. Setting @@ -595,7 +595,7 @@ class PermissionOverwrite: return all(x is None for x in self._values.values()) def update(self, **kwargs): - """Bulk updates this permission overwrite object. + r"""Bulk updates this permission overwrite object. Allows you to set multiple attributes by using keyword arguments. The names must be equivalent to the properties diff --git a/discord/shard.py b/discord/shard.py index f5b5ae103..55600e560 100644 --- a/discord/shard.py +++ b/discord/shard.py @@ -176,7 +176,7 @@ class AutoShardedClient(Client): return [(shard_id, shard.ws.latency) for shard_id, shard in self.shards.items()] async def request_offline_members(self, *guilds): - """|coro| + r"""|coro| Requests previously offline members from the guild to be filled up into the :attr:`Guild.members` cache. This function is usually not diff --git a/discord/user.py b/discord/user.py index fa4c07191..3fa5090d9 100644 --- a/discord/user.py +++ b/discord/user.py @@ -305,12 +305,12 @@ class ClientUser(BaseUser): @property def friends(self): - """Returns a :class:`list` of :class:`User`\s that the user is friends with.""" + r"""Returns a :class:`list` of :class:`User`\s that the user is friends with.""" return [r.user for r in self._relationships.values() if r.type is RelationshipType.friend] @property def blocked(self): - """Returns a :class:`list` of :class:`User`\s that the user has blocked.""" + r"""Returns a :class:`list` of :class:`User`\s that the user has blocked.""" return [r.user for r in self._relationships.values() if r.type is RelationshipType.blocked] async def edit(self, **fields): @@ -414,7 +414,7 @@ class ClientUser(BaseUser): self.__init__(state=self._state, data=data) async def create_group(self, *recipients): - """|coro| + r"""|coro| Creates a group direct message with the recipients provided. These recipients must be have a relationship diff --git a/discord/utils.py b/discord/utils.py index b4a79d677..6bdfc36e4 100644 --- a/discord/utils.py +++ b/discord/utils.py @@ -171,7 +171,7 @@ def find(predicate, seq): return None def get(iterable, **attrs): - """A helper that returns the first element in the iterable that meets + r"""A helper that returns the first element in the iterable that meets all the traits passed in ``attrs``. This is an alternative for :func:`discord.utils.find`.