Skip to content

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
JustaSqu1d authored Jan 5, 2023
2 parents dbe5da3 + b991975 commit 6235720
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ These changes are available on the `master` branch, but have not yet been releas
- Added new AutoMod trigger metadata properties `regex_patterns`, `allow_list`, and
`mention_total_limit`; and added the `mention_spam` trigger type.
([#1809](https://github.com/Pycord-Development/pycord/pull/1809))
- Added missing `image` parameter to `Guild.create_scheduled_event()` method.
([#1831](https://github.com/Pycord-Development/pycord/pull/1831))
- Added new message types, `interaction_premium_upsell`, `stage_start`, `stage_end`,
`stage_speaker`, `stage_raise_hand`, `stage_topic`, and
`guild_application_premium_subscription`.
Expand Down
6 changes: 6 additions & 0 deletions discord/guild.py
Original file line number Diff line number Diff line change
Expand Up @@ -3647,6 +3647,7 @@ async def create_scheduled_event(
location: str | int | VoiceChannel | StageChannel | ScheduledEventLocation,
privacy_level: ScheduledEventPrivacyLevel = ScheduledEventPrivacyLevel.guild_only,
reason: str | None = None,
image: bytes = MISSING,
) -> ScheduledEvent | None:
"""|coro|
Creates a scheduled event.
Expand All @@ -3669,6 +3670,8 @@ async def create_scheduled_event(
so there is no need to change this parameter.
reason: Optional[:class:`str`]
The reason to show in the audit log.
image: Optional[:class:`bytes`]
The cover image of the scheduled event
Returns
-------
Expand Down Expand Up @@ -3706,6 +3709,9 @@ async def create_scheduled_event(
if end_time is not MISSING:
payload["scheduled_end_time"] = end_time.isoformat()

if image is not MISSING:
payload["image"] = utils._bytes_to_base64_data(image)

data = await self._state.http.create_scheduled_event(
guild_id=self.id, reason=reason, **payload
)
Expand Down
1 change: 1 addition & 0 deletions discord/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -2231,6 +2231,7 @@ def create_scheduled_event(
"description",
"entity_type",
"entity_metadata",
"image",
)
payload = {k: v for k, v in payload.items() if k in valid_keys}

Expand Down

0 comments on commit 6235720

Please sign in to comment.