Enum miraie::messages::MessageBlock[][src]

pub enum MessageBlock {
    Source {
        id: i64,
        time: DateTime<Utc>,
    },
    Quote {
        id: i64,
        group_id: QQ,
        sender_id: QQ,
        target_id: QQ,
        origin: MessageChain,
    },
    At {
        target: QQ,
        display: String,
    },
    AtAll,
    Face {
        face_id: i32,
        name: String,
    },
    Text {
        text: String,
    },
    Image {
        image_id: String,
        url: String,
        base64: Option<String>,
    },
    FlushImage {
        image_id: String,
        url: String,
        base64: Option<String>,
    },
    Voice {
        voice_id: Option<String>,
        url: Option<String>,
        base64: Option<String>,
    },
    Xml {
        xml: String,
    },
    File {
        id: String,
        name: String,
        size: usize,
    },
}
Expand description

Variants

Source

Source类型永远为chain的第一个元素

Show fields

Fields of Source

id: i64

消息的识别号,用于引用回复

time: DateTime<Utc>
Quote

引用回复

Show fields

Fields of Quote

id: i64

原消息的messageId

group_id: QQ

原消息所接收的群号,当为好友消息时为0

sender_id: QQ

原消息的发送者的QQ号

target_id: QQ

原消息的接收者者的QQ号(或群号)

origin: MessageChain

原消息的消息链对象

At

@ 人

Show fields

Fields of At

target: QQ

群员QQ号

display: String
AtAll

@全体成员

Face

QQ表情

Show fields

Fields of Face

face_id: i32

QQ表情编号,可选,优先高于name

name: String

QQ表情拼音,可选

Text

文字消息

Show fields

Fields of Text

text: String
Image

图片消息

三个参数任选其一,出现多个参数时,按照imageId > url > path > base64的优先级

Show fields

Fields of Image

image_id: String

图片的imageId,群图片与好友图片格式不同。不为空时将忽略url属性 群图片格式 “{01E9451B-70ED-EAE3-B37C-101F1EEBF5B5}.mirai” 好友图片格式 “/f8f1ab55-bf8e-4236-b55e-955848d7069f”

url: String

图片的URL,发送时可作网络图片的链接;接收时为腾讯图片服务器的链接,可用于图片下载

base64: Option<String>

图片的 Base64 编码

FlushImage

闪照

三个参数任选其一,出现多个参数时,按照imageId > url > path > base64的优先级

Show fields

Fields of FlushImage

image_id: String

图片的imageId,群图片与好友图片格式不同。不为空时将忽略url属性 群图片格式 “{01E9451B-70ED-EAE3-B37C-101F1EEBF5B5}.mirai” 好友图片格式 “/f8f1ab55-bf8e-4236-b55e-955848d7069f”

url: String

图片的URL,发送时可作网络图片的链接;接收时为腾讯图片服务器的链接,可用于图片下载

base64: Option<String>

图片的 Base64 编码

Voice

音频消息

三个参数任选其一,出现多个参数时,按照voiceId > url > path > base64的优先级

Show fields

Fields of Voice

voice_id: Option<String>

语音的voiceId,不为空时将忽略url属性

url: Option<String>

语音的URL,发送时可作网络语音的链接;接收时为腾讯语音服务器的链接,可用于语音下载

base64: Option<String>

语音的 Base64 编码

Xml

XML

Show fields

Fields of Xml

xml: String
File

文件消息

Show fields

Fields of File

id: String

文件识别id

name: String

文件名

size: usize

文件大小

Implementations

图片的路径,发送本地图片,相对路径于 env:MIRAIE_RESOURCE_ROOT/images

语音的路径,发送本地语音,相对路径于 env:MIRAIE_RESOURCE_ROOT/voices

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

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.