Crates.io | kovi-plugin-expand-lagrange |
lib.rs | kovi-plugin-expand-lagrange |
version | |
source | src |
created_at | 2024-10-03 10:39:43.314692 |
updated_at | 2025-01-14 13:46:17.847689 |
description | Kovi 的 Lagrange Api拓展。 |
homepage | |
repository | https://github.com/Threkork/kovi-plugin/ |
max_upload_size | |
id | 1395080 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Kovi 的 Api 拓展插件。
使用 cargo kovi add expand-lagrange -p <PLUGIN_NAME>
or cargo add kovi-plugin-expand-lagrange -p <PLUGIN_NAME>
添加此拓展。
懒得写了,直接看 Lagrange 的文档就行了: Largrange
合并转发例子:
use kovi::{Message, PluginBuilder as p};
// 三个 trait,第一个用于 RuntimeBot,第二个用于 Message,第三个用于 Vec
use kovi_plugin_expand_lagrange::{LagrangeApi, LagrangeMessage, LagrangeVec};
#[kovi::plugin]
async fn main() {
let bot = p::get_runtime_bot();
let nodes = Vec::new()
.add_forward_node("10000", "测试", Message::from("some"))
.add_forward_node("10000", "测试2", Message::from("some"));
let res = bot.send_forward_msg(nodes).await.unwrap();
let resid = res.data.as_str().unwrap();
bot.send_private_msg(bot.main_admin, Message::new().add_forward_resid(resid));
}