This commit is contained in:
shenjack 2024-08-18 13:25:38 +08:00
parent e88d1fe435
commit cb87108804
Signed by: shenjack
GPG Key ID: 7B1134A979775551
6 changed files with 18 additions and 12 deletions

2
Cargo.lock generated
View File

@ -659,7 +659,7 @@ dependencies = [
[[package]] [[package]]
name = "ica-rs" name = "ica-rs"
version = "0.7.1" version = "0.7.2"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"base64 0.22.1", "base64 0.22.1",

View File

@ -1,6 +1,6 @@
[package] [package]
name = "ica-rs" name = "ica-rs"
version = "0.7.1" version = "0.7.2"
edition = "2021" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -41,8 +41,9 @@ pub async fn add_message(payload: Payload, client: Client) {
send_message(&client, &reply).await; send_message(&client, &reply).await;
} else if message.content() == "/bot-ls" { } else if message.content() == "/bot-ls" {
let reply = message.reply_with(&format!( let reply = message.reply_with(&format!(
"shenbot-py v{}\n{}", "shenbot-py v{}-{}\n{}",
VERSION, VERSION,
client_id(),
if MainStatus::global_config().check_py() { if MainStatus::global_config().check_py() {
py::PyStatus::display() py::PyStatus::display()
} else { } else {
@ -78,7 +79,8 @@ pub async fn add_message(payload: Payload, client: Client) {
} }
} }
} }
} else if message.content().starts_with(&format!("/bot-disable-{}", client_id)) { } else if message.content().starts_with(&format!("/bot-disable-{}", client_id))
{
if let Some((_, name)) = message.content().split_once(" ") { if let Some((_, name)) = message.content().split_once(" ") {
let path_name = PathBuf::from(name); let path_name = PathBuf::from(name);
match py::PyStatus::get_status(&path_name) { match py::PyStatus::get_status(&path_name) {

View File

@ -1,4 +1,7 @@
use std::{hash::{DefaultHasher, Hash, Hasher}, time::Duration}; use std::{
hash::{DefaultHasher, Hash, Hasher},
time::Duration,
};
mod config; mod config;
mod data_struct; mod data_struct;
@ -58,9 +61,9 @@ pub fn client_id() -> String {
/// 获取版本信息 /// 获取版本信息
pub fn version_str() -> String { pub fn version_str() -> String {
format!( format!(
"shenbot-rs v{}-{}-[{}] ica v{}({}) tailchat v{}", "shenbot-rs v{}{}-[{}] ica v{}({}) tailchat v{}",
VERSION, VERSION,
if STABLE { "" } else { "开发版" }, if STABLE { "" } else { "-开发版" },
client_id(), client_id(),
ICA_VERSION, ICA_VERSION,
ica::ICA_PROTOCOL_VERSION, ica::ICA_PROTOCOL_VERSION,

View File

@ -9,7 +9,7 @@ use tracing::{event, info, Level};
use crate::data_struct::tailchat::messages::ReceiveMessage; use crate::data_struct::tailchat::messages::ReceiveMessage;
use crate::data_struct::tailchat::status::{BotStatus, UpdateDMConverse}; use crate::data_struct::tailchat::status::{BotStatus, UpdateDMConverse};
use crate::tailchat::client::{emit_join_room, send_message}; use crate::tailchat::client::{emit_join_room, send_message};
use crate::{client_id, help_msg, py, MainStatus, TAILCHAT_VERSION, VERSION}; use crate::{client_id, help_msg, py, version_str, MainStatus, VERSION};
/// 所有 /// 所有
pub async fn any_event(event: Event, payload: Payload, _client: Client, _status: Arc<BotStatus>) { pub async fn any_event(event: Event, payload: Payload, _client: Client, _status: Arc<BotStatus>) {
@ -78,10 +78,7 @@ pub async fn on_message(payload: Payload, client: Client, _status: Arc<BotStatus
if !message.is_reply() { if !message.is_reply() {
if message.content == "/bot-rs" { if message.content == "/bot-rs" {
let reply = message.reply_with(&format!( let reply = message.reply_with(&version_str());
"shenbot v{}-{}\ntailchat-rs pong v{}",
VERSION, client_id(), TAILCHAT_VERSION
));
send_message(&client, &reply).await; send_message(&client, &reply).await;
} else if message.content == "/bot-ls" { } else if message.content == "/bot-ls" {
let reply = message.reply_with(&format!( let reply = message.reply_with(&format!(

View File

@ -1,5 +1,9 @@
# 更新日志 # 更新日志
## 0.7.2
- 修复了一些 ica 和 tailchat 表现不一致的问题(捂脸)
## 0.7.1 ## 0.7.1
- 两个 api 版本号分别升级到 `1.6.3(ica)``1.2.3(tailchat)` - 两个 api 版本号分别升级到 `1.6.3(ica)``1.2.3(tailchat)`