|
|
@ -1863,6 +1863,7 @@ class Guild(Hashable): |
|
|
|
invites_disabled: bool = MISSING, |
|
|
|
widget_enabled: bool = MISSING, |
|
|
|
widget_channel: Optional[Snowflake] = MISSING, |
|
|
|
mfa_level: MFALevel = MISSING, |
|
|
|
) -> Guild: |
|
|
|
r"""|coro| |
|
|
|
|
|
|
@ -1874,7 +1875,7 @@ class Guild(Hashable): |
|
|
|
The ``rules_channel`` and ``public_updates_channel`` keyword parameters were added. |
|
|
|
|
|
|
|
.. versionchanged:: 2.0 |
|
|
|
The ``discovery_splash`` and ``community`` keyword parameters were added. |
|
|
|
The ``discovery_splash``, ``community``, ``premium_progress_bar_enabled``, ``discoverable``, ``invites_disabled``, ``widget_enabled``, ``widget_channel``, and ``mfa_level` keyword parameters were added. |
|
|
|
|
|
|
|
.. versionchanged:: 2.0 |
|
|
|
The newly updated guild is returned. |
|
|
@ -1889,15 +1890,6 @@ class Guild(Hashable): |
|
|
|
.. versionchanged:: 2.0 |
|
|
|
The ``preferred_locale`` keyword parameter now accepts an enum instead of :class:`str`. |
|
|
|
|
|
|
|
.. versionchanged:: 2.0 |
|
|
|
The ``premium_progress_bar_enabled`` keyword parameter was added. |
|
|
|
|
|
|
|
.. versionchanged:: 2.0 |
|
|
|
The ``discoverable`` and ``invites_disabled`` keyword parameters were added. |
|
|
|
|
|
|
|
.. versionchanged:: 2.0 |
|
|
|
The ``widget_enabled`` and ``widget_channel`` keyword parameters were added. |
|
|
|
|
|
|
|
Parameters |
|
|
|
---------- |
|
|
|
name: :class:`str` |
|
|
@ -1967,6 +1959,9 @@ class Guild(Hashable): |
|
|
|
The new widget channel. ``None`` removes the widget channel. |
|
|
|
reason: Optional[:class:`str`] |
|
|
|
The reason for editing this guild. Shows up on the audit log. |
|
|
|
mfa_level: :class:`MFALevel` |
|
|
|
The new guild’s Multi-Factor Authentication requirement level. |
|
|
|
Note that you must be owner of the guild to do this. |
|
|
|
|
|
|
|
Raises |
|
|
|
------- |
|
|
@ -1980,7 +1975,7 @@ class Guild(Hashable): |
|
|
|
guild and request an ownership transfer. |
|
|
|
TypeError |
|
|
|
The type passed to the ``default_notifications``, ``verification_level``, |
|
|
|
``explicit_content_filter``, or ``system_channel_flags`` parameter was |
|
|
|
``explicit_content_filter``, ``system_channel_flags``, or ``mfa_level`` parameter was |
|
|
|
of the incorrect type. |
|
|
|
|
|
|
|
Returns |
|
|
@ -1989,7 +1984,6 @@ class Guild(Hashable): |
|
|
|
The newly updated guild. Note that this has the same limitations as |
|
|
|
mentioned in :meth:`Client.fetch_guild` and may not have full data. |
|
|
|
""" |
|
|
|
# TODO: see what fields are sent no matter if they're changed or not |
|
|
|
http = self._state.http |
|
|
|
|
|
|
|
if vanity_code is not MISSING: |
|
|
@ -2125,6 +2119,12 @@ class Guild(Hashable): |
|
|
|
if widget_payload: |
|
|
|
await self._state.http.edit_widget(self.id, payload=widget_payload, reason=reason) |
|
|
|
|
|
|
|
if mfa_level is not MISSING: |
|
|
|
if not isinstance(mfa_level, MFALevel): |
|
|
|
raise TypeError('mfa_level must be of type MFALevel') |
|
|
|
|
|
|
|
await http.edit_guild_mfa_level(self.id, mfa_level=mfa_level.value) |
|
|
|
|
|
|
|
data = await http.edit_guild(self.id, reason=reason, **fields) |
|
|
|
return Guild(data=data, state=self._state) |
|
|
|
|
|
|
|