Skip to content

Conversation

@AstreaTSS
Copy link
Member

Pull Request Type

  • Feature addition
  • Bugfix
  • Documentation update
  • Code refactor
  • Tests improvement
  • CI/CD pipeline enhancement
  • Other: [Replace with a description]

Description

This adds two new arguments that were missing from create_forum_post (but are documented in the Discord API docs) - default_reaction_emoji and available_tags. This also adds a ton of logic to make that possible and seamless, and also to fill in the gaps that were created from the absence of these two.

Changes

  • Added default_reaction_emoji and available_tags to Guild.create_forum_post.
    • These were made to be as lenient and support the most formats possible - as such, the code is slightly unclean.
  • Created DefaultReaction and add it to GuildForum.
    • This is currently barebones, not having helper methods due to the complexity that brings.
  • Create a locally-friendly classmethod for creating ThreadTags for usage for create_forum_post.
    • This requires a few hacks and isn't actually a real object, but it becomes a valid payload all the same.
  • Made a processing method for ThreadTag and DefaultReaction.

Related Issues

Test Scenarios

One of many ways of using this new feature is:

await guild.create_forum_channel(
    name="test",
    default_reaction_emoji="🦀",
    available_tags=interactions.ThreadTag.create("test", moderated=True, emoji="👍"),
)

Python Compatibility

  • I've ensured my code works on Python 3.10.x
  • I've ensured my code works on Python 3.11.x

Checklist

  • I've run the pre-commit code linter over all edited files
  • I've tested my changes on supported Python versions
  • I've added tests for my code, if applicable
  • I've updated / added documentation, where applicable

@LordOfPolls LordOfPolls merged commit 0e08e82 into interactions-py:unstable May 26, 2023
@AstreaTSS AstreaTSS deleted the missing-forum-post-args branch June 20, 2023 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants