From 036f60eade083dae51cc02a6358cf64c2170dcf5 Mon Sep 17 00:00:00 2001 From: dolfies Date: Mon, 7 Mar 2022 19:05:31 -0500 Subject: [PATCH] Provide defaults to appease type-checker --- discord/appinfo.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/discord/appinfo.py b/discord/appinfo.py index ad8d30fd8..e48e427f4 100644 --- a/discord/appinfo.py +++ b/discord/appinfo.py @@ -127,8 +127,8 @@ class ApplicationBot(User): payload['bot_require_code_grant'] = require_code_grant data = await self._state.http.edit_application(self.application.id, payload=payload) - self.public = data['bot_public'] - self.require_code_grant = data['bot_require_code_grant'] + self.public = data.get('bot_public', True) + self.require_code_grant = data.get('bot_require_code_grant', False) self.application._update(data) @@ -216,8 +216,8 @@ class PartialApplication: self.max_participants: Optional[int] = data.get('max_participants') self.premium_tier_level: Optional[int] = data.get('embedded_activity_config', {}).get('activity_premium_tier_level') - self.public: bool = data.get('integration_public', data.get('bot_public')) # The two seem to be used interchangeably? - self.require_code_grant: bool = data.get('integration_require_code_grant', data.get('bot_require_code_grant')) # Same here + self.public: bool = data.get('integration_public', data.get('bot_public', True)) # The two seem to be used interchangeably? + self.require_code_grant: bool = data.get('integration_require_code_grant', data.get('bot_require_code_grant', False)) # Same here def __repr__(self) -> str: return f'<{self.__class__.__name__} id={self.id} name={self.name!r} description={self.description!r}>'