From 695fc9064ef7f01c6a711979149ac10c4b060f85 Mon Sep 17 00:00:00 2001 From: Threkork Date: Sun, 29 Sep 2024 23:08:21 +0800 Subject: [PATCH 1/3] modified: Cargo.toml modified: src/bot/message.rs --- Cargo.toml | 2 +- src/bot/message.rs | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 12b3b1f..0ce78ce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "kovi" -version = "0.8.0-rc2" +version = "0.8.0-rc3" edition = "2021" description = "A OneBot V11 bot plugin framework" license = "MPL-2.0" diff --git a/src/bot/message.rs b/src/bot/message.rs index 2ee05c1..97e5494 100644 --- a/src/bot/message.rs +++ b/src/bot/message.rs @@ -88,6 +88,17 @@ impl From for Message { } } +impl From<&String> for Message { + fn from(v: &String) -> Self { + Message(vec![Segment { + type_: "text".to_string(), + data: json!({ + "text":v, + }), + }]) + } +} + #[cfg(feature = "cqstring")] impl From for Message { fn from(v: CQMessage) -> Self { From 9895890046623997376a134e632ceb026acf11bc Mon Sep 17 00:00:00 2001 From: Threkork Date: Mon, 30 Sep 2024 00:08:23 +0800 Subject: [PATCH 2/3] modified: Cargo.toml modified: src/bot/run.rs --- Cargo.toml | 2 +- src/bot/run.rs | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0ce78ce..f30925b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "kovi" -version = "0.8.0-rc3" +version = "0.8.0-rc4" edition = "2021" description = "A OneBot V11 bot plugin framework" license = "MPL-2.0" diff --git a/src/bot/run.rs b/src/bot/run.rs index 0c23040..6eb30c2 100644 --- a/src/bot/run.rs +++ b/src/bot/run.rs @@ -124,9 +124,7 @@ impl Bot { let plugin_builder = PluginBuilder::new(name.clone(), bot.clone(), api_tx.clone()); // 异步运行 main() - PLUGIN_BUILDER.scope(plugin_builder, async move { - (plugins.main)().await; - }) + PLUGIN_BUILDER.scope(plugin_builder, (plugins.main)()) }); } } From 480bf904cca9fc477a3e402d8a761947254e0671 Mon Sep 17 00:00:00 2001 From: Threkork Date: Tue, 1 Oct 2024 01:13:10 +0800 Subject: [PATCH 3/3] modified: Cargo.toml --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index f30925b..cc58c0c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "kovi" -version = "0.8.0-rc4" +version = "0.8.0" edition = "2021" description = "A OneBot V11 bot plugin framework" license = "MPL-2.0"