Versions in this module Expand all Collapse all v0 v0.0.3 Feb 16, 2025 Changes in this version + type AgentType int + const AgentLLOneBot + const AgentNapCat + const AgentWeChat type Client + func (c *Client) GetAgentType() AgentType type GroupInfo + Avatar string type LocationSegment + func NewLocation(lat, lon float64, title, content string) *LocationSegment type MemberInfo + Avatar string type Request + func NewGetMarketFaceRequest(fileID string) *Request type UserInfo + Avatar string v0.0.2 Feb 4, 2025 v0.0.1 Jan 27, 2025 Changes in this version + type Anonymous struct + Flag string + ID int64 + Name string + type AtSegment struct + func NewAt(target string) *AtSegment + func (s *AtSegment) Target() string + type Client struct + func NewClient(log zerolog.Logger, id, token string, service *Service) *Client + func (c *Client) DeleteMessage(id int32) error + func (c *Client) DownloadMedia(seg ISegment) (string, []byte, error) + func (c *Client) GetFriendList() ([]*UserInfo, error) + func (c *Client) GetGroupInfo(id string) (*GroupInfo, error) + func (c *Client) GetGroupList() ([]*GroupInfo, error) + func (c *Client) GetGroupMemberInfo(gid string, uid string) (*MemberInfo, error) + func (c *Client) GetGroupMemberList(id string) ([]*MemberInfo, error) + func (c *Client) GetLoginInfo() (*UserInfo, error) + func (c *Client) GetToken() string + func (c *Client) GetUserInfo(id string) (*UserInfo, error) + func (c *Client) IsLoggedIn() bool + func (c *Client) Release() + func (c *Client) SendGroupMessage(groupID int64, segments []ISegment) (*SendMessageResponse, error) + func (c *Client) SendPrivateMessage(userID int64, segments []ISegment) (*SendMessageResponse, error) + func (c *Client) SetEventHandler(handler func(IEvent)) + func (c *Client) StartLoop(conn *websocket.Conn) + type ContactSegment struct + type Event struct + PostType string + SelfID int64 + Time int64 + func (e *Event) EventType() EventType + func (e *Event) PayloadType() PayloadType + type EventType string + const EventUnknown + const MessageGroup + const MessagePrivate + const MetaHeartbeat + const MetaLifecycle + const NoticeFriendAdd + const NoticeFriendRecall + const NoticeGroupAdminSet + const NoticeGroupAdminUnset + const NoticeGroupBanBan + const NoticeGroupBanLiftBan + const NoticeGroupDecreaseKick + const NoticeGroupDecreaseKickMe + const NoticeGroupDecreaseleave + const NoticeGroupIncreaseApprove + const NoticeGroupIncreaseInvite + const NoticeGroupRecall + const NoticeGroupUpload + const NoticeNotifyHonnor + const NoticeNotifyLuckyKing + const NoticeNotifyPoke + const NoticeOfflineFile + const RequestFriend + const RequestGroupAdd + const RequestGroupInvite + type FaceSegment struct + func NewFace(id string) *FaceSegment + func (s *FaceSegment) ID() string + type FileInfo struct + Base64 string + File string + FileName string + ID string + Name string + URL string + type FileSegment struct + func NewFile(file, name string) *FileSegment + func (s *FileSegment) File() string + type ForwardSegment struct + func (s *ForwardSegment) ID() string + type FriendRecall struct + MessageID int64 + NoticeType string + UserID int64 + func (g *FriendRecall) EventType() EventType + type GroupInfo struct + ID int64 + Name string + type GroupRecall struct + GroupID int64 + MessageID int64 + NoticeType string + OperatorID int64 + UserID int64 + func (g *GroupRecall) EventType() EventType + type Heartbeat struct + Interval int64 + MetaEventType string + Status Status + func (h *Heartbeat) EventType() EventType + type IEvent interface + EventType func() EventType + type ISegment interface + SegmentType func() SegmentType + type ImageSegment struct + func NewImage(file, name string) *ImageSegment + func (s *ImageSegment) File() string + func (s *ImageSegment) IsSticker() bool + func (s *ImageSegment) URL() string + type JSONSegment struct + func (s *JSONSegment) Content() string + type Lifecycle struct + MetaEventType string + SubType string + func (lc *Lifecycle) EventType() EventType + type LightAPPSegment struct + type LocationSegment struct + func (s *LocationSegment) Content() string + func (s *LocationSegment) Latitude() float64 + func (s *LocationSegment) Longitude() float64 + func (s *LocationSegment) Title() string + type MarketFaceSegment struct + func (s *MarketFaceSegment) Content() string + func (s *MarketFaceSegment) File() string + func (s *MarketFaceSegment) URL() string + type MemberInfo struct + Card string + GroupID int64 + Nickname string + Role string + UserID int64 + type Message struct + Anonymous Anonymous + Font int32 + GroupID int64 + Message any + MessageID int32 + MessageType string + Sender Sender + SubType string + TargetID int64 + UserID int64 + func (m *Message) EventType() EventType + type MusicSegment struct + type NodeSegment struct + func NewJSON(content string) *NodeSegment + func (s *NodeSegment) ID() string + type Payload interface + PayloadType func() PayloadType + func UnmarshalPayload(m map[string]interface{}) (Payload, error) + type PayloadType string + const PaylaodRequest + const PayloadEvent + const PayloadResponse + type RecordSegment struct + func NewRecord(file, name string) *RecordSegment + func (s *RecordSegment) File() string + type ReplySegment struct + func NewReply(id string) *ReplySegment + func (s *ReplySegment) ID() string + type Request struct + Action string + Echo string + Params map[string]interface{} + func NewDeleteMsgRequest(messageID int32) *Request + func NewGetFileRequest(fileID string) *Request + func NewGetForwardMsgRequest(msgID string) *Request + func NewGetFriendListRequest() *Request + func NewGetGroupInfoRequest(groupID int64) *Request + func NewGetGroupListRequest() *Request + func NewGetGroupMemberInfoRequest(groupID, userID int64) *Request + func NewGetGroupMemberListRequest(groupID int64) *Request + func NewGetImageRequest(fileID string) *Request + func NewGetLoginInfoRequest() *Request + func NewGetRecordRequest(fileID string) *Request + func NewGetUserInfoRequest(userID int64) *Request + func NewGroupMsgRequest(groupID int64, segments []ISegment) *Request + func NewPrivateMsgRequest(userID int64, segments []ISegment) *Request + func (r *Request) PayloadType() PayloadType + type RequestType string + const CanSendImage + const CanSendRecord + const CleanCache + const DeleteMsg + const DownloadFile + const ForwardFriendSingleMsg + const ForwardGroupSingleMsg + const GetCSRFToken + const GetCookies + const GetCredentials + const GetFile + const GetForwardMsg + const GetFriendList + const GetFriendMsgHistory + const GetGroupHonorInfo + const GetGroupInfo + const GetGroupList + const GetGroupMemberInfo + const GetGroupMemberList + const GetGroupMsgHistory + const GetImage + const GetLoginInfo + const GetMsg + const GetRecord + const GetStatus + const GetStrangerInfo + const GetVersionInfo + const MarkGroupMsgAsRead + const MarkMsgAsRead + const MarkPrivateMsgAsRead + const SendForwardMsg + const SendGroupForwardMsg + const SendGroupMsg + const SendLike + const SendMsg + const SendPrivateForwardMsg + const SendPrivateMsg + const SetFriendAddRequest + const SetGroupAddRequest + const SetGroupAdmin + const SetGroupAnonymous + const SetGroupAnonymousBan + const SetGroupBan + const SetGroupCard + const SetGroupKick + const SetGroupLeave + const SetGroupName + const SetGroupSpecialTitle + const SetGroupWholeBan + const SetRestart + const UploadGroupFile + type Response struct + Data any + Echo string + Retcode int32 + Status string + func (r *Response) PayloadType() PayloadType + type Segment struct + Data map[string]interface{} + Type string + func (s *Segment) SegmentType() SegmentType + type SegmentType string + const At + const Contact + const Face + const File + const Forward + const Image + const JSON + const LightAPP + const Location + const MarketFace + const Music + const Node + const Record + const Reply + const Share + const Text + const Video + const XML + type SendMessageResponse struct + MessageID int32 + type Sender struct + Age int32 + Area string + Card string + Level int32 + Nickname string + Role string + Sex string + Title string + UserID int64 + type Service struct + func NewService(log zerolog.Logger, endpoint string, timeout time.Duration) *Service + func (s *Service) NewClient(log zerolog.Logger, id, token string) *Client + func (s *Service) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (s *Service) Start() + func (s *Service) Stop() + type ShareSegment struct + func (s *ShareSegment) Content() string + func (s *ShareSegment) Image() string + func (s *ShareSegment) Title() string + func (s *ShareSegment) URL() string + type Status struct + Good bool + Online bool + type TextSegment struct + func NewText(content string) *TextSegment + func (s *TextSegment) Content() string + type UserInfo struct + ID int64 + Nickname string + Remark string + type VideoSegment struct + func NewVideo(file, name string) *VideoSegment + func (s *VideoSegment) File() string + func (s *VideoSegment) URL() string + type XMLSegment struct + func (s *XMLSegment) Content() string