pub struct ChatMessage {
Show 13 fields pub type_: ChatMessageType, pub content: String, pub nick_name: String, pub avatar: Option<String>, pub sub_lv: Option<String>, pub medals: Vec<String>, pub decos: Vec<String>, pub roles: Vec<String>, pub message_id: String, pub sender_id: Option<i64>, pub send_time: DateTime<Utc>, pub content_data: HashMap<String, Value>, pub custom_role: Option<String>,
}
Expand description

A single chat message

Fields

type_: ChatMessageType

Type of chat message.

content: String

Content of the message. Now gift message add new fields, including gift_id, gift_value(unit price of a gift) and value_type(currency type, like Elixir, Mana and so on).

nick_name: String

Display name of the sender.

avatar: Option<String>

URL of the sender’s profile picture.

sub_lv: Option<String>

The subscription level of the user in the channel. “sub_L1” for tier 1 subscriber.

medals: Vec<String>

The list of badge names of the sender.

decos: Vec<String>

The list of decoration names of sender.

roles: Vec<String>

The list of roles of the message sender. One user can have multiple roles, for example: “roles”:[“mod”, “follower”]

message_id: String

ID of the message.

sender_id: Option<i64>

User ID of the sender. Maybe be None for Event message types, possibly others

send_time: DateTime<Utc>

Time that the message was sent

content_data: HashMap<String, Value>

Extra info of chat

custom_role: Option<String>

The list of role of the message sender which is a json string. Different from “roles”, “custom_role” contains more information. However, if you just need the role names, use “roles” instead.

Trait Implementations

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more