Crate discord_ipc_rp

Crate discord_ipc_rp 

Source
Expand description

This library provides easy access to the Discord IPC.

It provides implementations for both Unix and Windows operating systems, with both implementations using the same API. Thus, this crate can be used in a platform-agnostic manner.

§Hello world

use discord_ipc::{activity, DiscordIpc, DiscordIpcClient};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mut client = DiscordIpcClient::new("<some client id>");
    client.connect()?;

    let payload = activity::Activity::new().state("Hello world!");
    client.set_activity(payload)?;
}

Modules§

activity
Provides an interface for building activities to send to Discord via DiscordIpc::set_activity.

Structs§

DiscordIPCCommandIncoming
This defines a message coming from Discord into your app.
DiscordIPCCommandOutgoing
This defines a message sent from your app to Discord.
DiscordIPCError
The error response from Discord.
DiscordIpcClient
A wrapper struct for the functionality contained in the underlying DiscordIpc trait.
HandshakeData
The handshake data sent to Discord. for connection.

Enums§

ActivityCmd
This defines a message coming from Discord into your app.
ActivityEvent
All of the valid events for the IPC.
DiscordIPCErrorCode
All of the possible errors from Discord.
DiscordIPCErrorCodeCritical
All of the possible errors from Discord (critical).
DiscordIPCErrorCodeNonCritical
All of the possible errors from Discord (non-critical).
DiscordIPCPayload
This defines all of the messages you can send to Discord from your app.
DiscordIPCResponse
The response from Discord.
Error
The error type for this crate.

Traits§

DiscordIpc
A client that connects to and communicates with the Discord IPC.

Functions§

new_clientDeprecated
Creates a new client to connect to the Discord IPC. Functionally identical to DiscordIpcClient::new().

Type Aliases§

Result
The result type for this crate.