feat: optimized the skill loading method

This commit is contained in:
loop
2026-04-09 17:38:23 +08:00
parent e016a7de96
commit 7a5a9eecad
19 changed files with 327 additions and 16 deletions
@@ -0,0 +1,21 @@
# Lua Event Publisher
This skill describes how to correctly use event_publisher when writing Lua scripts.
## How to call
- Import it with `local event_publisher = require("event_publisher")`
- Call `event_publisher.publish_message({...})` to publish a message event
- Call `event_publisher.publish_trigger({...})` to publish a trigger event
- Call `event_publisher.publish({...})` to publish a full custom event
## Example
```lua
local event_publisher = require("event_publisher")
event_publisher.publish_message({
source_cap = "lua_script",
channel = "custom",
chat_id = "demo",
text = "hello"
})
```
@@ -0,0 +1,13 @@
{
"skills": [
{
"id": "lua_module_event_publisher",
"file": "lua_module_event_publisher.md",
"title": "lua_module_event_publisher",
"summary": "How to publish message, trigger, and custom events from Lua.",
"cap_groups": [
"cap_lua"
]
}
]
}