mirror of
http://shenjack.top:5100/shenjack/icalingua-python-bot.git
synced 2024-11-23 12:41:05 +08:00
添加 撤回消息 的事件 以及 忽略 closeLoading 事件
This commit is contained in:
parent
e6df56b04d
commit
492800fed6
|
@ -30,6 +30,18 @@ pub fn add_message(payload: Payload, _client: RawClient) {
|
|||
}
|
||||
}
|
||||
|
||||
/// 撤回消息
|
||||
pub fn delete_message(payload: Payload, _client: RawClient) {
|
||||
if let Payload::Text(values) = payload {
|
||||
// 消息 id
|
||||
if let Some(value) = values.first() {
|
||||
if let Some(msg_id) = value.as_str() {
|
||||
warn!("delete_message {}", format!("{}", msg_id).yellow());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn any_event(event: Event, payload: Payload, _client: RawClient) {
|
||||
let handled = vec![
|
||||
// 真正处理过的
|
||||
|
@ -39,9 +51,11 @@ pub fn any_event(event: Event, payload: Payload, _client: RawClient) {
|
|||
"requireAuth",
|
||||
"onlineData",
|
||||
"addMessage",
|
||||
"deleteMessage",
|
||||
// "setAllRooms",
|
||||
// 忽略的
|
||||
"notify",
|
||||
"closeLoading", // 发送消息/加载新聊天 有一个 loading
|
||||
"updateRoom",
|
||||
];
|
||||
match &event {
|
||||
|
|
|
@ -36,6 +36,7 @@ fn main() {
|
|||
.on("authFailed", events::connect_callback)
|
||||
.on("onlineData", events::get_online_data)
|
||||
.on("addMessage", events::add_message)
|
||||
.on("deleteMessage", events::delete_message)
|
||||
.connect()
|
||||
.expect("Connection failed");
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user