Skip to content
This repository was archived by the owner on Aug 28, 2019. It is now read-only.

Commit 81b259a

Browse files
committed
Fix sending arrays with nulls in them when changing presences
1 parent c896563 commit 81b259a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

discord/gateway.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -599,15 +599,17 @@ async def change_presence(self, *, activity=None, status=None, afk=False, since=
599599
if activity is not None:
600600
if not isinstance(activity, BaseActivity):
601601
raise InvalidArgument('activity must derive from BaseActivity.')
602-
activity = activity.to_dict()
602+
activity = [activity.to_dict()]
603+
else:
604+
activity = []
603605

604606
if status == 'idle':
605607
since = int(time.time() * 1000)
606608

607609
payload = {
608610
'op': self.PRESENCE,
609611
'd': {
610-
'activities': [activity],
612+
'activities': activity,
611613
'afk': afk,
612614
'since': since,
613615
'status': status

0 commit comments

Comments
 (0)