mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 20:28:38 +00:00
Added type: ignores where needed to activity.py
This commit is contained in:
parent
851dfc3c75
commit
cdf46127ae
@ -830,10 +830,12 @@ def create_activity(data: Optional[ActivityPayload]) -> Optional[ActivityTypes]:
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
return Activity(**data)
|
return Activity(**data)
|
||||||
else:
|
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:
|
elif game_type is ActivityType.streaming:
|
||||||
if 'url' in data:
|
if 'url' in data:
|
||||||
return Streaming(**data)
|
# the url won't be None here
|
||||||
|
return Streaming(**data) # type: ignore
|
||||||
return Activity(**data)
|
return Activity(**data)
|
||||||
elif game_type is ActivityType.listening and 'sync_id' in data and 'session_id' in data:
|
elif game_type is ActivityType.listening and 'sync_id' in data and 'session_id' in data:
|
||||||
return Spotify(**data)
|
return Spotify(**data)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user