From 990bc76ec9730070b82ae00eed3fdcd94a64317a Mon Sep 17 00:00:00 2001 From: DA-344 <108473820+DA-344@users.noreply.github.com> Date: Sun, 19 Jan 2025 12:32:45 +0100 Subject: [PATCH] chore: Fix lint --- discord/guild.py | 2 +- discord/scheduled_event.py | 12 ++---------- 2 files changed, 3 insertions(+), 11 deletions(-) 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')