Skip to content

Commit 1ef4bbe

Browse files
DorukyumBobDotCompre-commit-ci[bot]Lulalaby
authored
feat: Complete forum channel implementation (#1636)
* Add ForumTag type * Make emoji_name nullable * Add forum tag fields * Add missing attributes & create ForumTag * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix typehint syntax * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix typehints * Update discord/http.py Co-authored-by: BobDotCom <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update channel.py * Update channel.py * Update forum tags - Move available_tags to ForumChannel, turn type to `list[ForumTag]` - Fix versionadded * Implement ForumChannel.get_tag * Add sort order, channel flags and total msg * Fix typehints * Update Thread.applied_tags * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Implement ForumChannel.requires_tag * Implement Thread.is_pinned * Update `versionadded`s in docstring * Update SortOrder to match API values * Implement default_sort_order * Implement default_thread_rate_limit_per_user * Add new fields to edit routes * Rename default_thread_rate_limit_per_user This will be called default_thread_slowmode_delay in Pycord. * Seperate edit methods for text and forum channels * Map default_thread_slowmode_delay to valid field * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add require_tag field to ForumChannel.edit * Parse available_tags to dicts in edit * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix: NameError due to TYPE_CHECKING imports * feat: applied_tags field in Thread.edit Co-authored-by: BobDotCom <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Lala Sabathil <[email protected]>
1 parent 8660f67 commit 1ef4bbe

File tree

9 files changed

+479
-98
lines changed

9 files changed

+479
-98
lines changed

discord/abc.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,26 @@ async def _edit(
400400
except KeyError:
401401
pass
402402

403+
try:
404+
options["default_thread_rate_limit_per_user"] = options.pop(
405+
"default_thread_slowmode_delay"
406+
)
407+
except KeyError:
408+
pass
409+
410+
try:
411+
if options.pop("require_tag"):
412+
options["flags"] = ChannelFlags.require_tag.flag
413+
except KeyError:
414+
pass
415+
416+
try:
417+
options["available_tags"] = [
418+
tag.to_dict() for tag in options.pop("available_tags")
419+
]
420+
except KeyError:
421+
pass
422+
403423
try:
404424
rtc_region = options.pop("rtc_region")
405425
except KeyError:

0 commit comments

Comments
 (0)