mirror of
http://shenjack.top:5100/shenjack/icalingua-python-bot.git
synced 2025-02-23 07:19:59 +08:00
0.7.2
This commit is contained in:
parent
e88d1fe435
commit
cb87108804
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -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",
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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!(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user