Skip to content

Struct presence::Activity

zaun_bot::presence::Activity · Struct

pub struct Activity(…)

What the bot is doing: build one with Activity::playing, Activity::listening, …

pub fn playing<impl Into<String>>(name: impl Into<String>) -> Self

“Playing {name}”.

pub fn streaming<impl Into<String>, impl Into<String>>(name: impl Into<String>, url: impl Into<String>) -> Self

“Streaming {name}”, with an https:// link members may open (after confirming).

pub fn listening<impl Into<String>>(name: impl Into<String>) -> Self

“Listening to {name}”.

pub fn watching<impl Into<String>>(name: impl Into<String>) -> Self

“Watching {name}”.

pub fn competing<impl Into<String>>(name: impl Into<String>) -> Self

“Competing in {name}”.

pub fn custom<impl Into<String>>(text: impl Into<String>) -> Self

Free text, with an optional emoji (Activity::emoji).

pub fn details<impl Into<String>>(self, details: impl Into<String>) -> Self

A second line, e.g. the track (≤ 128 characters).

pub fn state<impl Into<String>>(self, state: impl Into<String>) -> Self

A third line, e.g. the artist (≤ 128 characters).

pub fn started_at(self, ms: u64) -> Self

When it started, ms since the epoch (clients show the elapsed time).

pub fn emoji<impl Into<String>>(self, emoji: impl Into<String>) -> Self

A Unicode emoji, for Activity::custom only.

Clone, Debug

Full rustdoc page