library: rpc: return nonce in SetActivity function

There's currently no way to obtain that value, so it is returned here to help with tinkering with the RPC server in the Discord client.

Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
This commit is contained in:
Ophestra 2024-06-20 20:24:13 +09:00
parent b3325f56b1
commit 802ad250ca
Signed by: cat
SSH Key Fingerprint: SHA256:gQ67O0enBZ7UdZypgtspB2FDM1g3GVw8nX0XSdcFw8Q

View File

@ -62,9 +62,9 @@ type activityArgs struct {
Activity *Activity `json:"activity"`
}
func (d *Client) SetActivity(act *Activity) error {
func (d *Client) SetActivity(act *Activity) (string, error) {
if err := d.activate(); err != nil {
return err
return "", err
}
nonce := uuid.New().String()
@ -80,5 +80,5 @@ func (d *Client) SetActivity(act *Activity) error {
Nonce: nonce,
},
})
return err
return nonce, err
}