mirror of
http://shenjack.top:5100/shenjack/icalingua-python-bot.git
synced 2024-11-23 12:41:05 +08:00
Update rust_socketio path in Cargo.toml and refactor ws_main function
This commit is contained in:
parent
9e5a2c726c
commit
0116dbea32
|
@ -13,4 +13,4 @@ rust_socketio = "0.4.4"
|
|||
serde_json = "1.0.108"
|
||||
|
||||
[patch.crates-io]
|
||||
rust_socketio = { path = "V:/githubs/rust-socketio/socketio" }
|
||||
rust_socketio = { path = "../../../rust-socketio/socketio" }
|
|
@ -48,10 +48,11 @@ fn ws_main() {
|
|||
let connect_call_back = |payload: Payload, _client: RawClient, _id| {
|
||||
match payload {
|
||||
Payload::Text(values) => {
|
||||
if values.first() == Some(&Value::String("authSucceed".to_string())) {
|
||||
// 一个绿色的 "已经连接到 icalingua 服务器"
|
||||
if let Some(value) = values.first() {
|
||||
if let Some("authSucceed") = value.as_str() {
|
||||
println!("\x1b[32m已经登录到 icalingua!\x1b[0m");
|
||||
}
|
||||
}
|
||||
},
|
||||
_ => ()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user