Implement SET_ACTIVITY logic via RPCServer
mainWhen a client sends the SET_ACTIVITY command, the RPCServer processes the activity payload and emits an activity event. This is used to bridge custom application states to a Discord-like interface.
Supported Activity Fields:
buttons: An array of objects{ url, label }. These are mapped tometadata.button_urlsandextra.buttons.timestamps: Objects containing start/end times. If provided as seconds, they are automatically converted to milliseconds.instance: A boolean. Iftrue, sets theflagsbitmask to1(indicating an instance).pid: The process ID associated with the activity.
Clearing Activity:
To clear the activity, send a SET_ACTIVITY command with a null activity argument. This will trigger an activity event with activity: null.