From cdf46127ae2e1a183e5c94d9eb970bbccbed64af Mon Sep 17 00:00:00 2001 From: Stocker <44980366+StockerMC@users.noreply.github.com> Date: Mon, 23 Aug 2021 05:22:36 -0400 Subject: [PATCH] Added type: ignores where needed to activity.py --- discord/activity.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/discord/activity.py b/discord/activity.py index 3f89c4779..512053777 100644 --- a/discord/activity.py +++ b/discord/activity.py @@ -830,10 +830,12 @@ def create_activity(data: Optional[ActivityPayload]) -> Optional[ActivityTypes]: except KeyError: return Activity(**data) else: - return CustomActivity(name=name, **data) + # we removed the name key from data already + return CustomActivity(name=name, **data) # type: ignore elif game_type is ActivityType.streaming: if 'url' in data: - return Streaming(**data) + # the url won't be None here + return Streaming(**data) # type: ignore return Activity(**data) elif game_type is ActivityType.listening and 'sync_id' in data and 'session_id' in data: return Spotify(**data)