Browse Source

chore: Fix lint

pull/9685/head
DA-344 5 months ago
parent
commit
990bc76ec9
  1. 2
      discord/guild.py
  2. 12
      discord/scheduled_event.py

2
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

12
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')

Loading…
Cancel
Save