mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-10-21 16:03:10 +00:00
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:
@@ -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:
|
||||
|
Reference in New Issue
Block a user