pub struct Activity(/* private fields */);Expand description
What the bot is doing: build one with Activity::playing, Activity::listening, …
Implementations§
Source§impl Activity
impl Activity
Sourcepub fn streaming(name: impl Into<String>, url: impl Into<String>) -> Self
pub fn streaming(name: impl Into<String>, url: impl Into<String>) -> Self
“Streaming {name}”, with an https:// link members may open (after confirming).
Sourcepub fn custom(text: impl Into<String>) -> Self
pub fn custom(text: impl Into<String>) -> Self
Free text, with an optional emoji (Activity::emoji).
Sourcepub fn details(self, details: impl Into<String>) -> Self
pub fn details(self, details: impl Into<String>) -> Self
A second line, e.g. the track (≤ 128 characters).
Sourcepub fn state(self, state: impl Into<String>) -> Self
pub fn state(self, state: impl Into<String>) -> Self
A third line, e.g. the artist (≤ 128 characters).
Sourcepub fn started_at(self, ms: u64) -> Self
pub fn started_at(self, ms: u64) -> Self
When it started, ms since the epoch (clients show the elapsed time).
Sourcepub fn emoji(self, emoji: impl Into<String>) -> Self
pub fn emoji(self, emoji: impl Into<String>) -> Self
A Unicode emoji, for Activity::custom only.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Activity
impl RefUnwindSafe for Activity
impl Send for Activity
impl Sync for Activity
impl Unpin for Activity
impl UnsafeUnpin for Activity
impl UnwindSafe for Activity
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more