Handle role_id possibly being None for StreamIntegration

This commit is contained in:
Harmon 2021-06-27 22:46:14 -05:00 committed by GitHub
parent 233d10649c
commit 1a3422dccc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -196,7 +196,7 @@ class StreamIntegration(Integration):
self.expire_behaviour: ExpireBehaviour = try_enum(ExpireBehaviour, data['expire_behavior'])
self.expire_grace_period: int = data['expire_grace_period']
self.synced_at: datetime.datetime = parse_time(data['synced_at'])
self._role_id: int = int(data['role_id'])
self._role_id: Optional[int] = _get_as_snowflake(data, 'role_id')
self.syncing: bool = data['syncing']
self.enable_emoticons: bool = data['enable_emoticons']
self.subscriber_count: int = data['subscriber_count']

View File

@ -69,7 +69,7 @@ class BaseIntegration(PartialIntegration):
class StreamIntegration(BaseIntegration):
role_id: Snowflake
role_id: Optional[Snowflake]
enable_emoticons: bool
subscriber_count: int
revoked: bool