8 unstable releases (3 breaking)

0.5.3 Oct 26, 2024
0.5.2 Oct 26, 2024
0.4.0 Oct 12, 2024
0.3.0 Oct 9, 2024
0.1.1 Oct 3, 2024

#1047 in Network programming

Download history 356/week @ 2024-10-02 339/week @ 2024-10-09 26/week @ 2024-10-16 410/week @ 2024-10-23 46/week @ 2024-10-30 10/week @ 2024-11-06

502 downloads per month

MPL-2.0 license

16KB
377 lines

kovi-plugin-expand-lagrange

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));
}

Dependencies

~14–27MB
~389K SLoC