Browse Source

Change docstrings to raw-strings

pull/1583/merge
BeatButton 7 years ago
committed by Rapptz
parent
commit
a4d1599ce9
  1. 2
      discord/abc.py
  2. 2
      discord/audit_logs.py
  3. 4
      discord/calls.py
  4. 4
      discord/channel.py
  5. 8
      discord/ext/commands/bot.py
  6. 6
      discord/ext/commands/context.py
  7. 6
      discord/ext/commands/core.py
  8. 2
      discord/ext/commands/errors.py
  9. 4
      discord/member.py
  10. 4
      discord/message.py
  11. 6
      discord/permissions.py
  12. 2
      discord/shard.py
  13. 6
      discord/user.py
  14. 2
      discord/utils.py

2
discord/abc.py

@ -489,7 +489,7 @@ class GuildChannel:
await self._state.http.delete_channel(self.id, reason=reason) await self._state.http.delete_channel(self.id, reason=reason)
async def set_permissions(self, target, *, overwrite=_undefined, reason=None, **permissions): 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 Sets the channel specific permission overwrites for a target in the
channel. channel.

2
discord/audit_logs.py

@ -178,7 +178,7 @@ class AuditLogChanges:
setattr(second, 'roles', data) setattr(second, 'roles', data)
class AuditLogEntry: class AuditLogEntry:
"""Represents an Audit Log entry. r"""Represents an Audit Log entry.
You retrieve these via :meth:`Guild.audit_logs`. You retrieve these via :meth:`Guild.audit_logs`.

4
discord/calls.py

@ -58,7 +58,7 @@ class CallMessage:
@property @property
def channel(self): 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 return self.message.channel
@property @property
@ -132,7 +132,7 @@ class GroupCall:
@property @property
def channel(self): 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 return self.call.channel
def voice_state_for(self, user): def voice_state_for(self, user):

4
discord/channel.py

@ -808,7 +808,7 @@ class GroupChannel(discord.abc.Messageable, Hashable):
return base return base
async def add_recipients(self, *recipients): async def add_recipients(self, *recipients):
"""|coro| r"""|coro|
Adds recipients to this group. Adds recipients to this group.
@ -835,7 +835,7 @@ class GroupChannel(discord.abc.Messageable, Hashable):
await req(self.id, recipient.id) await req(self.id, recipient.id)
async def remove_recipients(self, *recipients): async def remove_recipients(self, *recipients):
"""|coro| r"""|coro|
Removes recipients from this group. Removes recipients from this group.

8
discord/ext/commands/bot.py

@ -234,7 +234,7 @@ class BotBase(GroupMixin):
# global check registration # global check registration
def check(self, func): 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 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 on a per command basis except it is run before any command checks
@ -302,7 +302,7 @@ class BotBase(GroupMixin):
pass pass
def check_once(self, func): 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 Unlike regular global checks, this one is called only once
per :meth:`.Command.invoke` call. per :meth:`.Command.invoke` call.
@ -393,7 +393,7 @@ class BotBase(GroupMixin):
return coro return coro
def after_invoke(self, 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 A post-invoke hook is called directly after the command is
called. This makes it a useful function to clean-up database called. This makes it a useful function to clean-up database
@ -810,7 +810,7 @@ class BotBase(GroupMixin):
return ret return ret
async def get_context(self, message, *, cls=Context): async def get_context(self, message, *, cls=Context):
"""|coro| r"""|coro|
Returns the invocation context from the message. Returns the invocation context from the message.

6
discord/ext/commands/context.py

@ -28,7 +28,7 @@ import discord.abc
import discord.utils import discord.utils
class Context(discord.abc.Messageable): 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 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 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 self._state = self.message._state
async def invoke(self, *args, **kwargs): async def invoke(self, *args, **kwargs):
"""|coro| r"""|coro|
Calls a command with the arguments given. Calls a command with the arguments given.
@ -219,6 +219,6 @@ class Context(discord.abc.Messageable):
@property @property
def voice_client(self): 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 g = self.guild
return g.voice_client if g else None return g.voice_client if g else None

6
discord/ext/commands/core.py

@ -102,7 +102,7 @@ class _CaseInsensitiveDict(dict):
super().__setitem__(k.lower(), v) super().__setitem__(k.lower(), v)
class Command: 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 These are not created manually, instead they are created via the
decorator or functional interface. decorator or functional interface.
@ -1078,7 +1078,7 @@ def group(name=None, **attrs):
return command(name=name, cls=Group, **attrs) return command(name=name, cls=Group, **attrs)
def check(predicate): 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`. subclasses. These checks could be accessed via :attr:`.Command.checks`.
These checks should be predicates that take in a single parameter taking These checks should be predicates that take in a single parameter taking
@ -1169,7 +1169,7 @@ def has_role(name):
return check(predicate) return check(predicate)
def has_any_role(*names): 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 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`. one out of the three roles specified, then this check will return `True`.

2
discord/ext/commands/errors.py

@ -35,7 +35,7 @@ __all__ = ['CommandError', 'MissingRequiredArgument', 'BadArgument',
'BadUnionArgument'] 'BadUnionArgument']
class CommandError(DiscordException): 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`. This inherits from :exc:`discord.DiscordException`.

4
discord/member.py

@ -467,7 +467,7 @@ class Member(discord.abc.Messageable, _BaseUser):
await self.edit(voice_channel=channel, reason=reason) await self.edit(voice_channel=channel, reason=reason)
async def add_roles(self, *roles, reason=None, atomic=True): async def add_roles(self, *roles, reason=None, atomic=True):
"""|coro| r"""|coro|
Gives the member a number of :class:`Role`\s. 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) await req(guild_id, user_id, role.id, reason=reason)
async def remove_roles(self, *roles, reason=None, atomic=True): async def remove_roles(self, *roles, reason=None, atomic=True):
"""|coro| r"""|coro|
Removes :class:`Role`\s from this member. Removes :class:`Role`\s from this member.

4
discord/message.py

@ -110,7 +110,7 @@ class Attachment:
return written return written
class Message: class Message:
"""Represents a message from Discord. r"""Represents a message from Discord.
There should be no need to create one of these manually. There should be no need to create one of these manually.
@ -441,7 +441,7 @@ class Message:
@utils.cached_slot_property('_cs_system_content') @utils.cached_slot_property('_cs_system_content')
def system_content(self): 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`. regardless of the :attr:`Message.type`.
In the case of :attr:`MessageType.default`\, this just returns the In the case of :attr:`MessageType.default`\, this just returns the

