mirror of
http://shenjack.top:5100/shenjack/icalingua-python-bot.git
synced 2024-11-23 04:31:05 +08:00
p4?
This commit is contained in:
parent
d9c17ea064
commit
1e81db998f
|
@ -188,9 +188,9 @@ class TailchatReciveMessage:
|
|||
@property
|
||||
def sender_id(self) -> TailchatType.UserId:
|
||||
...
|
||||
# @property
|
||||
# def is_from_self(self) -> bool:
|
||||
# ...
|
||||
@property
|
||||
def is_from_self(self) -> bool:
|
||||
...
|
||||
@property
|
||||
def is_reply(self) -> bool:
|
||||
...
|
||||
|
|
|
@ -47,6 +47,10 @@ impl ReceiveMessage {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn is_from_self(&self) -> bool {
|
||||
crate::MainStatus::global_tailchat_status().user_id == self.sender_id
|
||||
}
|
||||
|
||||
/// 创建一个对这条消息的回复
|
||||
pub fn as_reply(&self) -> SendingMessage {
|
||||
SendingMessage::new(
|
||||
|
|
|
@ -80,6 +80,8 @@ impl TailchatReceiveMessagePy {
|
|||
#[getter]
|
||||
pub fn get_is_reply(&self) -> bool { self.message.is_reply() }
|
||||
#[getter]
|
||||
pub fn get_is_from_self(&self) -> bool { self.message.is_from_self() }
|
||||
#[getter]
|
||||
pub fn get_msg_id(&self) -> MessageId { self.message.msg_id.clone() }
|
||||
#[getter]
|
||||
pub fn get_content(&self) -> String { self.message.content.clone() }
|
||||
|
|
|
@ -104,8 +104,8 @@ pub async fn on_converse_update(payload: Payload, client: Client) {
|
|||
let update_info: UpdateDMConverse = match serde_json::from_value(value.clone()) {
|
||||
Ok(value) => value,
|
||||
Err(e) => {
|
||||
info!("tailchat updateDMConverse {}", value.to_string().red());
|
||||
info!("tailchat updateDMConverse {}", format!("{:?}", e).red());
|
||||
event!(Level::WARN, "tailchat updateDMConverse {}", value.to_string().red());
|
||||
event!(Level::WARN, "tailchat updateDMConverse {}", format!("{:?}", e).red());
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user