pub struct ChatbotMessage {Show 24 fields
pub is_in_at_list: Option<bool>,
pub session_webhook: Option<String>,
pub sender_nick: Option<String>,
pub robot_code: Option<String>,
pub session_webhook_expired_time: Option<i64>,
pub message_id: Option<String>,
pub sender_id: Option<String>,
pub chatbot_user_id: Option<String>,
pub conversation_id: Option<String>,
pub is_admin: Option<bool>,
pub create_at: Option<i64>,
pub conversation_type: Option<String>,
pub at_users: Option<Vec<AtUser>>,
pub chatbot_corp_id: Option<String>,
pub sender_corp_id: Option<String>,
pub conversation_title: Option<String>,
pub message_type: Option<String>,
pub text: Option<TextContent>,
pub sender_staff_id: Option<String>,
pub hosting_context: Option<HostingContext>,
pub conversation_msg_context: Option<Vec<ConversationMessage>>,
pub image_content: Option<ImageContent>,
pub rich_text_content: Option<RichTextContent>,
pub extensions: HashMap<String, Value>,
}Expand description
聊天机器人消息
Fields§
§is_in_at_list: Option<bool>是否在 @列表中
session_webhook: Option<String>Session Webhook URL
sender_nick: Option<String>发送者昵称
robot_code: Option<String>机器人代码
session_webhook_expired_time: Option<i64>Session Webhook 过期时间
message_id: Option<String>消息 ID
sender_id: Option<String>发送者 ID
chatbot_user_id: Option<String>机器人用户 ID
conversation_id: Option<String>会话 ID
is_admin: Option<bool>是否管理员
create_at: Option<i64>创建时间
conversation_type: Option<String>会话类型: “1”=单聊, “2”=群聊
at_users: Option<Vec<AtUser>>@的用户列表
chatbot_corp_id: Option<String>机器人所属企业 ID
sender_corp_id: Option<String>发送者所属企业 ID
conversation_title: Option<String>会话标题
message_type: Option<String>消息类型: text, picture, richText
text: Option<TextContent>文本内容
sender_staff_id: Option<String>发送者员工 ID
hosting_context: Option<HostingContext>托管上下文
conversation_msg_context: Option<Vec<ConversationMessage>>会话消息上下文
image_content: Option<ImageContent>图片内容(从 content 字段解析,msgtype=picture 时)
rich_text_content: Option<RichTextContent>富文本内容(从 content 字段解析,msgtype=richText 时)
extensions: HashMap<String, Value>扩展字段
Implementations§
Source§impl ChatbotMessage
impl ChatbotMessage
Sourcepub const DELEGATE_TOPIC: &'static str = "/v1.0/im/bot/messages/delegate"
pub const DELEGATE_TOPIC: &'static str = "/v1.0/im/bot/messages/delegate"
机器人消息委托主题
Sourcepub fn from_value(value: &Value) -> Result<Self>
pub fn from_value(value: &Value) -> Result<Self>
从 JSON Value 构造(处理 content 字段的特殊解析逻辑)
Sourcepub fn get_text_list(&self) -> Option<Vec<String>>
pub fn get_text_list(&self) -> Option<Vec<String>>
获取文本列表
Sourcepub fn get_image_list(&self) -> Option<Vec<String>>
pub fn get_image_list(&self) -> Option<Vec<String>>
获取图片下载码列表
Trait Implementations§
Source§impl Clone for ChatbotMessage
impl Clone for ChatbotMessage
Source§fn clone(&self) -> ChatbotMessage
fn clone(&self) -> ChatbotMessage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ChatbotMessage
impl Debug for ChatbotMessage
Source§impl Default for ChatbotMessage
impl Default for ChatbotMessage
Source§fn default() -> ChatbotMessage
fn default() -> ChatbotMessage
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ChatbotMessage
impl<'de> Deserialize<'de> for ChatbotMessage
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ChatbotMessage
impl Display for ChatbotMessage
Auto Trait Implementations§
impl Freeze for ChatbotMessage
impl RefUnwindSafe for ChatbotMessage
impl Send for ChatbotMessage
impl Sync for ChatbotMessage
impl Unpin for ChatbotMessage
impl UnsafeUnpin for ChatbotMessage
impl UnwindSafe for ChatbotMessage
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.