cqhttp

package
v0.0.0-...-5349944 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2023 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

View Source
const (
	API_GET_COOKIES                   = "get_cookies"
	API_GET_CSRF_TOKEN                = "get_csrf_token"
	API_GET_CREDENTIALS               = "get_credentials"
	API_GET_VERSION_INFO              = "get_version_info"
	API_GET_STATUS                    = "get_status"
	API_SET_RESTART                   = "set_restart"
	API_CLEAN_CACHE                   = "clean_cache"
	API_RELOAD_EVENT_FILTER           = "reload_event_filter"
	API_DOWNLOAD_FILE                 = "download_file"
	API_CHECK_URL_SAFELY              = "check_url_safely"
	API_HIDDEN_GET_WORD_SLICES        = ".get_word_slices"
	API_HIDDEN_HANDLE_QUICK_OPERATION = ".handle_quick_operation"
)
type OnebotApiCqhttp interface {
	// 获取 CSRF Token
	// get_csrf_token
	GetCsrfToken() (*model.CsrfTokenResult, error)
	// 获取 QQ 相关接口凭证
	// get_credentials
	GetCredentials() (*model.CredentialsResult, error)
	// 获取版本信息
	// get_version_info
	GetVersionInfo() (*model.VersionInfoResult, error)
	// 获取状态
	// get_status
	GetStatus() (*model.StatusResult, error)
	// 重启 Go-CqHttp
	// set_restart
	// delay 要延迟的毫秒数, 如果默认情况下无法重启, 可以尝试设置延迟为 2000 左右
	SetRestart(delay int32) error
	// 清理缓存
	// clean_cache
	CleanCache() error
	// 重载事件过滤器
	// reload_event_filter
	// file 事件过滤器文件路径
	ReloadEventFilter(file string) error
	// 下载文件到缓存目录
	// download_file
	// url 文件链接
	// thread_count 线程数
	// headers 请求头
	DownloadFile(url string, threadCount int32, headers []string) (*model.DownloadFileResult, error)
	// 检查链接安全性
	// check_url_safely
	// url 链接
	CheckUrlSafely(url string) (*model.CheckUrlSafelyResult, error)
	// 获取中文分词 ( 隐藏 API )
	// .get_word_slices
	// content 内容
	HiddenGetWordSlices(content string) (*model.WordSlicesResult, error)
	// 对事件执行快速操作 ( 隐藏 API )
	// .handle_quick_operation
	// context 事件上下文
	// operation 操作
	HiddenHandleQuickOperation(context interface{}, operation interface{}) error
}

Variables

View Source
var File_api_cqhttp_proto protoreflect.FileDescriptor

Functions

func RegisterOnebotApiCqhttpGRPCServiceServer

func RegisterOnebotApiCqhttpGRPCServiceServer(s *grpc.Server, srv OnebotApiCqhttpGRPCServiceServer)

Types

type ChannelApiCqhttpClient

type ChannelApiCqhttpClient struct {
	channel.ApiChannel
}

func (*ChannelApiCqhttpClient) CheckUrlSafely

func (cli *ChannelApiCqhttpClient) CheckUrlSafely(url string) (*model.CheckUrlSafelyResult, error)

检查链接安全性 check_url_safely url 链接

func (*ChannelApiCqhttpClient) CleanCache

func (cli *ChannelApiCqhttpClient) CleanCache() error

清理缓存 clean_cache

func (*ChannelApiCqhttpClient) DownloadFile

func (cli *ChannelApiCqhttpClient) DownloadFile(url string, threadCount int32, headers []string) (*model.DownloadFileResult, error)

下载文件到缓存目录 download_file url 文件链接 thread_count 线程数 headers 请求头

func (*ChannelApiCqhttpClient) GetCookies

func (cli *ChannelApiCqhttpClient) GetCookies(domain string) (*model.CookiesResult, error)

获取 Cookies get_cookies domain 指定域名

func (*ChannelApiCqhttpClient) GetCredentials

func (cli *ChannelApiCqhttpClient) GetCredentials() (*model.CredentialsResult, error)

获取 QQ 相关接口凭证 get_credentials

func (*ChannelApiCqhttpClient) GetCsrfToken

func (cli *ChannelApiCqhttpClient) GetCsrfToken() (*model.CsrfTokenResult, error)

获取 CSRF Token get_csrf_token

func (*ChannelApiCqhttpClient) GetStatus

func (cli *ChannelApiCqhttpClient) GetStatus() (*model.StatusResult, error)

获取状态 get_status

func (*ChannelApiCqhttpClient) GetVersionInfo

func (cli *ChannelApiCqhttpClient) GetVersionInfo() (*model.VersionInfoResult, error)

获取版本信息 get_version_info

func (*ChannelApiCqhttpClient) HiddenGetWordSlices

func (cli *ChannelApiCqhttpClient) HiddenGetWordSlices(content string) (*model.WordSlicesResult, error)

获取中文分词 ( 隐藏 API ) .get_word_slices content 内容

func (*ChannelApiCqhttpClient) HiddenHandleQuickOperation

func (cli *ChannelApiCqhttpClient) HiddenHandleQuickOperation(context interface{}, operation interface{}) error

对事件执行快速操作 ( 隐藏 API ) .handle_quick_operation context 事件上下文 operation 操作

func (*ChannelApiCqhttpClient) ReloadEventFilter

func (cli *ChannelApiCqhttpClient) ReloadEventFilter(file string) error

重载事件过滤器 reload_event_filter file 事件过滤器文件路径

func (*ChannelApiCqhttpClient) SetRestart

func (cli *ChannelApiCqhttpClient) SetRestart(delay int32) error

重启 Go-CqHttp set_restart delay 要延迟的毫秒数, 如果默认情况下无法重启, 可以尝试设置延迟为 2000 左右

type DownloadFileRequestGRPC

