-
-
Notifications
You must be signed in to change notification settings - Fork 471
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
discord/scheduled_events.py
Outdated
@property | ||
def weekdays(self) -> list[WeekDay]: | ||
"""Returns a read-only list containing all the specific days | ||
within a week on which the event will recur on. | ||
""" | ||
if self._weekdays is MISSING: | ||
return [] | ||
return self._weekdays.copy() | ||
|
||
@property | ||
def n_weekdays(self) -> list[NWeekDay]: | ||
"""Returns a read-only list containing all the specific days | ||
within a specific week on which the event will recur on. | ||
""" | ||
if self._n_weekdays is MISSING: | ||
return [] | ||
return self._n_weekdays.copy() | ||
|
||
@property | ||
def month_days(self) -> list[datetime.date]: | ||
"""Returns a read-only list containing all the specific days | ||
within a specific month on which the event will recur on. | ||
""" | ||
if self._month_days is MISSING: | ||
return [] | ||
return self._month_days.copy() | ||
|
||
@property | ||
def year_days(self) -> list[int]: | ||
"""Returns a read-only list containing all the specific days | ||
of the year on which the event will recur on. | ||
""" | ||
if self._year_days is MISSING: | ||
return [] | ||
return self._year_days.copy() |
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.
Any reason these are read-only properties?
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.
Because as recurrence rules can be both received by API/Gw and created by users, I thought it would be better to make these properties read only and if the user wants to edit the rrule they use edit
instead. (Similar as dateutil.rrule.rrule.replace)
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.
Read only makes more sense to me
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.
That seems inconsistent to me, no other object in the library does this
Co-authored-by: plun1331 <plun1331@gmail.com> Signed-off-by: DA344 <108473820+DA-344@users.noreply.github.com>
discord/scheduled_events.py
Outdated
), | ||
], | ||
) | ||
Creating a recurrence rule that repeats anually on July 24: :: |
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 is where I mean
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.
Ah okay, lol, i'll update it
… into feat/recurrence-rule
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: ignore
comments were used, a comment is also left explaining why.