Struct discord_sdk::activity::ActivityBuilder
source · pub struct ActivityBuilder { /* private fields */ }
Implementations§
source§impl ActivityBuilder
impl ActivityBuilder
pub fn new() -> Self
sourcepub fn state(self, state: impl Into<String>) -> Self
pub fn state(self, state: impl Into<String>) -> Self
The user’s currenty party status, eg. “Playing Solo”.
Limited to 128 bytes.
sourcepub fn details(self, details: impl Into<String>) -> Self
pub fn details(self, details: impl Into<String>) -> Self
What the player is doing, eg. “Exploring the Wilds of Outland”.
Limited to 128 bytes.
sourcepub fn start_timestamp(self, timestamp: impl IntoTimestamp) -> Self
pub fn start_timestamp(self, timestamp: impl IntoTimestamp) -> Self
Set the start timestamp for the activity. If only the start is set, Discord will display XX:XX elapsed
sourcepub fn end_timestamp(self, timestamp: impl IntoTimestamp) -> Self
pub fn end_timestamp(self, timestamp: impl IntoTimestamp) -> Self
Set the end timestamp for the activity. If only the end is set, Discord will display XX:XX left
sourcepub fn timestamps(
self,
start: Option<impl IntoTimestamp>,
end: Option<impl IntoTimestamp>
) -> Self
pub fn timestamps( self, start: Option<impl IntoTimestamp>, end: Option<impl IntoTimestamp> ) -> Self
The start and end of a “game” or “session”.
sourcepub fn assets(self, assets: Assets) -> Self
pub fn assets(self, assets: Assets) -> Self
The image assets to use for the rich presence profile
sourcepub fn party(
self,
id: impl Into<String>,
current_size: Option<NonZeroU32>,
max_size: Option<NonZeroU32>,
privacy: PartyPrivacy
) -> Self
pub fn party( self, id: impl Into<String>, current_size: Option<NonZeroU32>, max_size: Option<NonZeroU32>, privacy: PartyPrivacy ) -> Self
Sets party details such as size and whether it can be joined by others.
Note that the party size will only be set if both size and max are provided, and that the party id is limited to 128 bytes.
sourcepub fn instance(self, is_instance: bool) -> Self
pub fn instance(self, is_instance: bool) -> Self
Whether this activity is an instanced context, like a match
Adds up to two buttons with a label and a link other users can click on
Overwrites any secrets already set in the activity.