aboutsummaryrefslogtreecommitdiff
path: root/discord/integrations.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2021-05-29 00:54:31 -0400
committerRapptz <[email protected]>2021-05-29 00:54:31 -0400
commit1ae40a11b7ee1f5cc130e2143c2982203d5c1867 (patch)
tree9ac2ec644425e8b6664c0db6c32eb4af11672eca /discord/integrations.py
parentMake StreamIntegration.role a property rather than a strong reference (diff)
downloaddiscord.py-1ae40a11b7ee1f5cc130e2143c2982203d5c1867.tar.xz
discord.py-1ae40a11b7ee1f5cc130e2143c2982203d5c1867.zip
Fix some type errors in StreamIntegration.edit
Diffstat (limited to 'discord/integrations.py')
-rw-r--r--discord/integrations.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/discord/integrations.py b/discord/integrations.py
index 13e5db3e..1a7126c5 100644
--- a/discord/integrations.py
+++ b/discord/integrations.py
@@ -175,7 +175,7 @@ class StreamIntegration(Integration):
An aware UTC datetime representing when the integration was last synced.
"""
- __slots__ = Integration.__slots__ + (
+ __slots__ = (
'revoked',
'expire_behaviour',
'expire_behavior',
@@ -184,7 +184,7 @@ class StreamIntegration(Integration):
'_role_id',
'syncing',
'enable_emoticons',
- 'subscriber_count'
+ 'subscriber_count',
)
def _from_data(self, data: IntegrationPayload) -> None:
@@ -258,9 +258,11 @@ class StreamIntegration(Integration):
'expire_grace_period': expire_grace_period,
}
- enable_emoticons = fields.get('enable_emoticons')
-
- if enable_emoticons is not None:
+ try:
+ enable_emoticons = fields['enable_emoticons']
+ except KeyError:
+ enable_emoticons = self.enable_emoticons
+ else:
payload['enable_emoticons'] = enable_emoticons
await self._state.http.edit_integration(self.guild.id, self.id, **payload)