Documentation ¶
Index ¶
- Constants
- func Debug() bool
- type AboutInfo
- type AboutResp
- type BaseReq
- type BaseReqInterface
- type BaseResp
- type BaseRespInterface
- type BindReq
- type BotListResp
- type BotProfileReq
- type Client
- func (c *Client) About() (AboutInfo, *http.Response, error)
- func (c *Client) Bind(req BindReq) (*http.Response, error)
- func (c *Client) BotList() ([]int64, *http.Response, error)
- func (c *Client) BotProfile(req BotProfileReq) (ProfileResp, *http.Response, error)
- func (c *Client) CountMessage(req CountMessageReq) (int, *http.Response, error)
- func (c *Client) Exec(method, path string, opt, res any) (*resty.Response, error)
- func (c *Client) FetchLatestMessage(req GetMessageReq) (Messages, *http.Response, error)
- func (c *Client) FetchMessage(req GetMessageReq) (Messages, *http.Response, error)
- func (c *Client) FriendProfile(req FriendProfileReq) (ProfileResp, *http.Response, error)
- func (c *Client) PeakLatestMessage(req GetMessageReq) (Messages, *http.Response, error)
- func (c *Client) PeakMessage(req GetMessageReq) (Messages, *http.Response, error)
- func (c *Client) Pre(method, path string, opt any) (string, map[string]string, any, error)
- func (c *Client) Release(req ReleaseReq) (*http.Response, error)
- func (c *Client) SendFriendMessage(req SendMessageReq) (int64, *http.Response, error)
- func (c *Client) SendGroupMessage(req SendMessageReq) (int64, *http.Response, error)
- func (c *Client) SendTempMessage(req SendMessageReq) (int64, *http.Response, error)
- func (c *Client) SessionInfo(req SessionInfoReq) (SessionInfoQQ, *http.Response, error)
- func (c *Client) Verify() (string, *http.Response, error)
- type ClientOptionFunc
- type Code
- type CountMessageReq
- type CountMessageResp
- type FriendProfileReq
- type GetMessageReq
- type GetMessageResp
- type Message
- type MessageInfoAt
- type MessageInfoAtAll
- type MessageInfoInterface
- type MessageInfoPlain
- type MessageInfoSource
- type MessageInfoType
- type MessageType
- type Messages
- type ProfileResp
- type ReleaseReq
- type SendMessageReq
- type SendMessageResp
- type SessionInfoData
- type SessionInfoQQ
- type SessionInfoReq
- type SessionInfoResp
- type Sex
- type VerifyReq
- type VerifyResp
Constants ¶
View Source
const ( SexUnknown = "UNKNOWN" SexMale = "MALE" SexFemale = "FEMALE" )
View Source
const (
DefaultUserAgent = "starudream-mirai-go"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BaseReq ¶
type BaseReq struct {
SessionKey string `url:"sessionKey,omitempty" json:"sessionKey,omitempty"`
}
func (BaseReq) GetSessionKey ¶
type BaseReqInterface ¶
type BaseReqInterface interface {
GetSessionKey() string
}
type BaseRespInterface ¶
type BotListResp ¶
type BotProfileReq ¶
type BotProfileReq struct {
BaseReq
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(addr, verifyKey string, options ...ClientOptionFunc) (*Client, error)
func (*Client) BotProfile ¶
func (c *Client) BotProfile(req BotProfileReq) (ProfileResp, *http.Response, error)
func (*Client) CountMessage ¶
func (*Client) FetchLatestMessage ¶
func (*Client) FetchMessage ¶
func (*Client) FriendProfile ¶
func (c *Client) FriendProfile(req FriendProfileReq) (ProfileResp, *http.Response, error)
func (*Client) PeakLatestMessage ¶
func (*Client) PeakMessage ¶
func (*Client) SendFriendMessage ¶
func (*Client) SendGroupMessage ¶
func (*Client) SendTempMessage ¶
func (*Client) SessionInfo ¶
func (c *Client) SessionInfo(req SessionInfoReq) (SessionInfoQQ, *http.Response, error)
type ClientOptionFunc ¶
func WithClient ¶ added in v0.0.3
func WithClient(client *resty.Client) ClientOptionFunc
func WithUserAgent ¶
func WithUserAgent(userAgent string) ClientOptionFunc
type CountMessageReq ¶
type CountMessageReq struct {
BaseReq
}
type CountMessageResp ¶
type FriendProfileReq ¶
type GetMessageReq ¶
type GetMessageResp ¶
type Message ¶
type Message struct { Type MessageType `json:"-"` // contains filtered or unexported fields }
func (*Message) MarshalJSON ¶
func (*Message) UnmarshalJSON ¶
type MessageInfoAt ¶ added in v0.0.4
type MessageInfoAt struct { Type MessageInfoType `json:"type"` Target int64 `json:"target"` Display string `json:"display,omitempty"` }
type MessageInfoAtAll ¶ added in v0.0.4
type MessageInfoAtAll struct {
Type MessageInfoType `json:"type"`
}
type MessageInfoInterface ¶
type MessageInfoInterface interface {
// contains filtered or unexported methods
}
type MessageInfoPlain ¶
type MessageInfoPlain struct { Type MessageInfoType `json:"type"` Text string `json:"text"` }
type MessageInfoSource ¶ added in v0.0.4
type MessageInfoSource struct { Type MessageInfoType `json:"type"` Id int64 `json:"id"` Time int64 `json:"time"` }
type MessageInfoType ¶
type MessageInfoType string
const ( MessageInfoTypeSource MessageInfoType = "Source" MessageInfoTypeQuote MessageInfoType = "Quote" MessageInfoTypeAt MessageInfoType = "At" MessageInfoTypeAtAll MessageInfoType = "AtAll" MessageInfoTypeFace MessageInfoType = "Face" MessageInfoTypePlain MessageInfoType = "Plain" MessageInfoTypeImage MessageInfoType = "Image" MessageInfoTypeFlashImage MessageInfoType = "FlashImage" MessageInfoTypeVoice MessageInfoType = "Voice" MessageInfoTypeXml MessageInfoType = "Xml" MessageInfoTypeJson MessageInfoType = "Json" MessageInfoTypeApp MessageInfoType = "App" MessageInfoTypePoke MessageInfoType = "Poke" MessageInfoTypeDice MessageInfoType = "Dice" MessageInfoTypeMarketFace MessageInfoType = "MarketFace" MessageInfoTypeForwardMessage MessageInfoType = "ForwardMessage" MessageInfoTypeFile MessageInfoType = "File" MessageInfoTypeMiraiCode MessageInfoType = "MiraiCode" )
type MessageType ¶
type MessageType string
const ( MessageTypeFriend MessageType = "FriendMessage" MessageTypeGroup MessageType = "GroupMessage" MessageTypeTemp MessageType = "TempMessage" MessageTypeStranger MessageType = "StrangerMessage" MessageTypeOther MessageType = "OtherClientMessage" MessageTypeFriendSync MessageType = "FriendSyncMessage" MessageTypeGroupSync MessageType = "GroupSyncMessage" MessageTypeTempSync MessageType = "TempSyncMessage" MessageTypeStrangerSync MessageType = "StrangerSyncMessage" )
type ProfileResp ¶
type ReleaseReq ¶
type SendMessageReq ¶
type SendMessageResp ¶
type SessionInfoData ¶
type SessionInfoData struct { SessionKey string `json:"sessionKey"` QQ SessionInfoQQ `json:"qq"` }
type SessionInfoQQ ¶
type SessionInfoReq ¶
type SessionInfoReq struct {
BaseReq
}
type SessionInfoResp ¶
type SessionInfoResp struct { BaseResp Data SessionInfoData `json:"data"` }
type VerifyResp ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.