Browse Source
Add deprecation warning to create_guild functions
pull/10215/head
Gooraeng
2 weeks ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
10 additions and
2 deletions
-
discord/client.py
-
discord/template.py
|
|
@ -67,7 +67,7 @@ from .voice_client import VoiceClient |
|
|
|
from .http import HTTPClient |
|
|
|
from .state import ConnectionState |
|
|
|
from . import utils |
|
|
|
from .utils import MISSING, time_snowflake |
|
|
|
from .utils import MISSING, time_snowflake, deprecated |
|
|
|
from .object import Object |
|
|
|
from .backoff import ExponentialBackoff |
|
|
|
from .webhook import Webhook |
|
|
@ -2388,6 +2388,7 @@ class Client: |
|
|
|
data = await self.http.get_guild_preview(guild_id) |
|
|
|
return GuildPreview(data=data, state=self._connection) |
|
|
|
|
|
|
|
@deprecated() |
|
|
|
async def create_guild( |
|
|
|
self, |
|
|
|
*, |
|
|
@ -2408,6 +2409,9 @@ class Client: |
|
|
|
This function will now raise :exc:`ValueError` instead of |
|
|
|
``InvalidArgument``. |
|
|
|
|
|
|
|
.. deprecated:: 2.6 |
|
|
|
This function is deprecated and will be removed in a future version. |
|
|
|
|
|
|
|
Parameters |
|
|
|
---------- |
|
|
|
name: :class:`str` |
|
|
|
|
|
@ -25,7 +25,7 @@ DEALINGS IN THE SOFTWARE. |
|
|
|
from __future__ import annotations |
|
|
|
|
|
|
|
from typing import Any, Optional, TYPE_CHECKING, List |
|
|
|
from .utils import parse_time, _bytes_to_base64_data, MISSING |
|
|
|
from .utils import parse_time, _bytes_to_base64_data, MISSING, deprecated |
|
|
|
from .guild import Guild |
|
|
|
|
|
|
|
# fmt: off |
|
|
@ -164,6 +164,7 @@ class Template: |
|
|
|
f' creator={self.creator!r} source_guild={self.source_guild!r} is_dirty={self.is_dirty}>' |
|
|
|
) |
|
|
|
|
|
|
|
@deprecated() |
|
|
|
async def create_guild(self, name: str, icon: bytes = MISSING) -> Guild: |
|
|
|
"""|coro| |
|
|
|
|
|
|
@ -178,6 +179,9 @@ class Template: |
|
|
|
This function will now raise :exc:`ValueError` instead of |
|
|
|
``InvalidArgument``. |
|
|
|
|
|
|
|
.. deprecated:: 2.6 |
|
|
|
This function is deprecated and will be removed in a future version. |
|
|
|
|
|
|
|
Parameters |
|
|
|
---------- |
|
|
|
name: :class:`str` |
|
|
|