Remove VoiceRegion enum and Guild.region attribute

This has been marked deprecated by Discord and it was more or less
usually out of date due to the pace they added them anyway.
This commit is contained in:
Rapptz
2022-02-23 08:56:10 -05:00
parent cc21872072
commit 0eb2f32399
7 changed files with 37 additions and 166 deletions

View File

@@ -58,7 +58,7 @@ from .channel import _threaded_channel_factory, PartialMessageable
from .enums import ChannelType
from .mentions import AllowedMentions
from .errors import *
from .enums import Status, VoiceRegion
from .enums import Status
from .flags import ApplicationFlags, Intents
from .gateway import *
from .activity import ActivityTypes, BaseActivity, create_activity
@@ -1345,7 +1345,6 @@ class Client:
self,
*,
name: str,
region: Union[VoiceRegion, str] = VoiceRegion.us_west,
icon: bytes = MISSING,
code: str = MISSING,
) -> Guild:
@@ -1357,15 +1356,13 @@ class Client:
.. versionchanged:: 2.0
``name`` and ``region``, and ``icon`` parameters are now keyword-only.
``name`` and ``icon`` parameters are now keyword-only.
The `region`` parameter has been removed.
Parameters
----------
name: :class:`str`
The name of the guild.
region: :class:`.VoiceRegion`
The region for the voice communication server.
Defaults to :attr:`.VoiceRegion.us_west`.
icon: Optional[:class:`bytes`]
The :term:`py:bytes-like object` representing the icon. See :meth:`.ClientUser.edit`
for more details on what is expected.
@@ -1392,12 +1389,10 @@ class Client:
else:
icon_base64 = None
region_value = str(region)
if code:
data = await self.http.create_from_template(code, name, region_value, icon_base64)
data = await self.http.create_from_template(code, name, icon_base64)
else:
data = await self.http.create_guild(name, region_value, icon_base64)
data = await self.http.create_guild(name, icon_base64)
return Guild(data=data, state=self._connection)
async def fetch_stage_instance(self, channel_id: int, /) -> StageInstance: