Versions in this module Expand all Collapse all v1 v1.0.2 Nov 11, 2026 v1.0.1 Oct 12, 2026 Changes in this version + var ErrAppIDRequired = errx.New("app id is required") + var ErrAppSecretRequired = errx.New("app secret is required") + var ErrGroupIDRequired = errx.New("group openid is required") + var ErrHTTPStatus = errx.New("unexpected http status") + var ErrInvalidReply = errx.New("message id and event id are mutually exclusive") + var ErrInvalidSignature = errx.New("invalid webhook signature") + var ErrInvalidTarget = errx.New("invalid message target") + var ErrInvalidURL = errx.New("invalid api url") + var ErrMessageHandlerRequired = errx.New("message handler is required") + var ErrProtocol = errx.New("qq protocol error") + var ErrRateLimited = errx.New("qq rate limit exceeded") + var ErrRequest = errx.New("qq request failed") + var ErrTextRequired = errx.New("text is required") + var ErrUnauthorized = errx.New("qq authentication failed") + var ErrUserIDRequired = errx.New("user openid is required") + type APIError struct + Code int + HTTPStatus int + TraceID string + func (e *APIError) Error() string + func (e *APIError) Unwrap() error + type AccessTokenResponse struct + AccessToken string + ExpiresAt time.Time + ExpiresIn int64 + type Client struct + func New(opts ...Option) *Client + func (c *Client) GetAccessToken(ctx context.Context) (*AccessTokenResponse, error) + func (c *Client) SendGroupText(ctx context.Context, request SendGroupTextRequest) (*SendTextResponse, error) + func (c *Client) SendText(ctx context.Context, request SendTextRequest) (*SendTextResponse, error) + func (c *Client) WebhookHandler(handler func(context.Context, Message) error) (http.Handler, error) + type EventType string + const EventC2CMessageCreate + const EventGroupATMessageCreate + const EventGroupMessageCreate + type Message struct + Attachments []MessageAttachment + Author User + Content string + EventID string + EventType EventType + GroupID string + ID string + Sequence uint64 + Timestamp string + Type int + type MessageAttachment struct + ContentType string + Filename string + Height int + Size int64 + URL string + Width int + type MessageExtInfo struct + ReferenceIndex string + type Option func(*Client) + func WithAppID(appID string) Option + func WithAppSecret(secret string) Option + func WithBaseURL(baseURL string) Option + func WithClient(cli *restx.Client) Option + func WithInsecureHTTP() Option + func WithSandbox() Option + func WithTimeout(timeout time.Duration) Option + func WithToken(token string) Option + type SendGroupTextRequest struct + EventID string + GroupID string + MessageID string + MessageSequence uint32 + Text string + type SendTextRequest struct + EventID string + MessageID string + MessageSequence uint32 + Text string + ToUserID string + type SendTextResponse struct + ExtInfo MessageExtInfo + MessageID string + Timestamp string + TraceID string + type User struct + Bot bool + ID string + MemberOpenID string + MemberRole string + UserOpenID string + Username string