mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-20 16:00:29 +00:00
Fix sending arrays with nulls in them when changing presences
This commit is contained in:
parent
c896563af4
commit
81b259ab36
@ -599,7 +599,9 @@ class DiscordWebSocket:
|
||||
if activity is not None:
|
||||
if not isinstance(activity, BaseActivity):
|
||||
raise InvalidArgument('activity must derive from BaseActivity.')
|
||||
activity = activity.to_dict()
|
||||
activity = [activity.to_dict()]
|
||||
else:
|
||||
activity = []
|
||||
|
||||
if status == 'idle':
|
||||
since = int(time.time() * 1000)
|
||||
@ -607,7 +609,7 @@ class DiscordWebSocket:
|
||||
payload = {
|
||||
'op': self.PRESENCE,
|
||||
'd': {
|
||||
'activities': [activity],
|
||||
'activities': activity,
|
||||
'afk': afk,
|
||||
'since': since,
|
||||
'status': status
|
||||
|
Loading…
x
Reference in New Issue
Block a user