Skip to content

Commit 49c90b9

Browse files
LumabotsCopilot
andauthored
Update discord/appinfo.py
Co-authored-by: Copilot <[email protected]> Signed-off-by: Lumouille <[email protected]>
1 parent 734b5ce commit 49c90b9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

discord/appinfo.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,10 @@ def __init__(self, state: ConnectionState, data: AppInfoPayload):
231231
self.description: str = data["description"]
232232
self._icon: str | None = data.get("icon")
233233
self.rpc_origins: list[str] | None = data.get("rpc_origins")
234-
self.bot_public: bool = data["bot_public"]
235-
self.bot_require_code_grant: bool = data["bot_require_code_grant"]
236-
self.owner: User = state.create_user(data["owner"])
234+
self.bot_public: bool = data.get("bot_public", False)
235+
self.bot_require_code_grant: bool = data.get("bot_require_code_grant", False)
236+
owner_data = data.get("owner")
237+
self.owner: User | None = state.create_user(owner_data) if owner_data is not None else None
237238

238239
team: TeamPayload | None = data.get("team")
239240
self.team: Team | None = Team(state, team) if team else None

0 commit comments

Comments
 (0)