rikkabot

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2025 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidCall = errors.New("invalid bot call")
	ErrSendMsg     = errors.New("send message error")
	ErrFetchImg    = errors.New("fetch image error")
	ErrUnSupport   = errors.New("unsupported this func")
)

Functions

This section is empty.

Types

type RikkaBot

type RikkaBot struct {
	Config *config.CommonConfig

	EnableProcess bool // 是否处理消息
	Processor     *processor.Processor

	EventPool  *event.EventPool
	EventFuncs []func(event event.IEvent)
	// contains filtered or unexported fields
}

func NewRikkaBot

func NewRikkaBot(ctx context.Context, cancel context.CancelFunc, cli *wcf.Client, debug bool) *RikkaBot

func (*RikkaBot) Block

func (r *RikkaBot) Block() error

Block 当发生错误,该方法会立即返回,否则会一直阻塞

func (*RikkaBot) DispatchMsgEvent

func (r *RikkaBot) DispatchMsgEvent(rikkaMsg message.Message)

func (*RikkaBot) Exit

func (r *RikkaBot) Exit()

Exit 主动退出 rikkabot

func (*RikkaBot) ExitWithErr

func (r *RikkaBot) ExitWithErr(code int, msg string)

ExitWithErr 异常退出 rikkabot

func (*RikkaBot) GetEventFuncs

func (r *RikkaBot) GetEventFuncs() []func(event event.IEvent)

func (*RikkaBot) GetFullFilePathFromRelativePath added in v0.6.2

func (r *RikkaBot) GetFullFilePathFromRelativePath(relativePath string) string

func (*RikkaBot) GetImgDataByPath added in v0.6.2

func (r *RikkaBot) GetImgDataByPath(path string) []byte

func (*RikkaBot) GetReqMsgRecvChan

func (r *RikkaBot) GetReqMsgRecvChan() <-chan *message.Message

GetReqMsgRecvChan 获取消息接收通道 读通道

func (*RikkaBot) GetReqMsgSendChan

func (r *RikkaBot) GetReqMsgSendChan() chan<- *message.Message

GetReqMsgSendChan 获取消息接收通道 写通道

func (*RikkaBot) GetRespMsgRecvChan

func (r *RikkaBot) GetRespMsgRecvChan() <-chan *message.Message

GetRespMsgRecvChan 获取消息发送通道 读通道

func (*RikkaBot) GetRespMsgSendChan

func (r *RikkaBot) GetRespMsgSendChan() chan<- *message.Message

GetRespMsgSendChan 获取消息发送通道 写通道

func (*RikkaBot) OnEventPush

func (r *RikkaBot) OnEventPush(f func(event event.IEvent))

func (*RikkaBot) PushLogOutNoticeEvent

func (r *RikkaBot) PushLogOutNoticeEvent(code int, msg string)

PushLogOutNoticeEvent 推送机器人掉线事件

func (*RikkaBot) SendMsg

func (r *RikkaBot) SendMsg(msgType message.MsgType, data any, sendId string) error

SendMsg 统一发送消息接口 消息类型 是否群组 发送数据 群/好友 id nolint

func (*RikkaBot) SetBotName

func (r *RikkaBot) SetBotName(botname string) (*RikkaBot, error)

func (*RikkaBot) Start

func (r *RikkaBot) Start()

Start 启动 rikkabot 进行消息处理

func (*RikkaBot) StartHandleEvent

func (r *RikkaBot) StartHandleEvent()

Directories

Path Synopsis
Package config @Author Clover @Data 2024/7/6 下午3:28:00 @Desc 全局设置、并管理设置的周期持久化
Package config @Author Clover @Data 2024/7/6 下午3:28:00 @Desc 全局设置、并管理设置的周期持久化
Package manager @Author Clover @Data 2024/7/28 下午10:37:00 @Desc etcd/bbolt 嵌入式 键值存储 用户持久化缓存,以及支持一些缓存的备份操作
Package manager @Author Clover @Data 2024/7/28 下午10:37:00 @Desc etcd/bbolt 嵌入式 键值存储 用户持久化缓存,以及支持一些缓存的备份操作
Package message @Author Clover @Data 2024/9/2 下午5:14:00 @Desc xml 消息体(app 消息)
Package message @Author Clover @Data 2024/9/2 下午5:14:00 @Desc xml 消息体(app 消息)
onebot
dto/event
Package event @Author Clover @Data 2024/7/22 下午2:49:00 @Desc 事件动作
Package event @Author Clover @Data 2024/7/22 下午2:49:00 @Desc 事件动作
httpapi
Package httpapi @Author Clover @Data 2024/7/20 下午9:37:00 @Desc http and http webhook
Package httpapi @Author Clover @Data 2024/7/20 下午9:37:00 @Desc http and http webhook
httpapi/handlers
Package handlers @Author Clover @Data 2024/7/21 下午10:45:00 @Desc 处理 http server相关
Package handlers @Author Clover @Data 2024/7/21 下午10:45:00 @Desc 处理 http server相关
oneboterr
Package oneboterr @Author Clover @Data 2024/7/19 下午9:32:00 @Desc OneBot 相关错误返回码
Package oneboterr @Author Clover @Data 2024/7/19 下午9:32:00 @Desc OneBot 相关错误返回码
Package plugins @Author Clover @Data 2025/3/6 下午9:46:00 @Desc
Package plugins @Author Clover @Data 2025/3/6 下午9:46:00 @Desc
admin
Package admin @Author Clover @Data 2025/3/10 下午4:55:00 @Desc 管理员模块
Package admin @Author Clover @Data 2025/3/10 下午4:55:00 @Desc 管理员模块
ai
Package ai @Author Clover @Data 2024/8/30 下午5:48:00 @Desc 过滤器
Package ai @Author Clover @Data 2024/8/30 下午5:48:00 @Desc 过滤器
ai/cron
Package cron @Author Clover @Data 2024/9/17 下午7:36:00 @Desc 定时器
Package cron @Author Clover @Data 2024/9/17 下午7:36:00 @Desc 定时器
ai/cron/cronplugins
Package cronplugins @Author Clover @Data 2024/9/17 下午8:27:00 @Desc 定时获取天气模块
Package cronplugins @Author Clover @Data 2024/9/17 下午8:27:00 @Desc 定时获取天气模块
anime
Package anime @Author Clover @Data 2025/3/31 下午7:58:00 @Desc 动漫相关插件
Package anime @Author Clover @Data 2025/3/31 下午7:58:00 @Desc 动漫相关插件
biliDecoder
Package biliDecoder @Author Clover @Data 2025/3/17 下午1:59:00 @Desc
Package biliDecoder @Author Clover @Data 2025/3/17 下午1:59:00 @Desc
hentai
Package hentai 提供涩图功能
Package hentai 提供涩图功能
matcher
Package matchers @Author Clover @Data 2025/3/16 下午12:33:00 @Desc
Package matchers @Author Clover @Data 2025/3/16 下午12:33:00 @Desc
Package processor @Author Clover @Data 2025/3/7 下午8:17:00 @Desc 模块处理器
Package processor @Author Clover @Data 2025/3/7 下午8:17:00 @Desc 模块处理器
cache
Package cache @Author Clover @Data 2024/7/11 上午12:05:00 @Desc 缓存,持久化到文件中
Package cache @Author Clover @Data 2024/7/11 上午12:05:00 @Desc 缓存,持久化到文件中
utils
Queue
Package Queue @Author Clover @Data 2025/3/31 下午7:09:00 @Desc 使用 Go 泛型实现的并发安全的切片队列
Package Queue @Author Clover @Data 2025/3/31 下午7:09:00 @Desc 使用 Go 泛型实现的并发安全的切片队列
configutil
Package configutil @Author Clover @Data 2024/7/6 下午3:51:00 @Desc
Package configutil @Author Clover @Data 2024/7/6 下午3:51:00 @Desc
imgutil
Package imgutil @Author Clover @Data 2024/7/22 下午1:53:00 @Desc 图片处理工具类
Package imgutil @Author Clover @Data 2024/7/22 下午1:53:00 @Desc 图片处理工具类
msgutil
Package msgutil @Author Clover @Data 2024/7/7 下午9:57:00 @Desc
Package msgutil @Author Clover @Data 2024/7/7 下午9:57:00 @Desc
secretutil
Package secretutil @Author Clover @Data 2024/7/24 下午2:48:00 @Desc 加密摘要工具类
Package secretutil @Author Clover @Data 2024/7/24 下午2:48:00 @Desc 加密摘要工具类
serializer
Package serializer @Author Clover @Data 2024/7/5 下午5:45:00 @Desc 串行化器
Package serializer @Author Clover @Data 2024/7/5 下午5:45:00 @Desc 串行化器
testutil
Package testutil @Author Clover @Data 2024/7/31 下午4:32:00 @Desc
Package testutil @Author Clover @Data 2024/7/31 下午4:32:00 @Desc
timeutil
Package timeutil @Author Clover @Data 2024/7/21 下午11:39:00 @Desc
Package timeutil @Author Clover @Data 2024/7/21 下午11:39:00 @Desc

Jump to

Keyboard shortcuts

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