Skip to content

fix: GuildSchedule not being cached correctly + missing fields#3025

Open
Lumabots wants to merge 58 commits into
masterfrom
on_scheduled_event_delete
Open

fix: GuildSchedule not being cached correctly + missing fields#3025
Lumabots wants to merge 58 commits into
masterfrom
on_scheduled_event_delete

Conversation

@Lumabots

@Lumabots Lumabots commented Dec 9, 2025

Copy link
Copy Markdown
Contributor

Summary

summary is not complete, just check the code

Added
New Enums :
ScheduledEventRecurrenceFrequency (yearly, monthly, weekly, daily)
ScheduledEventRecurrenceWeekday (monday-sunday)
ScheduledEventRecurrenceMonth (january-december)

New Classes:
ScheduledEventEntityMetadata (location)
ScheduledEventRecurrenceNWeekday Represents n-weekday entries (e.g., "1st Tuesday")
ScheduledEventRecurrenceRule: Full recurrence rule with validation

Auto-validates on to_payload() serialization
New fields Guild.create_scheduled_event():

  • well at this point just read the code

Enforces Discord's constraints:

  • Frequency-specific field combinations
  • Mutually exclusive field checks
  • Valid weekday set validation for daily events
  • Required field enforcement for yearly events

Information

  • This PR fixes an issue. on_scheduled_event_delete event parameter is useless #1709
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed).
  • This PR is not a code change (e.g. documentation, README, typehinting,
    examples, ...).

Checklist

  • I have searched the open pull requests for duplicates.
  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • If type: ignore comments were used, a comment is also left explaining why.
  • I have updated the changelog to include these changes.
  • AI Usage has been disclosed.

@Lumabots Lumabots requested a review from a team as a code owner December 9, 2025 19:51
@pycord-app

pycord-app Bot commented Dec 9, 2025

Copy link
Copy Markdown

Thanks for opening this pull request!
Please make sure you have read the Contributing Guidelines and Code of Conduct.

This pull request can be checked-out with:

git fetch origin pull/3025/head:pr-3025
git checkout pr-3025

This pull request can be installed with:

pip install git+https://github.com/Pycord-Development/pycord@refs/pull/3025/head

@Lumabots

Lumabots commented Dec 9, 2025

Copy link
Copy Markdown
Contributor Author

Audit Logs still need to be rework (i didnt understand how it work yet)

@Lumabots

Copy link
Copy Markdown
Contributor Author

should we use use_cache_on_error, instead of only use cache ? that way we will be able to fetch first and if unavailable we will get
Open of better variable name

@Paillat-dev Paillat-dev changed the title feat: Full rework of GuildSchedule fux: GuildSchedule not being cached correctly Dec 10, 2025

@Paillat-dev Paillat-dev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If possible, make this pr not interfere with the recurrence one from anonymous. There will probably be merge conflicts once that one is merged, but they shouldn't both implement recurrence in a different way.

Comment thread discord/enums.py Outdated
Comment thread discord/enums.py Outdated
Comment thread discord/scheduled_events.py
Comment thread discord/scheduled_events.py Outdated
@Paillat-dev Paillat-dev added API reflection Discord API isn't correctly reflected hold: testing This pull request requires further testing priority: medium Medium Priority labels Dec 10, 2025
Co-authored-by: Paillat <paillat@pycord.dev>
Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com>
@Lumabots

Copy link
Copy Markdown
Contributor Author

If possible, make this pr not interfere with the recurrence one from anonymous. There will probably be merge conflicts once that one is merged, but they shouldn't both implement recurrence in a different way.

when anonymous pr will be merged i'll edit it to make it work

@Lulalaby Lulalaby changed the title fux: GuildSchedule not being cached correctly fix: GuildSchedule not being cached correctly Dec 12, 2025
@Lulalaby

Copy link
Copy Markdown
Member

fixed ur fux
image

@Paillat-dev Paillat-dev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also please use from typing_extensions import deprecated and not typing_extensions.deprecated throughout

Comment thread discord/scheduled_events.py
Comment thread discord/scheduled_events.py Outdated
Comment thread discord/scheduled_events.py Outdated
Comment thread discord/scheduled_events.py Outdated
Comment thread discord/enums.py
Comment thread discord/scheduled_events.py Outdated
Comment thread discord/guild.py Outdated
Comment thread discord/iterators.py
Comment thread discord/audit_logs.py Outdated
_enum_transformer(enums.NotificationLevel),
),
"entity_metadata": (None, _transform_entity_metadata),
"location": (None, _transform_entity_metadata),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still confused, location isn't supposed to exist as a top level property on Discord's side no ? So why even do we want to set this if it's never there in the first place ? This code is a mess so I may be wrong here but I'm confused as to why we would handle something Discord doesn't send.

Comment thread discord/audit_logs.py Outdated
@Paillat-dev Paillat-dev moved this from Done to Todo in Pycord May 23, 2026

@Paillat-dev Paillat-dev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you mmerged by mistake this pr with the component limits one

Comment thread discord/ui/core.py Outdated
@Paillat-dev Paillat-dev requested a review from a team as a code owner June 10, 2026 11:17
@Paillat-dev Paillat-dev requested a review from a team June 10, 2026 11:17
@Paillat-dev Paillat-dev modified the milestones: 2.8.1, 2.9.0rc1 Jun 10, 2026
@Paillat-dev Paillat-dev removed the hold: changelog This pull request is missing a changelog entry label Jun 10, 2026
@Paillat-dev Paillat-dev requested a review from ToothyDev June 10, 2026 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API reflection Discord API isn't correctly reflected hold: testing This pull request requires further testing priority: medium Medium Priority

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

on_scheduled_event_delete event parameter is useless

6 participants