Skip to content

Commit

Permalink
Fix sending arrays with nulls in them when changing presences
Browse files Browse the repository at this point in the history
  • Loading branch information
Rapptz committed May 16, 2021
1 parent c896563 commit 2db8c06
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions discord/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,15 +599,15 @@ async def change_presence(self, *, activity=None, status=None, afk=False, since=
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()]

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

payload = {
'op': self.PRESENCE,
'd': {
'activities': [activity],
'activities': activity,
'afk': afk,
'since': since,
'status': status
Expand Down

0 comments on commit 2db8c06

Please sign in to comment.