感觉还行

This commit is contained in:
shenjack 2024-05-12 18:54:53 +08:00
parent 99082ccfd7
commit 1eba64bf9e
Signed by: shenjack
GPG Key ID: 7B1134A979775551
3 changed files with 20 additions and 10 deletions

3
Cargo.lock generated
View File

@ -653,9 +653,10 @@ dependencies = [
[[package]]
name = "ica-rs"
version = "0.6.0-dev"
version = "0.6.1"
dependencies = [
"anyhow",
"base64 0.22.1",
"chrono",
"colored",
"ed25519",

View File

@ -1,24 +1,31 @@
[package]
name = "ica-rs"
version = "0.6.0-dev"
version = "0.6.1"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
default = ["ica", "tailchat"]
ica = ["dep:ed25519", "dep:ed25519-dalek", "dep:hex", "dep:rust_socketio"]
ica = [
"dep:ed25519",
"dep:ed25519-dalek",
"dep:hex",
"dep:rust_socketio",
"dep:base64",
]
tailchat = ["dep:rust_socketio", "dep:md-5", "dep:reqwest"]
[dependencies]
# ica
base64 = { version = "0.22", optional = true }
ed25519 = { version = "2.2", optional = true }
ed25519-dalek = { version = "2.1", optional = true }
hex = { version = "0.4", optional = true }
# tailchat
reqwest = { version = "0.12.2", optional = true }
reqwest = { version = "0.12.4", optional = true }
md-5 = { version = "0.10.6", optional = true }
# ica & tailchat (socketio)

View File

@ -33,12 +33,14 @@ pub async fn add_message(payload: Payload, client: Client) {
info!("add_message {}", message.to_string().cyan());
// 就在这里处理掉最基本的消息
// 之后的处理交给插件
if message.content().eq("/bot-rs") && !message.is_from_self() && !message.is_reply() {
let reply = message.reply_with(&format!(
"shenbot v{}\nica-async-rs pong v{}",
VERSION, ICA_VERSION
));
send_message(&client, &reply).await;
if !message.is_from_self() && !message.is_reply() {
if message.content() == "/bot-rs" {
let reply = message.reply_with(&format!(
"shenbot v{}\nica-async-rs pong v{}",
VERSION, ICA_VERSION
));
send_message(&client, &reply).await;
}
}
// python 插件
py::call::ica_new_message_py(&message, &client).await;