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 81b259a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions discord/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,15 +599,17 @@ 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()]
else:
activity = []

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 81b259a

Please sign in to comment.