setPresence method

void setPresence({
  1. ClientActivity? activity,
  2. ClientStatus? status,
  3. bool? afk,
})

Defines the presence that this should adopt

Example :

client.setPresence(
  activity: ClientActivity(name: 'My activity', type: GamePresence.listening),
  status: ClientStatus.doNotDisturb
);

Implementation

void setPresence ({ ClientActivity? activity, ClientStatus? status, bool? afk }) {
  _shards.send(OpCode.statusUpdate, {
    'since': DateTime.now().millisecond,
    'activities': activity != null ? [activity.toJson()] : [],
    'status': status != null ? status.toString() : ClientStatus.online.toString(),
    'afk': afk ?? false,
  });
}