6
discord/permissions.py

@ -169,7 +169,7 @@ class Permissions:
return cls(0b00000011111100000000000100000000) return cls(0b00000011111100000000000100000000)
def update(self, **kwargs): def update(self, **kwargs):
"""Bulk updates this permission object. r"""Bulk updates this permission object.
Allows you to set multiple attributes by using keyword Allows you to set multiple attributes by using keyword
arguments. The names must be equivalent to the properties arguments. The names must be equivalent to the properties
@ -510,7 +510,7 @@ def augment_from_permissions(cls):
@augment_from_permissions @augment_from_permissions
class PermissionOverwrite: 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 Unlike a regular :class:`Permissions`\, the default value of a
permission is equivalent to ``None`` and not ``False``. Setting 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()) return all(x is None for x in self._values.values())
def update(self, **kwargs): 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 Allows you to set multiple attributes by using keyword
arguments. The names must be equivalent to the properties arguments. The names must be equivalent to the properties

2
discord/shard.py

@ -176,7 +176,7 @@ class AutoShardedClient(Client):
return [(shard_id, shard.ws.latency) for shard_id, shard in self.shards.items()] return [(shard_id, shard.ws.latency) for shard_id, shard in self.shards.items()]
async def request_offline_members(self, *guilds): async def request_offline_members(self, *guilds):
"""|coro| r"""|coro|
Requests previously offline members from the guild to be filled up Requests previously offline members from the guild to be filled up
into the :attr:`Guild.members` cache. This function is usually not into the :attr:`Guild.members` cache. This function is usually not

6
discord/user.py

@ -305,12 +305,12 @@ class ClientUser(BaseUser):
@property @property
def friends(self): 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] return [r.user for r in self._relationships.values() if r.type is RelationshipType.friend]
@property @property
def blocked(self): 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] return [r.user for r in self._relationships.values() if r.type is RelationshipType.blocked]
async def edit(self, **fields): async def edit(self, **fields):
@ -414,7 +414,7 @@ class ClientUser(BaseUser):
self.__init__(state=self._state, data=data) self.__init__(state=self._state, data=data)
async def create_group(self, *recipients): async def create_group(self, *recipients):
"""|coro| r"""|coro|
Creates a group direct message with the recipients Creates a group direct message with the recipients
provided. These recipients must be have a relationship provided. These recipients must be have a relationship

2
discord/utils.py

@ -171,7 +171,7 @@ def find(predicate, seq):
return None return None
def get(iterable, **attrs): 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 all the traits passed in ``attrs``. This is an alternative for
:func:`discord.utils.find`. :func:`discord.utils.find`.

Loading…
Cancel
Save