[][src]Struct twitchchat::messages::UserNotice

pub struct UserNotice<'t> {
    pub tags: Tags<'t>,
    pub channel: Cow<'t, str>,
    pub message: Option<Cow<'t, str>>,
}

Announces Twitch-specific events to the channel (e.g., a user's subscription notification).

Fields

tags: Tags<'t>

Tags attached to this message

channel: Cow<'t, str>

Channel this event is happening on

message: Option<Cow<'t, str>>

Optional message attached to the event

Implementations

impl<'t> UserNotice<'t>[src]

pub fn badge_info(&'t self) -> Vec<BadgeInfo<'t>>[src]

Metadata related to the chat badges

Currently used only for subscriber, to indicate the exact number of months the user has been a subscriber

pub fn badges(&'t self) -> Vec<Badge<'t>>[src]

Badges attached to this message

pub fn color(&self) -> Option<Color>[src]

The user's color, if set

pub fn display_name(&'t self) -> Option<Cow<'t, str>>[src]

The user's display name, if set

pub fn emotes(&self) -> Vec<Emotes>[src]

Emotes attached to this message

pub fn id(&'t self) -> Option<Cow<'t, str>>[src]

A unique id (UUID) attached to this message

(this is used for localization)

pub fn login(&'t self) -> Option<Cow<'t, str>>[src]

The name of the user who sent this notice

pub fn is_moderator(&self) -> bool[src]

Whether this user is a moderator

pub fn msg_id(&'t self) -> Option<NoticeType<'t>>[src]

The kind of notice this message is

pub fn room_id(&self) -> Option<u64>[src]

The id of the room for this notice

pub fn tmi_sent_ts(&self) -> Option<u64>[src]

THe timestamp which twitch received this message

pub fn user_id(&self) -> Option<u64>[src]

User id of the user who sent this notice

pub fn system_msg(&self) -> Option<String>[src]

The message printed in chat along with this notice

pub fn msg_param_cumulative_months(&self) -> Option<u64>[src]

(Sent only on sub, resub) The total number of months the user has subscribed. This is the same as msg-param-months but sent for different types of user notices.

pub fn msg_param_display_name(&'t self) -> Option<Cow<'t, str>>[src]

(Sent only on raid) The display name of the source user raiding this channel.

pub fn msg_param_login(&'t self) -> Option<Cow<'t, str>>[src]

(Sent on only raid) The name of the source user raiding this channel.

pub fn msg_param_months(&self) -> Option<u64>[src]

(Sent only on subgift, anonsubgift) The total number of months the user has subscribed. This is the same as msg-param-cumulative-months but sent for different types of user notices.

pub fn msg_param_promo_gift_total(&self) -> Option<u64>[src]

(Sent only on anongiftpaidupgrade, giftpaidupgrade) The number of gifts the gifter has given during the promo indicated by msg-param-promo-name.

pub fn msg_param_promo_name(&'t self) -> Option<Cow<'t, str>>[src]

(Sent only on anongiftpaidupgrade, giftpaidupgrade) The subscriptions promo, if any, that is ongoing; e.g. Subtember 2018.

pub fn msg_param_recipient_display_name(&'t self) -> Option<Cow<'t, str>>[src]

(Sent only on subgift, anonsubgift) The display name of the subscription gift recipient.

pub fn msg_param_recipient_id(&self) -> Option<u64>[src]

(Sent only on subgift, anonsubgift) The user ID of the subscription gift recipient.

pub fn msg_param_recipient_user_name(&'t self) -> Option<Cow<'t, str>>[src]

(Sent only on subgift, anonsubgift) The user name of the subscription gift recipient.

pub fn msg_param_sender_login(&'t self) -> Option<Cow<'t, str>>[src]

(Sent only on giftpaidupgrade) The login of the user who gifted the subscription.

pub fn msg_param_sender_name(&'t self) -> Option<Cow<'t, str>>[src]

(Sent only on giftpaidupgrade) The display name of the user who gifted the subscription.

pub fn msg_param_should_share_streak(&self) -> Option<bool>[src]

(Sent only on sub, resub) Boolean indicating whether users want their streaks to be shared.

pub fn msg_param_streak_months(&self) -> Option<u64>[src]

(Sent only on sub, resub) The number of consecutive months the user has subscribed. This is 0 if msg-param-should-share-streak is 0.

pub fn msg_param_sub_plan(&self) -> Option<SubPlan>[src]

(Sent only on sub, resub, subgift, anonsubgift) The type of subscription plan being used. Valid values: Prime, 1000, 2000, 3000. 1000, 2000, and 3000 refer to the first, second, and third levels of paid subscriptions, respectively (currently $4.99, $9.99, and $24.99).

pub fn msg_param_sub_plan_name(&'t self) -> Option<Cow<'t, str>>[src]

(Sent only on sub, resub, subgift, anonsubgift) The display name of the subscription plan. This may be a default name or one created by the channel owner.

pub fn msg_param_viewer_count(&self) -> Option<u64>[src]

(Sent only on raid) The number of viewers watching the source channel raiding this channel.

pub fn msg_param_ritual_name(&'t self) -> Option<Cow<'t, str>>[src]

(Sent only on ritual) The name of the ritual this notice is for. Valid value: new_chatter.

pub fn msg_param_threshold(&self) -> Option<u64>[src]

(Sent only on bitsbadgetier) The tier of the bits badge the user just earned; e.g. 100, 1000, 10000.

Trait Implementations

impl<'t> AsOwned for UserNotice<'t>[src]

type Owned = UserNotice<'static>

The owned type

impl<'t> Clone for UserNotice<'t>[src]

impl<'t> Debug for UserNotice<'t>[src]

impl<'de, 't> Deserialize<'de> for UserNotice<'t>[src]

impl<'t> From<UserNotice<'t>> for AllCommands<'t>[src]

impl<'a: 't, 't> Parse<&'a Message<'t>> for UserNotice<'t>[src]

impl<'t> PartialEq<UserNotice<'t>> for UserNotice<'t>[src]

impl<'t> Serialize for UserNotice<'t>[src]

impl<'t> StructuralPartialEq for UserNotice<'t>[src]

Auto Trait Implementations

impl<'t> RefUnwindSafe for UserNotice<'t>

impl<'t> Send for UserNotice<'t>

impl<'t> Sync for UserNotice<'t>

impl<'t> Unpin for UserNotice<'t>

impl<'t> UnwindSafe for UserNotice<'t>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.