Browse Source

Rename GuildRegion to VoiceRegion.

This naming makes more sense since voice regions are not a guild
exclusive concept.
pull/572/head
Rapptz 8 years ago
parent
commit
a0fc1402d7
  1. 6
      discord/calls.py
  2. 4
      discord/enums.py
  3. 8
      discord/guild.py
  4. 4
      docs/api.rst

6
discord/calls.py

@ -27,7 +27,7 @@ DEALINGS IN THE SOFTWARE.
import datetime
from . import utils
from .enums import GuildRegion, try_enum
from .enums import VoiceRegion, try_enum
from .member import VoiceState
class CallMessage:
@ -91,7 +91,7 @@ class GroupCall:
Denotes if this group call is unavailable.
ringing: List[:class:`User`]
A list of users that are currently being rung to join the call.
region: :class:`GuildRegion`
region: :class:`VoiceRegion`
The guild region the group call is being hosted on.
"""
@ -106,7 +106,7 @@ class GroupCall:
self._update(**kwargs)
def _update(self, **kwargs):
self.region = try_enum(GuildRegion, kwargs.get('region'))
self.region = try_enum(VoiceRegion, kwargs.get('region'))
lookup = {u.id: u for u in self.call.channel.recipients}
me = self.call.channel.me
lookup[me.id] = me

4
discord/enums.py

@ -26,7 +26,7 @@ DEALINGS IN THE SOFTWARE.
from enum import Enum
__all__ = ['ChannelType', 'MessageType', 'GuildRegion', 'VerificationLevel',
__all__ = ['ChannelType', 'MessageType', 'VoiceRegion', 'VerificationLevel',
'ContentFilter', 'Status', 'DefaultAvatar', 'RelationshipType',
'AuditLogAction', 'AuditLogActionCategory', ]
@ -49,7 +49,7 @@ class MessageType(Enum):
pins_add = 6
new_member = 7
class GuildRegion(Enum):
class VoiceRegion(Enum):
us_west = 'us-west'
us_east = 'us-east'
us_south = 'us-south'

8
discord/guild.py

@ -37,7 +37,7 @@ from .permissions import PermissionOverwrite
from .colour import Colour
from .errors import InvalidArgument, ClientException
from .channel import *
from .enums import GuildRegion, Status, ChannelType, try_enum, VerificationLevel, ContentFilter
from .enums import VoiceRegion, Status, ChannelType, try_enum, VerificationLevel, ContentFilter
from .mixins import Hashable
from .user import User
from .invite import Invite
@ -72,7 +72,7 @@ class Guild(Hashable):
A list of :class:`Role` that the guild has available.
emojis
A tuple of :class:`Emoji` that the guild owns.
region: :class:`GuildRegion`
region: :class:`VoiceRegion`
The region the guild belongs on. There is a chance that the region
will be a ``str`` if the value is not recognised by the enumerator.
afk_timeout: int
@ -195,7 +195,7 @@ class Guild(Hashable):
self._member_count = member_count
self.name = guild.get('name')
self.region = try_enum(GuildRegion, guild.get('region'))
self.region = try_enum(VoiceRegion, guild.get('region'))
self.verification_level = try_enum(VerificationLevel, guild.get('verification_level'))
self.explicit_content_filter = try_enum(ContentFilter, guild.get('explicit_content_filter', 0))
self.afk_timeout = guild.get('afk_timeout')
@ -581,7 +581,7 @@ class Guild(Hashable):
Only PNG/JPEG supported. Could be ``None`` to denote removing the
splash. Only available for partnered guilds with ``INVITE_SPLASH``
feature.
region: :class:`GuildRegion`
region: :class:`VoiceRegion`
The new region for the guild's voice communication.
afk_channel: :class:`VoiceChannel`
The new channel that is the AFK channel. Could be ``None`` for no AFK channel.

4
docs/api.rst

@ -579,9 +579,9 @@ All enumerations are subclasses of `enum`_.
The system message denoting that a pinned message has been added to a channel.
.. class:: GuildRegion
.. class:: VoiceRegion
Specifies the region a :class:`Guild`'s voice server belongs to.
Specifies the region a voice server belongs to.
.. attribute:: us_west

Loading…
Cancel
Save