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.
.. 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
The newly updated guild is returned.
@ -1887,24 +1881,21 @@ class Guild(Hashable):
This function will now raise :exc:`TypeError` or
:exc:`ValueError` instead of ``InvalidArgument``.
.. versionchanged:: 2.0
The ``preferred_locale`` keyword parameter now accepts an enum instead of :class:`str`.
Parameters
----------
name: :class:`str`
The new name of the guild.
description: Optional[:class:`str`]
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`
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`.
Could be ``None`` to denote removal of the icon.
banner: :class:`bytes`
A :term:`py:bytes-like object` representing the banner.
Could be ``None`` to denote removal of the banner. This is only available to guilds that contain
``BANNER`` in :attr:`Guild.features`.
A :term:`py:bytes-like object` representing the banner. Only PNG/JPEG is supported.
GIF is only available to guilds that contain ``ANIMATED_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`
A :term:`py:bytes-like object` representing the invite splash.
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
splash. This is only available to guilds that contain ``DISCOVERABLE``
in :attr:`Guild.features`.
.. versionadded:: 2.0
community: :class:`bool`
Whether the guild should be a Community guild. If set to ``True``\, both ``rules_channel``
and ``public_updates_channel`` parameters are required.
.. versionadded:: 2.0
afk_channel: Optional[:class:`VoiceChannel`]
The new channel that is the AFK channel. Could be ``None`` for no AFK channel.
afk_timeout: :class:`int`
@ -1939,30 +1934,50 @@ class Guild(Hashable):
The new system channel settings to use with the new system channel.
preferred_locale: :class:`Locale`
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`]
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
channel.
.. versionadded:: 1.4
public_updates_channel: Optional[:class:`TextChannel`]
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
public updates channel.
.. versionadded:: 1.4
premium_progress_bar_enabled: :class:`bool`
Whether the premium AKA server boost level progress bar should be enabled for the guild.
.. versionadded:: 2.0
discoverable: :class:`bool`
Whether server discovery is enabled for this guild.
.. versionadded:: 2.0
invites_disabled: :class:`bool`
Whether joining via invites should be disabled for the guild.
.. versionadded:: 2.0
widget_enabled: :class:`bool`
Whether to enable the widget for the guild.
.. versionadded:: 2.0
widget_channel: Optional[:class:`abc.Snowflake`]
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`
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.
.. versionadded:: 2.0
reason: Optional[:class:`str`]
The reason for editing this guild. Shows up on the audit log.
Raises
-------
Forbidden

2
docs/api.rst

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

Loading…
Cancel
Save