Versions in this module Expand all Collapse all v1 v1.2.0 Jun 11, 2026 v1.1.0 Jun 10, 2026 v1.0.2 Jun 11, 2026 v1.0.1 Jun 11, 2026 Changes in this version + const Protocol + type ActionError struct + Action string + Message string + RetCode int + Status string + Wording string + func (e *ActionError) Error() string type Adapter + func (a *Adapter) SetStateSink(sink core.AdapterStateSink) + func (a *Adapter) State() core.AdapterState type Option + func WithMaxEventBytes(n int64) Option type TransportConfig + MaxEventBytes int64 v1.0.0 Jun 4, 2026 Changes in this version + func At(qq any) message.Segment + func CQString(chain message.Chain) string + func Custom(kind string, data map[string]any) message.Segment + func CustomMusic(url, audio, title, content, image string) message.Segment + func CustomNode(userID any, nickname string, content message.Chain) message.Segment + func Face(id any) message.Segment + func Image(file string) message.Segment + func JSON(data string) message.Segment + func Music(kind string, id any) message.Segment + func Node(id any) message.Segment + func ParseCQ(input string) message.Chain + func Record(file string) message.Segment + func Reply(id any) message.Segment + func Share(url, title, content, image string) message.Segment + func Text(text string) message.Segment + func Video(file string) message.Segment + func XML(data string) message.Segment + type Adapter struct + func AdapterFromConfig(cfg Config, extra ...Option) (*Adapter, error) + func HTTP(apiURL, listenAddr string, opts ...Option) *Adapter + func LoadAdapter(path string, extra ...Option) (*Adapter, error) + func New(transport Transport) *Adapter + func ReverseWS(addr string, opts ...Option) *Adapter + func WebSocket(url string, opts ...Option) *Adapter + func (a *Adapter) Client() anybot.ActionClient + func (a *Adapter) Protocol() anybot.Protocol + func (a *Adapter) Start(ctx context.Context, emit anybot.EmitFunc) error + type Client struct + func ClientFrom(c *anybot.Context) (*Client, bool) + func MustClient(c *anybot.Context) *Client + func (c *Client) Call(ctx context.Context, action string, params any, out any) error + func (c *Client) CallRaw(ctx context.Context, action string, params any) (*anybot.ActionResponse, error) + func (c *Client) CanSendImage(ctx context.Context) (bool, error) + func (c *Client) CanSendRecord(ctx context.Context) (bool, error) + func (c *Client) CleanCache(ctx context.Context) error + func (c *Client) CreateGroupFileFolder(ctx context.Context, groupID any, name string, parentID any) error + func (c *Client) DeleteGroupFile(ctx context.Context, groupID any, fileID, busid any) error + func (c *Client) DeleteGroupFolder(ctx context.Context, groupID, folderID any) error + func (c *Client) DeleteMessage(ctx context.Context, messageID any) error + func (c *Client) GetCSRFToken(ctx context.Context) (int64, error) + func (c *Client) GetCookies(ctx context.Context, domain string) (string, error) + func (c *Client) GetCredentials(ctx context.Context, domain string) (Credentials, error) + func (c *Client) GetForwardMessage(ctx context.Context, id any) (message.Chain, error) + func (c *Client) GetFriendList(ctx context.Context) ([]FriendInfo, error) + func (c *Client) GetGroupFileSystemInfo(ctx context.Context, groupID any) (GroupFileSystemInfo, error) + func (c *Client) GetGroupFileURL(ctx context.Context, groupID any, fileID, busid any) (string, error) + func (c *Client) GetGroupFilesByFolder(ctx context.Context, groupID, folderID any) (GroupFiles, error) + func (c *Client) GetGroupHonorInfo(ctx context.Context, groupID any, kind string) (GroupHonorInfo, error) + func (c *Client) GetGroupInfo(ctx context.Context, groupID any, noCache bool) (GroupInfo, error) + func (c *Client) GetGroupList(ctx context.Context) ([]GroupInfo, error) + func (c *Client) GetGroupMemberInfo(ctx context.Context, groupID, userID any, noCache bool) (GroupMemberInfo, error) + func (c *Client) GetGroupMemberList(ctx context.Context, groupID any, noCache bool) ([]GroupMemberInfo, error) + func (c *Client) GetGroupRootFiles(ctx context.Context, groupID any) (GroupFiles, error) + func (c *Client) GetImage(ctx context.Context, file string) (FileInfo, error) + func (c *Client) GetLoginInfo(ctx context.Context) (LoginInfo, error) + func (c *Client) GetMessage(ctx context.Context, messageID any) (MessageInfo, error) + func (c *Client) GetRecord(ctx context.Context, file, outFormat string) (FileInfo, error) + func (c *Client) GetStatus(ctx context.Context) (StatusInfo, error) + func (c *Client) GetStrangerInfo(ctx context.Context, userID any, noCache bool) (StrangerInfo, error) + func (c *Client) GetVersionInfo(ctx context.Context) (VersionInfo, error) + func (c *Client) Send(ctx context.Context, target anybot.ReplyTarget, chain message.Chain) (anybot.MessageReceipt, error) + func (c *Client) SendGroupMessage(ctx context.Context, groupID any, chain message.Chain) (string, error) + func (c *Client) SendLike(ctx context.Context, userID any, times int) error + func (c *Client) SendMessage(ctx context.Context, messageType string, userID, groupID any, ...) (string, error) + func (c *Client) SendPrivateMessage(ctx context.Context, userID any, chain message.Chain) (string, error) + func (c *Client) SetFriendAddRequest(ctx context.Context, flag string, approve bool, remark string) error + func (c *Client) SetGroupAddRequest(ctx context.Context, flag, subType string, approve bool, reason string) error + func (c *Client) SetGroupAdmin(ctx context.Context, groupID, userID any, enable bool) error + func (c *Client) SetGroupAnonymous(ctx context.Context, groupID any, enable bool) error + func (c *Client) SetGroupAnonymousBan(ctx context.Context, groupID any, anonymous any, anonymousFlag string, ...) error + func (c *Client) SetGroupBan(ctx context.Context, groupID, userID any, duration time.Duration) error + func (c *Client) SetGroupCard(ctx context.Context, groupID, userID any, card string) error + func (c *Client) SetGroupKick(ctx context.Context, groupID, userID any, rejectAddRequest bool) error + func (c *Client) SetGroupLeave(ctx context.Context, groupID any, dismiss bool) error + func (c *Client) SetGroupName(ctx context.Context, groupID any, name string) error + func (c *Client) SetGroupSpecialTitle(ctx context.Context, groupID, userID any, title string, duration time.Duration) error + func (c *Client) SetGroupWholeBan(ctx context.Context, groupID any, enable bool) error + func (c *Client) SetRestart(ctx context.Context, delay time.Duration) error + func (c *Client) UploadGroupFile(ctx context.Context, groupID any, file, name, folder string) error + func (c *Client) UploadPrivateFile(ctx context.Context, userID any, file, name string) error + type Config struct + Protocol string + Transport TransportConfig + func LoadConfig(path string) (Config, error) + func (cfg Config) Options(extra ...Option) ([]Option, error) + func (cfg Config) Validate() error + type ConnectionEvent struct + Addr string + Path string + Remote string + State ConnectionState + Transport string + URL string + type ConnectionHook func(context.Context, ConnectionEvent) + type ConnectionState string + const ConnectionConnected + const ConnectionDisconnected + type Credentials struct + CSRFToken int64 + Cookies string + func (i *Credentials) UnmarshalJSON(data []byte) error + type Event struct + Comment string + Extra map[string]json.RawMessage + Flag string + GroupID int64 + Message message.Chain + MessageID int64 + MessageType string + MetaEventType string + NoticeType string + OperatorID int64 + PostType string + Raw json.RawMessage + RawMessage string + RequestType string + SelfID int64 + Sender Sender + SubType string + TargetID int64 + Time int64 + UserID int64 + func EventFrom(c *anybot.Context) (*Event, bool) + func (e *Event) Normalize() *anybot.Event + func (e *Event) UnmarshalJSON(data []byte) error + type FileInfo struct + File string + URL string + type FriendInfo struct + Nickname string + Remark string + UserID int64 + func (i *FriendInfo) UnmarshalJSON(data []byte) error + type GroupFile struct + BusID int64 + DeadTime int64 + DownloadTimes int64 + FileID string + FileName string + FileSize int64 + GroupID int64 + ModifyTime int64 + UploadTime int64 + Uploader int64 + UploaderName string + func (i *GroupFile) UnmarshalJSON(data []byte) error + type GroupFileSystemInfo struct + FileCount int64 + LimitCount int64 + TotalSpace int64 + UsedSpace int64 + func (i *GroupFileSystemInfo) UnmarshalJSON(data []byte) error + type GroupFiles struct + Files []GroupFile + Folders []GroupFolder + type GroupFolder struct + CreateTime int64 + Creator int64 + CreatorName string + FolderID string + FolderName string + GroupID int64 + TotalFileCount int64 + func (i *GroupFolder) UnmarshalJSON(data []byte) error + type GroupHonorInfo struct + CurrentTalkative HonorItem + EmotionList []HonorItem + GroupID int64 + LegendList []HonorItem + PerformerList []HonorItem + StrongNewbieList []HonorItem + TalkativeList []HonorItem + func (i *GroupHonorInfo) UnmarshalJSON(data []byte) error + type GroupInfo struct + GroupID int64 + GroupName string + MaxMemberCount int + MemberCount int + func (i *GroupInfo) UnmarshalJSON(data []byte) error + type GroupMemberInfo struct + Age int + Area string + Card string + CardChangeable bool + GroupID int64 + JoinTime int64 + LastSentTime int64 + Nickname string + Role string + Sex string + Title string + TitleExpireTime int64 + Unfriendly bool + UserID int64 + func (i *GroupMemberInfo) UnmarshalJSON(data []byte) error + type HonorItem struct + Avatar string + Description string + Nickname string + UserID int64 + func (i *HonorItem) UnmarshalJSON(data []byte) error + type LoginInfo struct + Nickname string + UserID int64 + func (i *LoginInfo) UnmarshalJSON(data []byte) error + type Message = message.Chain + type MessageInfo struct + Message message.Chain + MessageID int64 + MessageType string + RawMessage string + RealID int64 + Sender Sender + Time int64 + func (m *MessageInfo) UnmarshalJSON(data []byte) error + type Option func(*options) + func WithAccessToken(token string) Option + func WithActionTimeout(timeout time.Duration) Option + func WithConnectionHook(hook ConnectionHook) Option + func WithDialTimeout(timeout time.Duration) Option + func WithHeader(key, value string) Option + func WithLogger(logger *slog.Logger) Option + func WithPath(path string) Option + func WithReconnectInterval(interval time.Duration) Option + func WithReconnectMaxInterval(interval time.Duration) Option + type Response struct + Data json.RawMessage + Echo string + Message string + Raw json.RawMessage + RetCode int + Status string + Wording string + func (r *Response) Decode(out any) error + func (r *Response) OK() bool + func (r *Response) UnmarshalJSON(data []byte) error + type Sender struct + Age int + Area string + Card string + Level string + Nickname string + Role string + Sex string + Title string + UserID int64 + func (s *Sender) UnmarshalJSON(data []byte) error + type StatusInfo struct + Extra map[string]any + Good bool + Online bool + type StrangerInfo struct + Age int + Level int + LoginDays int + Nickname string + QID string + Sex string + UserID int64 + func (i *StrangerInfo) UnmarshalJSON(data []byte) error + type Transport interface + CallRaw func(context.Context, string, any) (*Response, error) + Start func(context.Context, func(context.Context, *Event) error) error + type TransportConfig struct + AccessToken string + AccessTokenEnv string + ActionTimeout string + DialTimeout string + Headers map[string]string + Listen string + Path string + ReconnectInterval string + ReconnectMaxInterval string + Type string + URL string + type VersionInfo struct + AppName string + AppVersion string + ProtocolVersion string v0 v0.0.0-dev.3.4d4949d Jun 11, 2026 v0.0.0-dev.2.5a5af81 Jun 11, 2026 v0.0.0-dev.1.1beda01 Jun 10, 2026