pub fn init(application_id: &str) -> Result<Self> {
        let mut client = new_client(application_id)?;
        client.connect()?;

        debug!("client connected");
        let timestamp =
            Timestamps::new().start(SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs() as _);

        let button = Button::new("Join Planet Comedy", "https://github.com/bltzxsd/unlustig");

        let assets = Assets::new()
            .large_image("unlustiglogo")
            .large_text("unlustig-rs");

        let activity = activity::Activity::new()
            .state("Making caption memes")
            .timestamps(timestamp)
            .assets(assets)
            .buttons(vec![button]);

        client.set_activity(activity)?;

        Ok(Self {
            inner: Box::new(client),
        })
    }
/// Creates a new Discord RPC client.
/// Sets up a rich-presence connection with
/// * State
/// * Timestamp
/// * Image
/// * Buttons
///
/// # Errors
///
/// Returns an error if the internal client fails to connect.
Creates a new Discord RPC client.
Sets up a rich-presence connection with
State
Timestamp
Image
Buttons
Creates a new Discord RPC client . Sets up a rich - presence connection with State Timestamp Image Buttons
pub fn init(application_id: &str) -> Result<Self> {
        let mut client = new_client(application_id)?;
        client.connect()?;
        debug!("client connected");
        let timestamp =
            Timestamps::new().start(SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs() as _);
        let button = Button::new("Join Planet Comedy", "https://github.com/bltzxsd/unlustig");
        let assets = Assets::new()
            .large_image("unlustiglogo")
            .large_text("unlustig-rs");
        let activity = activity::Activity::new()
            .state("Making caption memes")
            .timestamps(timestamp)
            .assets(assets)
            .buttons(vec![button]);
        client.set_activity(activity)?;
        Ok(Self {
            inner: Box::new(client),
        })
    }
pub fn init ( application_id : & str ) -> Result < Self > { let mut client = new_client ( application_id ) ? ; client . connect ( ) ? ; debug ! ( " " ) ; let timestamp = Timestamps :: new ( ) . start ( SystemTime :: now ( ) . duration_since ( UNIX_EPOCH ) ? . as_secs ( ) as _ ) ; let button = Button :: new ( " " , " " ) ; let assets = Assets :: new ( ) . large_image ( " " ) . large_text ( " " ) ; let activity = activity :: Activity :: new ( ) . state ( " " ) . timestamps ( timestamp ) . assets ( assets ) . buttons ( vec ! [ button ] ) ; client . set_activity ( activity ) ? ; Ok ( Self { inner : Box :: new ( client ) , } ) }
Creates a new Discord RPC client.
Creates a new Discord RPC client .
application_id
&str
application_id
&str
errors
Returns an error if the internal client fails to connect.
Returns an error if the internal client fails to connect .