bot

package
v0.0.0-...-3c4a4f3 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

type Bot struct {
	// contains filtered or unexported fields
}

func GetBot

func GetBot(rawConfig map[string]any) (*Bot, error)

func (*Bot) RegisterPlugin

func (b *Bot) RegisterPlugin(plugin Plugin)

func (*Bot) Start

func (b *Bot) Start(ctx context.Context)

type Plugin

type Plugin interface {
	OnGroupMessage(record *record.GroupMessageData)
	OnFriendMessage(record *record.FriendMessageData)
	Name() string
	Initiate(conf map[string]any, sender sender.Sender)
}

type TestPlugin

type TestPlugin struct {
	sender.Sender
}

func (*TestPlugin) Initiate

func (t *TestPlugin) Initiate(_ map[string]any, sender sender.Sender)

func (*TestPlugin) Name

func (t *TestPlugin) Name() string

func (*TestPlugin) OnFriendMessage

func (t *TestPlugin) OnFriendMessage(_ *record.FriendMessageData)

func (*TestPlugin) OnGroupMessage

func (t *TestPlugin) OnGroupMessage(record *record.GroupMessageData)

Jump to

Keyboard shortcuts

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