discord.py icon indicating copy to clipboard operation
discord.py copied to clipboard

Partial ScheduledEvent

Open Baviaan opened this issue 2 years ago • 3 comments

Summary

A Partial ScheduledEvent similar to PartialMessage so that one can call the delete() method directly without first having to fetch the event.

What is the feature request for?

The core library

The Problem

I have a guild id and event id and I want to delete the event. Currently I need an API call to fetch the event first and then delete, when it should be possible to delete the event directly.

This will also be useful for the edit method if one simply wants to update the description for example.

The Ideal Solution

Similar to PartialMessage, it would be ideal if you can construct a PartialEvent from the guild id and event id to call delete on.

The Current Solution

Currently I first issue an API call to fetch the scheduled event and then another API call to delete the event.

Additional Context

No response

Baviaan avatar Feb 25 '23 13:02 Baviaan

There's a method called Guild.get_scheduled_event.

This method doesn't make an API call: discord/guild.py#L925

codeofandrin avatar Feb 27 '23 21:02 codeofandrin

But that returns None if you don't populate the cache first by making an API call.

Baviaan avatar Mar 01 '23 23:03 Baviaan

Cache is nearly never populated via API calls, they're populated via the gateway.

Rapptz avatar Mar 01 '23 23:03 Rapptz