From 7d345e8e4e66246c441a8c6154e398bf49ac0b3c Mon Sep 17 00:00:00 2001 From: Nadir Chowdhury Date: Sat, 13 Mar 2021 05:42:25 +0000 Subject: [PATCH] remove trailing whitespace --- discord/abc.py | 4 ++-- discord/calls.py | 6 +++--- discord/http.py | 4 ++-- discord/message.py | 4 ++-- discord/permissions.py | 10 +++++----- discord/template.py | 18 +++++++++--------- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/discord/abc.py b/discord/abc.py index a86a2a2d9..be011a649 100644 --- a/discord/abc.py +++ b/discord/abc.py @@ -1146,10 +1146,10 @@ class Connectable(metaclass=abc.ABCMeta): client = state._get_client() voice = cls(client, self) - + if not isinstance(voice, VoiceProtocol): raise TypeError('Type must meet VoiceProtocol abstract base class.') - + state._add_voice_client(key_id, voice) try: diff --git a/discord/calls.py b/discord/calls.py index 8cc4cdcb3..2006b30a8 100644 --- a/discord/calls.py +++ b/discord/calls.py @@ -56,7 +56,7 @@ class CallMessage: @property def call_ended(self): """:class:`bool`: Indicates if the call has ended. - + .. deprecated:: 1.7 """ return self.ended_timestamp is not None @@ -64,7 +64,7 @@ class CallMessage: @property def channel(self): r""":class:`GroupChannel`\: The private channel associated with this message. - + .. deprecated:: 1.7 """ return self.message.channel @@ -148,7 +148,7 @@ class GroupCall: @property def channel(self): r""":class:`GroupChannel`\: Returns the channel the group call is in. - + .. deprecated:: 1.7 """ return self.call.channel diff --git a/discord/http.py b/discord/http.py index f151188d6..43f01d759 100644 --- a/discord/http.py +++ b/discord/http.py @@ -680,8 +680,8 @@ class HTTPClient: return self.request(Route('PUT', '/guilds/{guild_id}/templates/{code}', guild_id=guild_id, code=code)) def edit_template(self, guild_id, code, payload): - valid_keys = ( - 'name', + valid_keys = ( + 'name', 'description', ) payload = { diff --git a/discord/message.py b/discord/message.py index d89e2a839..a34ba7119 100644 --- a/discord/message.py +++ b/discord/message.py @@ -415,7 +415,7 @@ class Message(Hashable): call: Optional[:class:`CallMessage`] The call that the message refers to. This is only applicable to messages of type :attr:`MessageType.call`. - + .. deprecated:: 1.7 reference: Optional[:class:`~discord.MessageReference`] @@ -923,7 +923,7 @@ class Message(Hashable): if self.type is MessageType.channel_follow_add: return '{0.author.name} has added {0.content} to this channel'.format(self) - + if self.type is MessageType.guild_stream: return '{0.author.name} is live! Now streaming {0.author.activity.name}'.format(self) diff --git a/discord/permissions.py b/discord/permissions.py index efab250ba..05b6d5110 100644 --- a/discord/permissions.py +++ b/discord/permissions.py @@ -159,7 +159,7 @@ class Permissions(BaseFlags): - :attr:`kick_members` - :attr:`ban_members` - :attr:`administrator` - + .. versionchanged:: 1.7 Added :attr:`stream`, :attr:`priority_speaker` and :attr:`use_slash_commands` permissions. """ @@ -169,7 +169,7 @@ class Permissions(BaseFlags): def general(cls): """A factory method that creates a :class:`Permissions` with all "General" permissions from the official Discord UI set to ``True``. - + .. versionchanged:: 1.7 Permission :attr:`read_messages` is now included in the general permissions, but permissions :attr:`administrator`, :attr:`create_instant_invite`, :attr:`kick_members`, @@ -182,7 +182,7 @@ class Permissions(BaseFlags): def membership(cls): """A factory method that creates a :class:`Permissions` with all "Membership" permissions from the official Discord UI set to ``True``. - + .. versionadded:: 1.7 """ return cls(0b00001100000000000000000000000111) @@ -191,7 +191,7 @@ class Permissions(BaseFlags): def text(cls): """A factory method that creates a :class:`Permissions` with all "Text" permissions from the official Discord UI set to ``True``. - + .. versionchanged:: 1.7 Permission :attr:`read_messages` is no longer part of the text permissions. Added :attr:`use_slash_commands` permission. @@ -208,7 +208,7 @@ class Permissions(BaseFlags): def advanced(cls): """A factory method that creates a :class:`Permissions` with all "Advanced" permissions from the official Discord UI set to ``True``. - + .. versionadded:: 1.7 """ return cls(1 << 3) diff --git a/discord/template.py b/discord/template.py index 20116cae0..2e9573464 100644 --- a/discord/template.py +++ b/discord/template.py @@ -106,7 +106,7 @@ class Template: def __init__(self, *, state, data): self._state = state self._store(data) - + def _store(self, data): self.code = data['code'] self.uses = data['usage_count'] @@ -173,10 +173,10 @@ class Template: data = await self._state.http.create_from_template(self.code, name, region_value, icon) return Guild(data=data, state=self._state) - + async def sync(self): """|coro| - + Sync the template to the guild's current state. You must have the :attr:`~Permissions.manage_guild` permission in the @@ -199,14 +199,14 @@ class Template: async def edit(self, **kwargs): """|coro| - + Edit the template metadata. - + You must have the :attr:`~Permissions.manage_guild` permission in the source guild to do this. .. versionadded:: 1.7 - + Parameters ------------ name: Optional[:class:`str`] @@ -225,12 +225,12 @@ class Template: """ data = await self._state.http.edit_template(self.source_guild.id, self.code, kwargs) self._store(data) - + async def delete(self): """|coro| - + Delete the template. - + You must have the :attr:`~Permissions.manage_guild` permission in the source guild to do this.