Skip to content

Commit

Permalink
chore: Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
DA-344 committed Jan 19, 2025
1 parent 74a459f commit 990bc76
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
2 changes: 1 addition & 1 deletion discord/guild.py
Original file line number Diff line number Diff line change
Expand Up @@ -3412,7 +3412,7 @@ async def create_scheduled_event(

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

Expand Down
12 changes: 2 additions & 10 deletions discord/scheduled_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
Literal,
List,
)
from functools import partial

from .asset import Asset
from .enums import (
Expand All @@ -58,7 +57,6 @@
GuildScheduledEvent as BaseGuildScheduledEventPayload,
GuildScheduledEventWithUserCount as GuildScheduledEventWithUserCountPayload,
ScheduledEventRecurrenceRule as ScheduledEventRecurrenceRulePayload,
_NWeekday as NWeekdayPayload,
EntityMetadata,
)

Expand Down Expand Up @@ -223,10 +221,7 @@ def _get_month_days_payload(self) -> Tuple[List[int], List[int]]:
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]:
Expand All @@ -247,10 +242,7 @@ def from_data(cls, data: Optional[ScheduledEventRecurrenceRulePayload]) -> Optio
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')
Expand Down

0 comments on commit 990bc76

Please sign in to comment.