diff --git a/discord/guild.py b/discord/guild.py index fbed39771..94d8d1cc6 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -3412,7 +3412,7 @@ class Guild(Hashable): if recurrence_rule is not MISSING: if recurrence_rule is not None: - payload['recurrence_rule'] = recurrence_rule._to_dict() + payload['recurrence_rule'] = recurrence_rule.to_dict() else: payload['recurrence_rule'] = None diff --git a/discord/scheduled_event.py b/discord/scheduled_event.py index 14a8c3e0c..ab9214dbd 100644 --- a/discord/scheduled_event.py +++ b/discord/scheduled_event.py @@ -36,7 +36,6 @@ from typing import ( Literal, List, ) -from functools import partial from .asset import Asset from .enums import ( @@ -58,7 +57,6 @@ if TYPE_CHECKING: GuildScheduledEvent as BaseGuildScheduledEventPayload, GuildScheduledEventWithUserCount as GuildScheduledEventWithUserCountPayload, ScheduledEventRecurrenceRule as ScheduledEventRecurrenceRulePayload, - _NWeekday as NWeekdayPayload, EntityMetadata, ) @@ -223,10 +221,7 @@ class ScheduledEventRecurrenceRule: return months, days def _parse_month_days_payload(self, months: List[int], days: List[int]) -> List[date]: - return [ - date(1900, month, day) - for month, day in zip(months, days) - ] + return [date(1900, month, day) for month, day in zip(months, days)] @classmethod def from_data(cls, data: Optional[ScheduledEventRecurrenceRulePayload]) -> Optional[Self]: @@ -247,10 +242,7 @@ class ScheduledEventRecurrenceRule: self._weekdays = weekdays n_weekdays = data.get('by_n_weekday', []) or [] - self._n_weekdays = [ - (data['n'], try_enum(ScheduledEventRecurrenceWeekday, data['day'])) - for data in n_weekdays - ] + self._n_weekdays = [(data['n'], try_enum(ScheduledEventRecurrenceWeekday, data['day'])) for data in n_weekdays] months = data.get('by_month') month_days = data.get('by_month_day')