Skip to content

Commit

Permalink
Merge pull request #8 from Threkork/nightly
Browse files Browse the repository at this point in the history
Nightly to main
  • Loading branch information
Threkork authored Oct 2, 2024
2 parents f7a1865 + 480bf90 commit 676691e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "kovi"
version = "0.8.0-rc2"
version = "0.8.0"
edition = "2021"
description = "A OneBot V11 bot plugin framework"
license = "MPL-2.0"
Expand Down
11 changes: 11 additions & 0 deletions src/bot/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,17 @@ impl From<String> 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<CQMessage> for Message {
fn from(v: CQMessage) -> Self {
Expand Down
4 changes: 1 addition & 3 deletions src/bot/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)())
});
}
}
Expand Down

0 comments on commit 676691e

Please sign in to comment.