release: public alpha 0.6.0 baseline
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
# hello-command
|
||||
|
||||
Minimal JWeBot command extension.
|
||||
|
||||
It demonstrates the only allowed output path:
|
||||
|
||||
```text
|
||||
command handler -> ExtensionResult -> ReplyPlan
|
||||
```
|
||||
|
||||
The extension does not receive a GUI sender, group selector, environment,
|
||||
ledger, shell, or unrestricted network client.
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
id = "hello-command"
|
||||
author = "example"
|
||||
description = "Return a local greeting"
|
||||
help = ["/hello [name]"]
|
||||
version = "1.0.0"
|
||||
api_version = "1"
|
||||
entrypoint = "hello_command:plugin"
|
||||
type = "command"
|
||||
|
||||
[capabilities]
|
||||
commands = ["/hello"]
|
||||
storage = false
|
||||
network_profiles = []
|
||||
service_profiles = []
|
||||
@@ -0,0 +1,16 @@
|
||||
"""Minimal command extension using only the public JWeBot SDK."""
|
||||
|
||||
from jwebot_sdk import Event, ExtensionResult, ReplyPlan, SingleGroupContext
|
||||
|
||||
|
||||
def handle_hello(event: Event, arguments: str) -> ExtensionResult:
|
||||
suffix = f" {arguments}" if arguments else ""
|
||||
return ExtensionResult(
|
||||
reply=ReplyPlan.text(f"hello {event.sender}{suffix}"),
|
||||
metadata={"extension": "hello-command"},
|
||||
)
|
||||
|
||||
|
||||
def plugin(context: SingleGroupContext) -> None:
|
||||
context.commands.register("/hello", handle_hello)
|
||||
|
||||
Reference in New Issue
Block a user