Skip to content

feat/fix💥: adjust and fix various issues with scheduled events #1547

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

Merged
merged 1 commit into from
Nov 30, 2023

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 PR improves using scheduled events in the library by fixing longstanding issues related to it and its events. In particular, this adds a proper method for fetching scheduled events in the cache, adds a get event for scheduled events for guilds, and fixes GuildScheduledEventUserAdd/Remove since those were utterly broken.

Note: this technically is breaking, and so should have some eyes on it. However, GuildScheduledEventUserAdd/Remove is so broken and unusable in its current state to the point where you would have to use a raw event to get any useful information most of the time. I understand that violates our versioning standards, but I legitimately think this is such an extreme case that it should be considered.

Changes

  • 💥 Fix GuildScheduledEventUserAdd/Remove by properly passing the IDs instead of the objects of the events.
  • Fix the get scheduled event HTTP method to properly pass in with_user_count.
  • Add in fetch_scheduled_event to SmartCache.
    • The Guild variant now uses the above method, using the cache properly.
  • Add in get_scheduled_event to Guild.
  • Properly typehint user_count in ScheduledEvent.

Related Issues

Test Scenarios

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

@i0bs
Copy link
Contributor

i0bs commented Oct 3, 2023

I cannot access Discord, but I believe decision making of placing this on hold up to @LordOfPolls since it's an obvious breaking change.

@LordOfPolls
Copy link
Contributor

Merging as non breaking - you cant break the api for something that never worked to start with

@LordOfPolls LordOfPolls merged commit 633da19 into interactions-py:unstable Nov 30, 2023
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.

3 participants