Repository: Rapptz/discord.py

Issue:
scheduled_event.py raises KeyError when the bot start 
### Summary

If i run a bot it will be error

### Reproduction Steps

client.run(token)

### Minimal Reproducible Code

_No response_

### Expected Results

run a bot.

### Actual Results

```python
Traceback (most recent call last):
  File "/home/rocky/src/hortbot/main.py", line 103, in <module>
    bot.run(token)
  File "/home/rocky/src/hortbot/module/bot/main.py", line 43, in run
    super().run(*args, **kwargs)
  File "/home/rocky/src/hortbot/venv/lib/python3.10/site-packages/discord/client.py", line 704, in run
    return future.result()
  File "/home/rocky/src/hortbot/venv/lib/python3.10/site-packages/discord/client.py", line 683, in runner
    await self.start(*args, **kwargs)
  File "/home/rocky/src/hortbot/venv/lib/python3.10/site-packages/discord/client.py", line 647, in start
    await self.connect(reconnect=reconnect)
  File "/home/rocky/src/hortbot/venv/lib/python3.10/site-packages/discord/client.py", line 551, in connect
    await self.ws.poll_event()
  File "/home/rocky/src/hortbot/venv/lib/python3.10/site-packages/discord/gateway.py", line 626, in poll_event
    await self.received_message(msg.data)
  File "/home/rocky/src/hortbot/venv/lib/python3.10/site-packages/discord/gateway.py", line 576, in received_message
    func(data)
  File "/home/rocky/src/hortbot/venv/lib/python3.10/site-packages/discord/state.py", line 1096, in parse_guild_create
    guild = self._get_create_guild(data)
  File "/home/rocky/src/hortbot/venv/lib/python3.10/site-packages/discord/state.py", line 1060, in _get_create_guild
    guild._from_data(data)
  File "/home/rocky/src/hortbot/venv/lib/python3.10/site-packages/discord/guild.py", line 474, in _from_data
    scheduled_event = ScheduledEvent(data=s, state=state)
  File "/home/rocky/src/hortbot/venv/lib/python3.10/site-packages/discord/scheduled_event.py", line 127, in __init__
    self._update(data)
  File "/home/rocky/src/hortbot/venv/lib/python3.10/site-packages/discord/scheduled_event.py", line 139, in _update
    self._cover_image: Optional[str] = data['image']
KeyError: 'image'```

### Intents

discord.Intents.all()

### System Information

- Python v3.10.2-final
- discord.py v2.0.0-alpha
    - discord.py pkg_resources: v2.0.0a3713+g1c4dca4
- aiohttp v3.7.4.post0
- system info: Linux 4.18.0-348.12.2.el8_5.x86_64 #1 SMP Wed Jan 19 17:53:40 UTC 2022

### Checklist

- [X] I have searched the open issues for duplicates.
- [X] I have shown the entire traceback, if possible.
- [X] I have removed my token from display, if visible.

### Additional Context

_No response_


Discussion:

Resolving patch:
diff --git a/discord/scheduled_event.py b/discord/scheduled_event.py
--- a/discord/scheduled_event.py
+++ b/discord/scheduled_event.py
@@ -136,7 +136,7 @@ def _update(self, data: GuildScheduledEventPayload) -> None:
         self.start_time: datetime = parse_time(data['scheduled_start_time'])
         self.privacy_level: PrivacyLevel = try_enum(PrivacyLevel, data['status'])
         self.status: EventStatus = try_enum(EventStatus, data['status'])
-        self._cover_image: Optional[str] = data['image']
+        self._cover_image: Optional[str] = data.get('image', None)
         self.user_count: int = data.get('user_count', 0)
 
         creator = data.get('creator')
diff --git a/discord/types/scheduled_event.py b/discord/types/scheduled_event.py
--- a/discord/types/scheduled_event.py
+++ b/discord/types/scheduled_event.py
@@ -38,6 +38,7 @@ class _BaseGuildScheduledEventOptional(TypedDict, total=False):
     description: str
     creator: User
     user_count: int
+    image: Optional[str]
 
 
 class _BaseGuildScheduledEvent(_BaseGuildScheduledEventOptional):
@@ -48,7 +49,6 @@ class _BaseGuildScheduledEvent(_BaseGuildScheduledEventOptional):
     scheduled_start_time: str
     privacy_level: PrivacyLevel
     status: EventStatus
-    image: Optional[str]
 
 
 class _VoiceChannelScheduledEventOptional(_BaseGuildScheduledEvent, total=False):


Test patch: