Skip to content

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

Open
Lumabots wants to merge 60 commits into
masterfrom
on_scheduled_event_delete
Open

Lumabots wants to merge 60 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
I have read the Contributing Guidelines

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.
  • I have read the Contributing Guidelines.

@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 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
@Lulalaby

Copy link
Copy Markdown
Member

merge conflicts, please resolve

@Paillat-dev

Copy link
Copy Markdown
Member

@Lumabots If you have a moment to fix merge commits

Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com>
@Lumabots
Lumabots requested a review from a team as a code owner September 15, 2026 17:54
@github-actions github-actions Bot added the invalid This doesn't seem right label Sep 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This pull request does not follow the required pull request template.

Please use the default template (PULL_REQUEST_TEMPLATE.md) and fill out all required sections.

Problems detected:

The line "I have read the [Contributing Guidelines](https://github.com/Pycord-Development/pycord/blob/master/CONTRIBUTING.md)" is missing.

@github-actions github-actions Bot closed this Sep 15, 2026
@Lumabots

Copy link
Copy Markdown
Contributor Author

i added that line mb

@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.

Some nitpicks, other than that seems good. I remember testing awhile ago. However I think it would be beneficial to have someone else review as well

Comment thread CHANGELOG.md Outdated
Comment thread discord/guild.py
) = MISSING,
entity_type: ScheduledEventEntityType = MISSING,
entity_metadata: ScheduledEventEntityMetadata | None = MISSING,
channel_id: int | VoiceChannel | StageChannel = MISSING,

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 it would be better to accept VoiceChannel | StageChannel | Object and then access .id, and rename the param to channel

return utils.snowflake_time(self.id)

@property
@typing_extensions.deprecated(

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 another comment of mine asked to import from typing extensions directly and not like this

Comment on lines +565 to +568
if (
entity_type is not MISSING
and entity_type == ScheduledEventEntityType.external
):

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.

This validation only runs when entity_type is explicitly passed. I can think of an edge case when someone edits entity_metadata on an already EXTERNAL event without repassing entity_type, an it won't get validated.

Comment on lines +269 to +274
self.scheduled_start_time: datetime.datetime = datetime.datetime.fromisoformat(
data.get("scheduled_start_time")
)
if end_time := data.get("scheduled_end_time", None):
end_time = utils.parse_time(end_time)
self.end_time: datetime.datetime | None = end_time
if scheduled_end_time := data.get("scheduled_end_time", None):
scheduled_end_time = datetime.datetime.fromisoformat(scheduled_end_time)
self.scheduled_end_time: datetime.datetime | None = scheduled_end_time

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.

datetime.fromisoformat got full ISO 8601 parsing in 3.11 and since minimum supported version is 3.10 this will raise ValueError if, for instance, it ever gets a z-suffixed timestamp.

Co-authored-by: Paillat <paillat@pycord.dev>
Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com>
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 priority: medium Medium Priority

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

on_scheduled_event_delete event parameter is useless

6 participants