type DownloadFileRequestGRPC struct {
	Url         string   `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
	ThreadCount int32    `protobuf:"varint,2,opt,name=thread_count,json=threadCount,proto3" json:"thread_count,omitempty"`
	Headers     []string `protobuf:"bytes,3,rep,name=headers,proto3" json:"headers,omitempty"`
	// contains filtered or unexported fields
}

func (*DownloadFileRequestGRPC) Descriptor deprecated

func (*DownloadFileRequestGRPC) Descriptor() ([]byte, []int)

Deprecated: Use DownloadFileRequestGRPC.ProtoReflect.Descriptor instead.

func (*DownloadFileRequestGRPC) GetHeaders

func (x *DownloadFileRequestGRPC) GetHeaders() []string

func (*DownloadFileRequestGRPC) GetThreadCount

func (x *DownloadFileRequestGRPC) GetThreadCount() int32

func (*DownloadFileRequestGRPC) GetUrl

func (x *DownloadFileRequestGRPC) GetUrl() string

func (*DownloadFileRequestGRPC) ProtoMessage

func (*DownloadFileRequestGRPC) ProtoMessage()

func (*DownloadFileRequestGRPC) ProtoReflect

func (x *DownloadFileRequestGRPC) ProtoReflect() protoreflect.Message

func (*DownloadFileRequestGRPC) Reset

func (x *DownloadFileRequestGRPC) Reset()

func (*DownloadFileRequestGRPC) String

func (x *DownloadFileRequestGRPC) String() string

type HiddenHandleQuickOperationRequestGRPC

type HiddenHandleQuickOperationRequestGRPC struct {
	Context   *anypb.Any `protobuf:"bytes,1,opt,name=context,proto3" json:"context,omitempty"`
	Operation *anypb.Any `protobuf:"bytes,2,opt,name=operation,proto3" json:"operation,omitempty"`
	// contains filtered or unexported fields
}

func (*HiddenHandleQuickOperationRequestGRPC) Descriptor deprecated

func (*HiddenHandleQuickOperationRequestGRPC) Descriptor() ([]byte, []int)

Deprecated: Use HiddenHandleQuickOperationRequestGRPC.ProtoReflect.Descriptor instead.

func (*HiddenHandleQuickOperationRequestGRPC) GetContext

func (*HiddenHandleQuickOperationRequestGRPC) GetOperation

func (x *HiddenHandleQuickOperationRequestGRPC) GetOperation() *anypb.Any

func (*HiddenHandleQuickOperationRequestGRPC) ProtoMessage

func (*HiddenHandleQuickOperationRequestGRPC) ProtoMessage()

func (*HiddenHandleQuickOperationRequestGRPC) ProtoReflect

func (*HiddenHandleQuickOperationRequestGRPC) Reset

func (*HiddenHandleQuickOperationRequestGRPC) String

type OnebotApiCqhttpClient

type OnebotApiCqhttpClient interface {
	// 获取 Cookies
	// get_cookies
	// domain 指定域名
	GetCookies(domain string) (*model.CookiesResult, error)
	// 获取 CSRF Token
	// get_csrf_token
	GetCsrfToken() (*model.CsrfTokenResult, error)
	// 获取 QQ 相关接口凭证
	// get_credentials
	GetCredentials() (*model.CredentialsResult, error)
	// 获取版本信息
	// get_version_info
	GetVersionInfo() (*model.VersionInfoResult, error)
	// 获取状态
	// get_status
	GetStatus() (*model.StatusResult, error)
	// 重启 Go-CqHttp
	// set_restart
	// delay 要延迟的毫秒数, 如果默认情况下无法重启, 可以尝试设置延迟为 2000 左右
	SetRestart(delay int32) error
	// 清理缓存
	// clean_cache
	CleanCache() error
	// 重载事件过滤器
	// reload_event_filter
	// file 事件过滤器文件路径
	ReloadEventFilter(file string) error
	// 下载文件到缓存目录
	// download_file
	// url 文件链接
	// thread_count 线程数
	// headers 请求头
	DownloadFile(url string, threadCount int32, headers []string) (*model.DownloadFileResult, error)
	// 检查链接安全性
	// check_url_safely
	// url 链接
	CheckUrlSafely(url string) (*model.CheckUrlSafelyResult, error)
	// 获取中文分词 ( 隐藏 API )
	// .get_word_slices
	// content 内容
	HiddenGetWordSlices(content string) (*model.WordSlicesResult, error)
	// 对事件执行快速操作 ( 隐藏 API )
	// .handle_quick_operation
	// context 事件上下文
	// operation 操作
	HiddenHandleQuickOperation(context interface{}, operation interface{}) error
}

func NewChannelApiCqhttpClient

func NewChannelApiCqhttpClient(channel channel.ApiChannel) (OnebotApiCqhttpClient, error)

type OnebotApiCqhttpGRPCServiceClient

type OnebotApiCqhttpGRPCServiceClient interface {
	// 获取 Cookies
	// get_cookies
	// domain 指定域名
	GetCookies(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*model.CookiesResultGRPC, error)
	// get_csrf_token
	GetCsrfToken(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*model.CsrfTokenResultGRPC, error)
	// 获取 QQ 相关接口凭证
	// get_credentials
	GetCredentials(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*model.CredentialsResultGRPC, error)
	// 获取版本信息
	// get_version_info
	GetVersionInfo(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*model.VersionInfoResultGRPC, error)
	// 获取状态
	// get_status
	GetStatus(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*model.StatusResultGRPC, error)
	// 重启 Go-CqHttp
	// set_restart
	// delay 要延迟的毫秒数, 如果默认情况下无法重启, 可以尝试设置延迟为 2000 左右
	SetRestart(ctx context.Context, in *wrapperspb.Int32Value, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// 清理缓存
	// clean_cache
	CleanCache(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// 重载事件过滤器
	// reload_event_filter
	// file 事件过滤器文件路径
	ReloadEventFilter(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// 下载文件到缓存目录
	// download_file
	// url 文件链接
	// thread_count 线程数
	// headers 请求头
	DownloadFile(ctx context.Context, in *DownloadFileRequestGRPC, opts ...grpc.CallOption) (*model.DownloadFileResultGRPC, error)
	// 检查链接安全性
	// check_url_safely
	// url 链接
	CheckUrlSafely(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*model.CheckUrlSafelyResultGRPC, error)
	// 获取中文分词 ( 隐藏 API )
	// .get_word_slices
	// content 内容
	HiddenGetWordSlices(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*model.WordSlicesResultGRPC, error)
	// 对事件执行快速操作 ( 隐藏 API )
	// .handle_quick_operation
	// context 事件上下文
	// operation 操作
	HiddenHandleQuickOperation(ctx context.Context, in *HiddenHandleQuickOperationRequestGRPC, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

OnebotApiCqhttpGRPCServiceClient is the client API for OnebotApiCqhttpGRPCService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

type OnebotApiCqhttpGRPCServiceServer

type OnebotApiCqhttpGRPCServiceServer interface {
	// 获取 Cookies
	// get_cookies
	// domain 指定域名
	GetCookies(context.Context, *wrapperspb.StringValue) (*model.CookiesResultGRPC, error)
	// get_csrf_token
	GetCsrfToken(context.Context, *emptypb.Empty) (*model.CsrfTokenResultGRPC, error)
	// 获取 QQ 相关接口凭证
	// get_credentials
	GetCredentials(context.Context, *emptypb.Empty) (*model.CredentialsResultGRPC, error)
	// 获取版本信息
	// get_version_info
	GetVersionInfo(context.Context, *emptypb.Empty) (*model.VersionInfoResultGRPC, error)
	// 获取状态
	// get_status
	GetStatus(context.Context, *emptypb.Empty) (*model.StatusResultGRPC, error)
	// 重启 Go-CqHttp
	// set_restart
	// delay 要延迟的毫秒数, 如果默认情况下无法重启, 可以尝试设置延迟为 2000 左右
	SetRestart(context.Context, *wrapperspb.Int32Value) (*emptypb.Empty, error)
	// 清理缓存
	// clean_cache
	CleanCache(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
	// 重载事件过滤器
	// reload_event_filter
	// file 事件过滤器文件路径
	ReloadEventFilter(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error)
	// 下载文件到缓存目录
	// download_file
	// url 文件链接
	// thread_count 线程数
	// headers 请求头
	DownloadFile(context.Context, *DownloadFileRequestGRPC) (*model.DownloadFileResultGRPC, error)
	// 检查链接安全性
	// check_url_safely
	// url 链接
	CheckUrlSafely(context.Context, *wrapperspb.StringValue) (*model.CheckUrlSafelyResultGRPC, error)
	// 获取中文分词 ( 隐藏 API )
	// .get_word_slices
	// content 内容
	HiddenGetWordSlices(context.Context, *wrapperspb.StringValue) (*model.WordSlicesResultGRPC, error)
	// 对事件执行快速操作 ( 隐藏 API )
	// .handle_quick_operation
	// context 事件上下文
	// operation 操作
	HiddenHandleQuickOperation(context.Context, *HiddenHandleQuickOperationRequestGRPC) (*emptypb.Empty, error)
}

OnebotApiCqhttpGRPCServiceServer is the server API for OnebotApiCqhttpGRPCService service.

type UnimplementedOnebotApiCqhttpGRPCServiceServer

type UnimplementedOnebotApiCqhttpGRPCServiceServer struct {
}

UnimplementedOnebotApiCqhttpGRPCServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) CheckUrlSafely

func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) CleanCache

func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) DownloadFile

func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) GetCookies

func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) GetCredentials

func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) GetCsrfToken

func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) GetStatus

func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) GetVersionInfo

func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) HiddenGetWordSlices

func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) HiddenHandleQuickOperation

func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) ReloadEventFilter

func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) SetRestart

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL