Browse Source

Clean up Guild.edit documentation

pull/10109/head
Rapptz 2 years ago
committed by dolfies
parent
commit
bf71a20e46
  1. 47
      discord/guild.py
  2. 2
      docs/api.rst

47
discord/guild.py

@ -1871,12 +1871,6 @@ class Guild(Hashable):
You must have :attr:`~Permissions.manage_guild` to edit the guild. You must have :attr:`~Permissions.manage_guild` to edit the guild.
.. versionchanged:: 1.4
The ``rules_channel`` and ``public_updates_channel`` keyword parameters were added.
.. versionchanged:: 2.0
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 .. versionchanged:: 2.0
The newly updated guild is returned. The newly updated guild is returned.
@ -1887,24 +1881,21 @@ class Guild(Hashable):
This function will now raise :exc:`TypeError` or This function will now raise :exc:`TypeError` or
:exc:`ValueError` instead of ``InvalidArgument``. :exc:`ValueError` instead of ``InvalidArgument``.
.. versionchanged:: 2.0
The ``preferred_locale`` keyword parameter now accepts an enum instead of :class:`str`.
Parameters Parameters
---------- ----------
name: :class:`str` name: :class:`str`
The new name of the guild. The new name of the guild.
description: Optional[:class:`str`] description: Optional[:class:`str`]
The new description of the guild. Could be ``None`` for no description. The new description of the guild. Could be ``None`` for no description.
This is only available to guilds that contain ``COMMUNITY`` in :attr:`Guild.features`.
icon: :class:`bytes` icon: :class:`bytes`
A :term:`py:bytes-like object` representing the icon. Only PNG/JPEG is supported. A :term:`py:bytes-like object` representing the icon. Only PNG/JPEG is supported.
GIF is only available to guilds that contain ``ANIMATED_ICON`` in :attr:`Guild.features`. GIF is only available to guilds that contain ``ANIMATED_ICON`` in :attr:`Guild.features`.
Could be ``None`` to denote removal of the icon. Could be ``None`` to denote removal of the icon.
banner: :class:`bytes` banner: :class:`bytes`
A :term:`py:bytes-like object` representing the banner. A :term:`py:bytes-like object` representing the banner. Only PNG/JPEG is supported.
Could be ``None`` to denote removal of the banner. This is only available to guilds that contain GIF is only available to guilds that contain ``ANIMATED_BANNER`` in :attr:`Guild.features`.
``BANNER`` in :attr:`Guild.features`. Could be ``None`` to denote removal of the banner.
This is only available to guilds that contain ``BANNER`` in :attr:`Guild.features`.
splash: :class:`bytes` splash: :class:`bytes`
A :term:`py:bytes-like object` representing the invite splash. A :term:`py:bytes-like object` representing the invite splash.
Only PNG/JPEG supported. Could be ``None`` to denote removing the Only PNG/JPEG supported. Could be ``None`` to denote removing the
@ -1915,9 +1906,13 @@ class Guild(Hashable):
Only PNG/JPEG supported. Could be ``None`` to denote removing the Only PNG/JPEG supported. Could be ``None`` to denote removing the
splash. This is only available to guilds that contain ``DISCOVERABLE`` splash. This is only available to guilds that contain ``DISCOVERABLE``
in :attr:`Guild.features`. in :attr:`Guild.features`.
.. versionadded:: 2.0
community: :class:`bool` community: :class:`bool`
Whether the guild should be a Community guild. If set to ``True``\, both ``rules_channel`` Whether the guild should be a Community guild. If set to ``True``\, both ``rules_channel``
and ``public_updates_channel`` parameters are required. and ``public_updates_channel`` parameters are required.
.. versionadded:: 2.0
afk_channel: Optional[:class:`VoiceChannel`] afk_channel: Optional[:class:`VoiceChannel`]
The new channel that is the AFK channel. Could be ``None`` for no AFK channel. The new channel that is the AFK channel. Could be ``None`` for no AFK channel.
afk_timeout: :class:`int` afk_timeout: :class:`int`
@ -1939,30 +1934,50 @@ class Guild(Hashable):
The new system channel settings to use with the new system channel. The new system channel settings to use with the new system channel.
preferred_locale: :class:`Locale` preferred_locale: :class:`Locale`
The new preferred locale for the guild. Used as the primary language in the guild. The new preferred locale for the guild. Used as the primary language in the guild.
.. versionchanged:: 2.0
Now accepts an enum instead of :class:`str`.
rules_channel: Optional[:class:`TextChannel`] rules_channel: Optional[:class:`TextChannel`]
The new channel that is used for rules. This is only available to The new channel that is used for rules. This is only available to
guilds that contain ``COMMUNITY`` in :attr:`Guild.features`. Could be ``None`` for no rules guilds that contain ``COMMUNITY`` in :attr:`Guild.features`. Could be ``None`` for no rules
channel. channel.
.. versionadded:: 1.4
public_updates_channel: Optional[:class:`TextChannel`] public_updates_channel: Optional[:class:`TextChannel`]
The new channel that is used for public updates from Discord. This is only available to The new channel that is used for public updates from Discord. This is only available to
guilds that contain ``COMMUNITY`` in :attr:`Guild.features`. Could be ``None`` for no guilds that contain ``COMMUNITY`` in :attr:`Guild.features`. Could be ``None`` for no
public updates channel. public updates channel.
.. versionadded:: 1.4
premium_progress_bar_enabled: :class:`bool` premium_progress_bar_enabled: :class:`bool`
Whether the premium AKA server boost level progress bar should be enabled for the guild. Whether the premium AKA server boost level progress bar should be enabled for the guild.
.. versionadded:: 2.0
discoverable: :class:`bool` discoverable: :class:`bool`
Whether server discovery is enabled for this guild. Whether server discovery is enabled for this guild.
.. versionadded:: 2.0
invites_disabled: :class:`bool` invites_disabled: :class:`bool`
Whether joining via invites should be disabled for the guild. Whether joining via invites should be disabled for the guild.
.. versionadded:: 2.0
widget_enabled: :class:`bool` widget_enabled: :class:`bool`
Whether to enable the widget for the guild. Whether to enable the widget for the guild.
.. versionadded:: 2.0
widget_channel: Optional[:class:`abc.Snowflake`] widget_channel: Optional[:class:`abc.Snowflake`]
The new widget channel. ``None`` removes the widget channel. 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. .. versionadded:: 2.0
mfa_level: :class:`MFALevel` mfa_level: :class:`MFALevel`
The new guilds Multi-Factor Authentication requirement level. The guild's new Multi-Factor Authentication requirement level.
Note that you must be owner of the guild to do this. Note that you must be owner of the guild to do this.
.. versionadded:: 2.0
reason: Optional[:class:`str`]
The reason for editing this guild. Shows up on the audit log.
Raises Raises
------- -------
Forbidden Forbidden

2
docs/api.rst

@ -1876,7 +1876,7 @@ of :class:`enum.Enum`.
The user is an active developer. The user is an active developer.
.. versionadded:: 2.1 .. versionadded:: 2.0
.. class:: ActivityType .. class:: ActivityType

Loading…
Cancel
Save