#kovi #lagrange #kovi-plugin #kovi-expand #kovi-plugin-expand

kovi-plugin-expand-lagrange

Kovi 的 Lagrange Api拓展。

9 releases (4 breaking)

new 0.6.0 Jan 14, 2025
0.5.3 Oct 26, 2024
0.4.0 Oct 12, 2024
0.3.0 Oct 9, 2024
0.1.1 Oct 3, 2024

#6 in #kovi

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 1/week @ 2024-12-04 1/week @ 2024-12-11 61/week @ 2025-01-08

61 downloads per month

MPL-2.0 license

16KB
391 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

~15–28MB
~398K SLoC