Since documentation does not yet exist a template program is added showcasing the intended usage of this library. A configuration interface will be added in a future commit.
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
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>
Discord client being absent/disconnecting is not fatal to the RPC sender, in cases like that we return ErrAgain and in the case of broken pipe (Discord client going away) also reset the Client state so the caller can choose to retry the operation and therefore initiate a new connection attempt.
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
Since some of the state of the connection is tracked by the Client struct and the Raw method is sufficient for any low-level interaction with the Discord RPC, users of the API should not and does not have any reason to interact with the underlying connection.
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
Activity data types come from Discord documentation examples as the documented field optionality is inaccurate.
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
Add a few internal validation functions to make validation cleaner, activation function is called as needed so explicit client activation is not required.
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
Path discovery is ported directly from Discord's C++ example, Windows has a crazy looking socket path that needs special syscall magic to dial, so we'll put that off for the time being.
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
Add github.com/google/uuid as a dependency as well since it will be required for nonce generation. Exclude files based on template from GitHub.
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>