remove trailing whitespace
This commit is contained in:
parent
a3f700c11f
commit
7d345e8e4e
@ -1146,10 +1146,10 @@ class Connectable(metaclass=abc.ABCMeta):
|
|||||||
|
|
||||||
client = state._get_client()
|
client = state._get_client()
|
||||||
voice = cls(client, self)
|
voice = cls(client, self)
|
||||||
|
|
||||||
if not isinstance(voice, VoiceProtocol):
|
if not isinstance(voice, VoiceProtocol):
|
||||||
raise TypeError('Type must meet VoiceProtocol abstract base class.')
|
raise TypeError('Type must meet VoiceProtocol abstract base class.')
|
||||||
|
|
||||||
state._add_voice_client(key_id, voice)
|
state._add_voice_client(key_id, voice)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -56,7 +56,7 @@ class CallMessage:
|
|||||||
@property
|
@property
|
||||||
def call_ended(self):
|
def call_ended(self):
|
||||||
""":class:`bool`: Indicates if the call has ended.
|
""":class:`bool`: Indicates if the call has ended.
|
||||||
|
|
||||||
.. deprecated:: 1.7
|
.. deprecated:: 1.7
|
||||||
"""
|
"""
|
||||||
return self.ended_timestamp is not None
|
return self.ended_timestamp is not None
|
||||||
@ -64,7 +64,7 @@ class CallMessage:
|
|||||||
@property
|
@property
|
||||||
def channel(self):
|
def channel(self):
|
||||||
r""":class:`GroupChannel`\: The private channel associated with this message.
|
r""":class:`GroupChannel`\: The private channel associated with this message.
|
||||||
|
|
||||||
.. deprecated:: 1.7
|
.. deprecated:: 1.7
|
||||||
"""
|
"""
|
||||||
return self.message.channel
|
return self.message.channel
|
||||||
@ -148,7 +148,7 @@ class GroupCall:
|
|||||||
@property
|
@property
|
||||||
def channel(self):
|
def channel(self):
|
||||||
r""":class:`GroupChannel`\: Returns the channel the group call is in.
|
r""":class:`GroupChannel`\: Returns the channel the group call is in.
|
||||||
|
|
||||||
.. deprecated:: 1.7
|
.. deprecated:: 1.7
|
||||||
"""
|
"""
|
||||||
return self.call.channel
|
return self.call.channel
|
||||||
|
@ -680,8 +680,8 @@ class HTTPClient:
|
|||||||
return self.request(Route('PUT', '/guilds/{guild_id}/templates/{code}', guild_id=guild_id, code=code))
|
return self.request(Route('PUT', '/guilds/{guild_id}/templates/{code}', guild_id=guild_id, code=code))
|
||||||
|
|
||||||
def edit_template(self, guild_id, code, payload):
|
def edit_template(self, guild_id, code, payload):
|
||||||
valid_keys = (
|
valid_keys = (
|
||||||
'name',
|
'name',
|
||||||
'description',
|
'description',
|
||||||
)
|
)
|
||||||
payload = {
|
payload = {
|
||||||
|
@ -415,7 +415,7 @@ class Message(Hashable):
|
|||||||
call: Optional[:class:`CallMessage`]
|
call: Optional[:class:`CallMessage`]
|
||||||
The call that the message refers to. This is only applicable to messages of type
|
The call that the message refers to. This is only applicable to messages of type
|
||||||
:attr:`MessageType.call`.
|
:attr:`MessageType.call`.
|
||||||
|
|
||||||
.. deprecated:: 1.7
|
.. deprecated:: 1.7
|
||||||
|
|
||||||
reference: Optional[:class:`~discord.MessageReference`]
|
reference: Optional[:class:`~discord.MessageReference`]
|
||||||
@ -923,7 +923,7 @@ class Message(Hashable):
|
|||||||
|
|
||||||
if self.type is MessageType.channel_follow_add:
|
if self.type is MessageType.channel_follow_add:
|
||||||
return '{0.author.name} has added {0.content} to this channel'.format(self)
|
return '{0.author.name} has added {0.content} to this channel'.format(self)
|
||||||
|
|
||||||
if self.type is MessageType.guild_stream:
|
if self.type is MessageType.guild_stream:
|
||||||
return '{0.author.name} is live! Now streaming {0.author.activity.name}'.format(self)
|
return '{0.author.name} is live! Now streaming {0.author.activity.name}'.format(self)
|
||||||
|
|
||||||
|
@ -159,7 +159,7 @@ class Permissions(BaseFlags):
|
|||||||
- :attr:`kick_members`
|
- :attr:`kick_members`
|
||||||
- :attr:`ban_members`
|
- :attr:`ban_members`
|
||||||
- :attr:`administrator`
|
- :attr:`administrator`
|
||||||
|
|
||||||
.. versionchanged:: 1.7
|
.. versionchanged:: 1.7
|
||||||
Added :attr:`stream`, :attr:`priority_speaker` and :attr:`use_slash_commands` permissions.
|
Added :attr:`stream`, :attr:`priority_speaker` and :attr:`use_slash_commands` permissions.
|
||||||
"""
|
"""
|
||||||
@ -169,7 +169,7 @@ class Permissions(BaseFlags):
|
|||||||
def general(cls):
|
def general(cls):
|
||||||
"""A factory method that creates a :class:`Permissions` with all
|
"""A factory method that creates a :class:`Permissions` with all
|
||||||
"General" permissions from the official Discord UI set to ``True``.
|
"General" permissions from the official Discord UI set to ``True``.
|
||||||
|
|
||||||
.. versionchanged:: 1.7
|
.. versionchanged:: 1.7
|
||||||
Permission :attr:`read_messages` is now included in the general permissions, but
|
Permission :attr:`read_messages` is now included in the general permissions, but
|
||||||
permissions :attr:`administrator`, :attr:`create_instant_invite`, :attr:`kick_members`,
|
permissions :attr:`administrator`, :attr:`create_instant_invite`, :attr:`kick_members`,
|
||||||
@ -182,7 +182,7 @@ class Permissions(BaseFlags):
|
|||||||
def membership(cls):
|
def membership(cls):
|
||||||
"""A factory method that creates a :class:`Permissions` with all
|
"""A factory method that creates a :class:`Permissions` with all
|
||||||
"Membership" permissions from the official Discord UI set to ``True``.
|
"Membership" permissions from the official Discord UI set to ``True``.
|
||||||
|
|
||||||
.. versionadded:: 1.7
|
.. versionadded:: 1.7
|
||||||
"""
|
"""
|
||||||
return cls(0b00001100000000000000000000000111)
|
return cls(0b00001100000000000000000000000111)
|
||||||
@ -191,7 +191,7 @@ class Permissions(BaseFlags):
|
|||||||
def text(cls):
|
def text(cls):
|
||||||
"""A factory method that creates a :class:`Permissions` with all
|
"""A factory method that creates a :class:`Permissions` with all
|
||||||
"Text" permissions from the official Discord UI set to ``True``.
|
"Text" permissions from the official Discord UI set to ``True``.
|
||||||
|
|
||||||
.. versionchanged:: 1.7
|
.. versionchanged:: 1.7
|
||||||
Permission :attr:`read_messages` is no longer part of the text permissions.
|
Permission :attr:`read_messages` is no longer part of the text permissions.
|
||||||
Added :attr:`use_slash_commands` permission.
|
Added :attr:`use_slash_commands` permission.
|
||||||
@ -208,7 +208,7 @@ class Permissions(BaseFlags):
|
|||||||
def advanced(cls):
|
def advanced(cls):
|
||||||
"""A factory method that creates a :class:`Permissions` with all
|
"""A factory method that creates a :class:`Permissions` with all
|
||||||
"Advanced" permissions from the official Discord UI set to ``True``.
|
"Advanced" permissions from the official Discord UI set to ``True``.
|
||||||
|
|
||||||
.. versionadded:: 1.7
|
.. versionadded:: 1.7
|
||||||
"""
|
"""
|
||||||
return cls(1 << 3)
|
return cls(1 << 3)
|
||||||
|
@ -106,7 +106,7 @@ class Template:
|
|||||||
def __init__(self, *, state, data):
|
def __init__(self, *, state, data):
|
||||||
self._state = state
|
self._state = state
|
||||||
self._store(data)
|
self._store(data)
|
||||||
|
|
||||||
def _store(self, data):
|
def _store(self, data):
|
||||||
self.code = data['code']
|
self.code = data['code']
|
||||||
self.uses = data['usage_count']
|
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)
|
data = await self._state.http.create_from_template(self.code, name, region_value, icon)
|
||||||
return Guild(data=data, state=self._state)
|
return Guild(data=data, state=self._state)
|
||||||
|
|
||||||
async def sync(self):
|
async def sync(self):
|
||||||
"""|coro|
|
"""|coro|
|
||||||
|
|
||||||
Sync the template to the guild's current state.
|
Sync the template to the guild's current state.
|
||||||
|
|
||||||
You must have the :attr:`~Permissions.manage_guild` permission in the
|
You must have the :attr:`~Permissions.manage_guild` permission in the
|
||||||
@ -199,14 +199,14 @@ class Template:
|
|||||||
|
|
||||||
async def edit(self, **kwargs):
|
async def edit(self, **kwargs):
|
||||||
"""|coro|
|
"""|coro|
|
||||||
|
|
||||||
Edit the template metadata.
|
Edit the template metadata.
|
||||||
|
|
||||||
You must have the :attr:`~Permissions.manage_guild` permission in the
|
You must have the :attr:`~Permissions.manage_guild` permission in the
|
||||||
source guild to do this.
|
source guild to do this.
|
||||||
|
|
||||||
.. versionadded:: 1.7
|
.. versionadded:: 1.7
|
||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
------------
|
------------
|
||||||
name: Optional[:class:`str`]
|
name: Optional[:class:`str`]
|
||||||
@ -225,12 +225,12 @@ class Template:
|
|||||||
"""
|
"""
|
||||||
data = await self._state.http.edit_template(self.source_guild.id, self.code, kwargs)
|
data = await self._state.http.edit_template(self.source_guild.id, self.code, kwargs)
|
||||||
self._store(data)
|
self._store(data)
|
||||||
|
|
||||||
async def delete(self):
|
async def delete(self):
|
||||||
"""|coro|
|
"""|coro|
|
||||||
|
|
||||||
Delete the template.
|
Delete the template.
|
||||||
|
|
||||||
You must have the :attr:`~Permissions.manage_guild` permission in the
|
You must have the :attr:`~Permissions.manage_guild` permission in the
|
||||||
source guild to do this.
|
source guild to do this.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user