Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Large code/documentation cleanup #1476

Merged
merged 24 commits into from
Jul 24, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
8ac724c
Can't even begin to summarize this
baronkobama Jul 8, 2022
5b7fdd9
Can't even begin to summarize this
baronkobama Jul 8, 2022
93e0c56
Merge branch 'code-cleanup' of https://github.com/baronkobama/pycord …
baronkobama Jul 8, 2022
41b959b
Update overwrites description
baronkobama Jul 8, 2022
c0e48de
Add Optional typehint
baronkobama Jul 8, 2022
5fc07bf
Fix indents, slicing, callable brackets
baronkobama Jul 8, 2022
01ac80f
Update discord/abc.py
Lulalaby Jul 10, 2022
aaf9e89
chore: implement suggestions
baronkobama Jul 10, 2022
a7bb9f2
chore: missed one
baronkobama Jul 10, 2022
0d66ae2
Merge branch 'master' into code-cleanup
baronkobama Jul 10, 2022
f485a0f
fix: missing TextChannel docs
baronkobama Jul 10, 2022
3f5ba96
Merge branch 'code-cleanup' of https://github.com/baronkobama/pycord …
baronkobama Jul 10, 2022
3975858
fix: missing ForumChannel docs
baronkobama Jul 10, 2022
a4a3675
fix: failing docs check
baronkobama Jul 10, 2022
7ca6ca6
Update discord/guild.py
baronkobama Jul 11, 2022
1723621
docs: remove unused guild features
baronkobama Jul 11, 2022
81cc65b
docs: undo a removed guild feature
baronkobama Jul 11, 2022
d2ce246
Merge branch 'master' into code-cleanup
Lulalaby Jul 17, 2022
e4be6dc
Update discord/stage_instance.py
Lulalaby Jul 22, 2022
099f797
Update discord/scheduled_events.py
Lulalaby Jul 22, 2022
cf113a0
Update discord/commands/permissions.py
Lulalaby Jul 22, 2022
4a38c22
Merge branch 'master' into code-cleanup
Lulalaby Jul 22, 2022
d8553fb
Update http.py
baronkobama Jul 22, 2022
e7dfdd3
Merge branch 'master' into code-cleanup
Lulalaby Jul 24, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: missing ForumChannel docs
  • Loading branch information
baronkobama committed Jul 10, 2022
commit 39758581be672e7365c2f8e4967ba1d312ac7d82
63 changes: 63 additions & 0 deletions discord/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,69 @@ async def create_thread(


class ForumChannel(_TextChannel):
"""Represents a Discord forum channel.

.. container:: operations

.. describe:: x == y

Checks if two channels are equal.

.. describe:: x != y

Checks if two channels are not equal.

.. describe:: hash(x)

Returns the channel's hash.

.. describe:: str(x)

Returns the channel's name.

Attributes
-----------
name: :class:`str`
The channel name.
guild: :class:`Guild`
The guild the channel belongs to.
id: :class:`int`
The channel ID.
category_id: Optional[:class:`int`]
The category channel ID this channel belongs to, if applicable.
topic: Optional[:class:`str`]
The channel's topic. ``None`` if it doesn't exist.

.. note::

:attr:`guidelines` exists as an alternative to this attribute.
position: Optional[:class:`int`]
The position in the channel list. This is a number that starts at 0. e.g. the
top channel is position 0. Can be ``None`` if the channel was received in an interaction.
last_message_id: Optional[:class:`int`]
The last message ID of the message sent to this channel. It may
*not* point to an existing or valid message.
slowmode_delay: :class:`int`
The number of seconds a member must wait between sending messages
in this channel. A value of `0` denotes that it is disabled.
Bots and users with :attr:`~Permissions.manage_channels` or
:attr:`~Permissions.manage_messages` bypass slowmode.
nsfw: :class:`bool`
If the channel is marked as "not safe for work".

.. note::

To check if the channel or the guild of that channel are marked as NSFW, consider :meth:`is_nsfw` instead.
default_auto_archive_duration: :class:`int`
The default auto archive duration in minutes for threads created in this channel.

.. versionadded:: 2.0
flags: :class:`ChannelFlags`
Extra features of the channel.

.. versionadded:: 2.0
"""

def __init__(self, *, state: ConnectionState, guild: Guild, data: ForumChannelPayload):
super().__init__(state=state, guild=guild, data=data)

Expand Down
16 changes: 16 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4414,6 +4414,22 @@ TextChannel
.. automethod:: typing
:async-with:

ForumChannel
~~~~~~~~~~~~~

.. attributetable:: ForumChannel

.. autoclass:: ForumChannel()
:members:
:inherited-members:
:exclude-members: history, typing

.. automethod:: history
:async-for:

.. automethod:: typing
:async-with:

Thread
~~~~~~~~

Expand Down