hello

package
v0.0.0-dev.3.4d4949d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

hello

最小 AnyBot SDK 插件示例:注册一个命令,读取 typed config,并回复一条文本。

在仓库根目录本地测试:

go test ./examples/plugins/hello

在独立插件仓库中,核心结构仍然相同:导出 Plugin,让最终用户通过 anybot plugin add <module> 安装。

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Plugin = absdk.Define(absdk.Spec[Config]{
	Manifest: absdk.Manifest{Name: "hello_example", Version: "0.1.0", Description: "最小命令插件示例"},
	DefaultConfig: Config{
		Command:  "hello",
		Greeting: "你好,我是 AnyBot 插件。",
	},
	Setup: func(ctx *absdk.Context, cfg Config) error {
		ctx.Command(cfg.Command).
			Name("command").
			Handle(func(c *absdk.EventContext) error {
				_, err := c.ReplyText(cfg.Greeting)
				return err
			})
		return nil
	},
})

Functions

This section is empty.

Types

type Config

type Config struct {
	Command  string `yaml:"command"`
	Greeting string `yaml:"greeting"`
}

func (Config) Validate

func (cfg Config) Validate() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL