Versions in this module Expand all Collapse all v0 v0.2.1 Dec 25, 2021 Changes in this version + type Context struct + Bot *Bot + Event Event + func (ctx *Context) SendMessage(message ...MessageSegment) (APIResp, error) v0.2.0 Dec 14, 2021 Changes in this version + func MessageBuilder() *messageBuilder v0.1.0 Dec 14, 2021 Changes in this version + const MessageTypeGroup + const MessageTypePrivate + const PostTypeMessage + const PostTypeMeta + const PostTypeNotice + const PostTypeRequest + func DefaultLogger(level logrus.Level) *logrus.Logger + type APIResp struct + Data interface{} + Retcode int + Status string + type Anonymous struct + Flag string + Id int + Name string + type ApiConfig struct + Address string + Token string + type Bot struct + BotConfig *BotConfig + Logger *logrus.Logger + func New(botConfig BotConfig) *Bot + func (bot *Bot) On(postType string, handler EventHandler) + func (bot *Bot) OnGroupMessage(prefix string, fn EventHandlerFunc) + func (bot *Bot) OnMessage(prefix string, fn EventHandlerFunc) + func (bot *Bot) OnMeta(fn EventHandlerFunc) + func (bot *Bot) OnNotice(fn EventHandlerFunc) + func (bot *Bot) OnPrivateMessage(prefix string, fn EventHandlerFunc) + func (bot *Bot) OnRequest(fn EventHandlerFunc) + func (bot *Bot) Request(action string, requestBody interface{}) (APIResp, error) + func (bot *Bot) SendGroupMsg(groupId int64, msg interface{}, autoEscape bool) (APIResp, error) + func (bot *Bot) SendPrivateMsg(userId int64, msg interface{}, autoEscape bool) (APIResp, error) + func (bot *Bot) Start() + type BotConfig struct + ApiConfig ApiConfig + SelfId int64 + ServerConfig ServerConfig + type Event struct + Anonymous Anonymous + Font int32 + GroupId int64 + Message []MessageSegment + MessageId int32 + MessageType string + PostType string + RawMessage string + SelfId int64 + Sender Sender + SubType string + Time int64 + UserId int64 + type EventHandler struct + Handle EventHandlerFunc + MessagePrefix string + MessageType string + type EventHandlerFunc func(*Bot, Event) + type EventValidator struct + func DefaultEventValidator() *EventValidator + func (ev *EventValidator) Validate(i interface{}) error + type HandlerMap struct + func (hm *HandlerMap) GetHandlers(postType string) []EventHandler + type MessageSegment struct + Data map[string]string + Type string + func At(qq string) MessageSegment + func Face(id string) MessageSegment + func Image(file string) MessageSegment + func Record(file string) MessageSegment + func Reply(id string) MessageSegment + func Text(text string) MessageSegment + func Video(file string) MessageSegment + type Sender struct + Age int + Area string + Card string + Level string + Nickname string + Role string + Sex string + Title string + UserId int + type ServerConfig struct + Address string + Path string + Secret string