Change docstrings to raw-strings
This commit is contained in:
parent
5131acd675
commit
a4d1599ce9
@ -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.
|
||||
|
@ -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`.
|
||||
|
||||
|
@ -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):
|
||||
|
@ -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.
|
||||
|
||||
|
@ -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.
|
||||
|
||||
|
@ -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
|
||||
|
@ -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`.
|
||||
|
||||
|
@ -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`.
|
||||
|
||||
|
@ -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.
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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`.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user