-
-
Notifications
You must be signed in to change notification settings - Fork 479
feat: Add support for Guild Scheduled Event Recurrence #2749
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
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: plun1331 <[email protected]> Signed-off-by: DA344 <[email protected]>
… into feat/recurrence-rule
| If this recurrence rule was obtained from the API you will need to | ||
| :meth:`.copy` it in order to edit it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one more question... why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class seems to serve more as a dataclass-ish than an API object. Which is fine, but having an edit method here, and then disallowing editing attributes seems weird. This class should realistically not even hold self._state (I believe). It would probably make everything easier.
|
Merge conflicts |
b55c125 to
82659b2
Compare
Signed-off-by: Lala Sabathil <[email protected]>
|
@DA-344 went ahead and fixed the merge conflicts for you. please double check |
| If this recurrence rule was obtained from the API you will need to | ||
| :meth:`.copy` it in order to edit it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this
| image: Optional[:class:`bytes`] | ||
| The cover image of the scheduled event | ||
| The cover image of the scheduled event. | ||
| recurrence_rule: Optional[:class:`ScheduledEventRecurrenceRule`] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is provided, is start_date ignored ?
Signed-off-by: Lumouille <[email protected]>
Signed-off-by: Lala Sabathil <[email protected]>
Paillat-dev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also see merge conflicts
| self.exceptions: list[Object] = list( | ||
| map( | ||
| Object, | ||
| data.get("guild_scheduled_events_exceptions", []) or [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| data.get("guild_scheduled_events_exceptions", []) or [], | |
| data.get("guild_scheduled_events_exceptions") or [], |
| return f"<ScheduledEventRecurrenceRule start_date={self.start_date} frequency={self.frequency} interval={self.interval}>" | ||
|
|
||
| @property | ||
| def weekdays(self) -> list[ScheduledEventWeekday]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been thinking about this again. If you can, I think we should just make these normal attributes. Realistically, it's more likely to confuse someone than prevent misuse. See my comment on edit below as well
| If this recurrence rule was obtained from the API you will need to | ||
| :meth:`.copy` it in order to edit it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class seems to serve more as a dataclass-ish than an API object. Which is fine, but having an edit method here, and then disallowing editing attributes seems weird. This class should realistically not even hold self._state (I believe). It would probably make everything easier.
Summary
Adds support for receiving, setting, and updating a Scheduled Event's recurrence rule.
Documentation: resources/guild-scheduled-event
Needs testing.
Information
examples, ...).
Checklist
type: ignorecomments were used, a comment is also left explaining why.