Crate bevy_discord_presence
source ·Expand description
A Bevy plugin that allows the developer to interact with the Discord Presence API with ease
This plugin is a Bevy wrapper around the Discord Presence crate which in turn is a wrapper around the Discord Presence API.
Examples
use bevy::prelude::*;
use bevy_discord_presence::{ActivityState, RPCConfig, RPCPlugin};
fn main() {
println!("hello world!");
let mut app = App::new();
app.add_plugins(DefaultPlugins);
app.add_plugin(RPCPlugin {
config: RPCConfig {
app_id: 425407036495495169,
show_time: true,
}
});
app.add_system(update_presence);
app.run();
}
fn update_presence(mut state: ResMut<ActivityState>) {
state.details = Some("Hello World".to_string());
}
Structs
- The state that holds the Discord activity
- A wrapper around the internal
discord_presence::Client
struct that implements [bevy::prelude::Resource
] - Configuration for the RPC plugin
- The main RPC plugin