Apply formatting and minor style fixes across repo
Normalize code style across multiple packages: whitespace cleanup, consistent commas and trailing commas in arrays/enums/objects, fix table markdown lines in CI comment template, ensure newline at EOF, normalize header/object property quoting and spacing, remove stray blank lines and minor non-functional comment tweaks. These are formatting-only changes and small type/annotation spacing adjustments; no functional behavior changes intended.
This commit is contained in:
1 parent
d2d0b258bc
commit
974528fe7e
176 files changed
+1004
-870
No files matched your search
@@ -84,8 +84,8 @@ export function generateBuildingComment (prSha: string, targets: string[]): stri
|
|||||||
'',
|
'',
|
||||||
'## 📋 构建信息',
|
'## 📋 构建信息',
|
||||||
'',
|
'',
|
||||||
`| 项目 | 值 |`,
|
'| 项目 | 值 |',
|
||||||
`| :--- | :--- |`,
|
'| :--- | :--- |',
|
||||||
`| 📝 提交 | \`${shortSha}\` |`,
|
`| 📝 提交 | \`${shortSha}\` |`,
|
||||||
`| 🕐 开始时间 | ${time} |`,
|
`| 🕐 开始时间 | ${time} |`,
|
||||||
'',
|
'',
|
||||||
@@ -165,8 +165,8 @@ export function generateResultComment (
|
|||||||
'',
|
'',
|
||||||
'## 📋 构建信息',
|
'## 📋 构建信息',
|
||||||
'',
|
'',
|
||||||
`| 项目 | 值 |`,
|
'| 项目 | 值 |',
|
||||||
`| :--- | :--- |`,
|
'| :--- | :--- |',
|
||||||
...(version ? [`| 🏷️ 版本号 | \`${version}\` |`] : []),
|
...(version ? [`| 🏷️ 版本号 | \`${version}\` |`] : []),
|
||||||
`| 📝 提交 | \`${shortSha}\` |`,
|
`| 📝 提交 | \`${shortSha}\` |`,
|
||||||
`| 🔗 构建日志 | [查看详情](${runUrl}) |`,
|
`| 🔗 构建日志 | [查看详情](${runUrl}) |`,
|
||||||
@@ -179,7 +179,7 @@ export function generateResultComment (
|
|||||||
lines.push('', '---', '', '## ⚠️ 错误详情', '');
|
lines.push('', '---', '', '## ⚠️ 错误详情', '');
|
||||||
for (const target of failedTargets) {
|
for (const target of failedTargets) {
|
||||||
lines.push(
|
lines.push(
|
||||||
`<details>`,
|
'<details>',
|
||||||
`<summary>🔴 <b>${target.name}</b> 构建错误</summary>`,
|
`<summary>🔴 <b>${target.name}</b> 构建错误</summary>`,
|
||||||
'',
|
'',
|
||||||
'```',
|
'```',
|
||||||
@@ -228,4 +228,3 @@ export function generateResultComment (
|
|||||||
|
|
||||||
return lines.join('\n');
|
return lines.join('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -165,7 +165,7 @@ function httpDownloadWithProxy (url: string, headers: Record<string, string>, pr
|
|||||||
method: 'CONNECT',
|
method: 'CONNECT',
|
||||||
path: `${targetUrl.hostname}:${targetUrl.port || 443}`,
|
path: `${targetUrl.hostname}:${targetUrl.port || 443}`,
|
||||||
headers: {
|
headers: {
|
||||||
'Host': `${targetUrl.hostname}:${targetUrl.port || 443}`,
|
Host: `${targetUrl.hostname}:${targetUrl.port || 443}`,
|
||||||
...proxyAuthHeader,
|
...proxyAuthHeader,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -179,7 +179,7 @@ function httpDownloadWithProxy (url: string, headers: Record<string, string>, pr
|
|||||||
|
|
||||||
// 在隧道上建立 TLS 连接
|
// 在隧道上建立 TLS 连接
|
||||||
const tlsSocket = tls.connect({
|
const tlsSocket = tls.connect({
|
||||||
socket: socket,
|
socket,
|
||||||
servername: targetUrl.hostname,
|
servername: targetUrl.hostname,
|
||||||
rejectUnauthorized: true,
|
rejectUnauthorized: true,
|
||||||
}, () => {
|
}, () => {
|
||||||
@@ -187,8 +187,8 @@ function httpDownloadWithProxy (url: string, headers: Record<string, string>, pr
|
|||||||
const requestPath = targetUrl.pathname + targetUrl.search;
|
const requestPath = targetUrl.pathname + targetUrl.search;
|
||||||
const requestHeaders = {
|
const requestHeaders = {
|
||||||
...headers,
|
...headers,
|
||||||
'Host': targetUrl.hostname,
|
Host: targetUrl.hostname,
|
||||||
'Connection': 'close',
|
Connection: 'close',
|
||||||
};
|
};
|
||||||
|
|
||||||
const headerLines = Object.entries(requestHeaders)
|
const headerLines = Object.entries(requestHeaders)
|
||||||
@@ -282,7 +282,7 @@ function httpDownloadWithProxy (url: string, headers: Record<string, string>, pr
|
|||||||
path: url, // 完整 URL
|
path: url, // 完整 URL
|
||||||
headers: {
|
headers: {
|
||||||
...headers,
|
...headers,
|
||||||
'Host': targetUrl.hostname,
|
Host: targetUrl.hostname,
|
||||||
...proxyAuthHeader,
|
...proxyAuthHeader,
|
||||||
},
|
},
|
||||||
}, (response) => {
|
}, (response) => {
|
||||||
|
|||||||
@@ -253,7 +253,6 @@ export async function getAllTags (mirror?: string): Promise<{ tags: string[], mi
|
|||||||
return getAllTagsFromMirror('NapNeko', 'NapCatQQ', mirror);
|
return getAllTagsFromMirror('NapNeko', 'NapCatQQ', mirror);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export async function getLatestTag (mirror?: string): Promise<string> {
|
export async function getLatestTag (mirror?: string): Promise<string> {
|
||||||
const { tags } = await getAllTags(mirror);
|
const { tags } = await getAllTags(mirror);
|
||||||
|
|
||||||
|
|||||||
@@ -271,8 +271,6 @@ async function performMirrorTest (): Promise<string[]> {
|
|||||||
.sort((a, b) => a.latency - b.latency)
|
.sort((a, b) => a.latency - b.latency)
|
||||||
.map(r => r.mirror);
|
.map(r => r.mirror);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 至少返回原始 URL
|
// 至少返回原始 URL
|
||||||
if (successfulMirrors.length === 0) {
|
if (successfulMirrors.length === 0) {
|
||||||
return [''];
|
return [''];
|
||||||
@@ -287,7 +285,6 @@ async function performMirrorTest (): Promise<string[]> {
|
|||||||
export function clearMirrorCache (): void {
|
export function clearMirrorCache (): void {
|
||||||
cachedFastMirrors = null;
|
cachedFastMirrors = null;
|
||||||
cacheTimestamp = 0;
|
cacheTimestamp = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -725,7 +722,7 @@ export async function getGitHubRelease (
|
|||||||
const response = await PromiseTimer(
|
const response = await PromiseTimer(
|
||||||
RequestUtil.HttpGetJson<any>(url, 'GET', undefined, {
|
RequestUtil.HttpGetJson<any>(url, 'GET', undefined, {
|
||||||
'User-Agent': 'NapCat',
|
'User-Agent': 'NapCat',
|
||||||
'Accept': 'application/vnd.github.v3+json',
|
Accept: 'application/vnd.github.v3+json',
|
||||||
}),
|
}),
|
||||||
currentConfig.timeout
|
currentConfig.timeout
|
||||||
);
|
);
|
||||||
@@ -958,7 +955,7 @@ async function getWorkflowRunsFromHtml (
|
|||||||
allRuns.push({
|
allRuns.push({
|
||||||
id,
|
id,
|
||||||
created_at: timeMatch[1],
|
created_at: timeMatch[1],
|
||||||
title: title.trim()
|
title: title.trim(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1042,7 +1039,6 @@ async function getArtifactsFromNightlyLink (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return { artifacts, mirror: runsMirror };
|
return { artifacts, mirror: runsMirror };
|
||||||
|
|
||||||
} catch {
|
} catch {
|
||||||
return { artifacts: [], mirror: '' };
|
return { artifacts: [], mirror: '' };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ export class NTQQOnlineApi {
|
|||||||
fileElement: {
|
fileElement: {
|
||||||
fileName: actualFolderName,
|
fileName: actualFolderName,
|
||||||
filePath: folderPath,
|
filePath: folderPath,
|
||||||
fileSize: "",
|
fileSize: '',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -164,8 +164,6 @@ export class NTQQWebApi {
|
|||||||
imgWidth: number = 540,
|
imgWidth: number = 540,
|
||||||
imgHeight: number = 300
|
imgHeight: number = 300
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
|
||||||
const cookieObject = await this.core.apis.UserApi.getCookies('qun.qq.com');
|
const cookieObject = await this.core.apis.UserApi.getCookies('qun.qq.com');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -212,7 +212,7 @@ export enum UploadSceneType {
|
|||||||
KUPLOADSCENEH5LAUNCHCLIENTSHORTCUTKEYCTRLCV,
|
KUPLOADSCENEH5LAUNCHCLIENTSHORTCUTKEYCTRLCV,
|
||||||
KUPLOADSCENEAIODRAG,
|
KUPLOADSCENEAIODRAG,
|
||||||
KUPLOADSCENEAIOFILESELECTOR,
|
KUPLOADSCENEAIOFILESELECTOR,
|
||||||
KUPLOADSCENEAIOSHORTCUTKEYCTRLCV
|
KUPLOADSCENEAIOSHORTCUTKEYCTRLCV,
|
||||||
}
|
}
|
||||||
export interface StartFlashTaskRequests {
|
export interface StartFlashTaskRequests {
|
||||||
screen: number; // 1 PC-QQ
|
screen: number; // 1 PC-QQ
|
||||||
@@ -237,7 +237,7 @@ export interface StartFlashTaskRequests {
|
|||||||
}
|
}
|
||||||
export enum BusiScene {
|
export enum BusiScene {
|
||||||
KBUSISCENEINVALID,
|
KBUSISCENEINVALID,
|
||||||
KBUSISCENEFLASHSCENE
|
KBUSISCENEFLASHSCENE,
|
||||||
}
|
}
|
||||||
export interface FileListInfoRequests {
|
export interface FileListInfoRequests {
|
||||||
seq: number, // 0
|
seq: number, // 0
|
||||||
@@ -274,7 +274,7 @@ export enum DownloadSceneType {
|
|||||||
KDOWNLOADSCENELINKOTHERINQQ,
|
KDOWNLOADSCENELINKOTHERINQQ,
|
||||||
KDOWNLOADSCENESCANQRCODE,
|
KDOWNLOADSCENESCANQRCODE,
|
||||||
KDWONLOADSCENEFLASHTRANSFERCENTERCLIENT,
|
KDWONLOADSCENEFLASHTRANSFERCENTERCLIENT,
|
||||||
KDWONLOADSCENEFLASHTRANSFERCENTERSCHEMA
|
KDWONLOADSCENEFLASHTRANSFERCENTERSCHEMA,
|
||||||
}
|
}
|
||||||
export interface FlashFileSetInfo {
|
export interface FlashFileSetInfo {
|
||||||
fileSetId: string,
|
fileSetId: string,
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export async function encodeSilk (filePath: string, TEMP_DIR: string, logger: Lo
|
|||||||
return {
|
return {
|
||||||
converted: true,
|
converted: true,
|
||||||
path: pttPath,
|
path: pttPath,
|
||||||
duration: duration,
|
duration,
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
let duration = 0;
|
let duration = 0;
|
||||||
|
|||||||
@@ -64,10 +64,12 @@ export class FFmpegService {
|
|||||||
}
|
}
|
||||||
return this.adapter;
|
return this.adapter;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async convertToNTSilkTct (inputFile: string, outputFile: string): Promise<void> {
|
public static async convertToNTSilkTct (inputFile: string, outputFile: string): Promise<void> {
|
||||||
const adapter = await this.getAdapter();
|
const adapter = await this.getAdapter();
|
||||||
await adapter.convertToNTSilkTct(inputFile, outputFile);
|
await adapter.convertToNTSilkTct(inputFile, outputFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置 FFmpeg 路径并更新适配器
|
* 设置 FFmpeg 路径并更新适配器
|
||||||
* @deprecated 建议使用 init() 方法初始化
|
* @deprecated 建议使用 init() 方法初始化
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ export class ForwardMsgBuilder {
|
|||||||
news,
|
news,
|
||||||
summary,
|
summary,
|
||||||
prompt,
|
prompt,
|
||||||
uuid,
|
uuid
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,13 +6,13 @@ import { NTEventWrapper } from './event';
|
|||||||
* 创建 Service 方法的代理
|
* 创建 Service 方法的代理
|
||||||
* 拦截所有方法调用,通过 EventWrapper 进行调用
|
* 拦截所有方法调用,通过 EventWrapper 进行调用
|
||||||
*/
|
*/
|
||||||
function createServiceMethodProxy<S extends keyof ServiceNamingMapping>(
|
function createServiceMethodProxy<S extends keyof ServiceNamingMapping> (
|
||||||
serviceName: S,
|
serviceName: S,
|
||||||
originalService: ServiceNamingMapping[S],
|
originalService: ServiceNamingMapping[S],
|
||||||
eventWrapper: NTEventWrapper
|
eventWrapper: NTEventWrapper
|
||||||
): ServiceNamingMapping[S] {
|
): ServiceNamingMapping[S] {
|
||||||
return new Proxy(originalService as object, {
|
return new Proxy(originalService as object, {
|
||||||
get(target, prop, receiver) {
|
get (target, prop, receiver) {
|
||||||
const originalValue = Reflect.get(target, prop, receiver);
|
const originalValue = Reflect.get(target, prop, receiver);
|
||||||
|
|
||||||
// 如果不是函数,直接返回原始值
|
// 如果不是函数,直接返回原始值
|
||||||
@@ -50,7 +50,7 @@ function createServiceMethodProxy<S extends keyof ServiceNamingMapping>(
|
|||||||
* 第一层:拦截 getXXXService 方法
|
* 第一层:拦截 getXXXService 方法
|
||||||
* 第二层:拦截 Service 上的具体方法调用
|
* 第二层:拦截 Service 上的具体方法调用
|
||||||
*/
|
*/
|
||||||
export function createSessionProxy(
|
export function createSessionProxy (
|
||||||
session: NodeIQQNTWrapperSession,
|
session: NodeIQQNTWrapperSession,
|
||||||
eventWrapper: NTEventWrapper
|
eventWrapper: NTEventWrapper
|
||||||
): NodeIQQNTWrapperSession {
|
): NodeIQQNTWrapperSession {
|
||||||
@@ -58,7 +58,7 @@ export function createSessionProxy(
|
|||||||
const serviceProxyCache = new Map<string, unknown>();
|
const serviceProxyCache = new Map<string, unknown>();
|
||||||
|
|
||||||
return new Proxy(session, {
|
return new Proxy(session, {
|
||||||
get(target, prop, receiver) {
|
get (target, prop, receiver) {
|
||||||
const propName = prop as string;
|
const propName = prop as string;
|
||||||
|
|
||||||
// 检查是否是 getXXXService 方法
|
// 检查是否是 getXXXService 方法
|
||||||
@@ -105,7 +105,7 @@ export function createSessionProxy(
|
|||||||
/**
|
/**
|
||||||
* 检查 Service 名称是否在已知的映射中
|
* 检查 Service 名称是否在已知的映射中
|
||||||
*/
|
*/
|
||||||
function isKnownService(serviceName: string): serviceName is keyof ServiceNamingMapping {
|
function isKnownService (serviceName: string): serviceName is keyof ServiceNamingMapping {
|
||||||
const knownServices: string[] = [
|
const knownServices: string[] = [
|
||||||
'NodeIKernelAvatarService',
|
'NodeIKernelAvatarService',
|
||||||
'NodeIKernelBuddyService',
|
'NodeIKernelBuddyService',
|
||||||
@@ -132,7 +132,7 @@ function isKnownService(serviceName: string): serviceName is keyof ServiceNaming
|
|||||||
* 创建带有 EventWrapper 集成的 InstanceContext
|
* 创建带有 EventWrapper 集成的 InstanceContext
|
||||||
* 这是推荐的使用方式,在创建 context 时自动代理 session
|
* 这是推荐的使用方式,在创建 context 时自动代理 session
|
||||||
*/
|
*/
|
||||||
export function createProxiedSession(
|
export function createProxiedSession (
|
||||||
session: NodeIQQNTWrapperSession,
|
session: NodeIQQNTWrapperSession,
|
||||||
eventWrapper: NTEventWrapper
|
eventWrapper: NTEventWrapper
|
||||||
): NodeIQQNTWrapperSession {
|
): NodeIQQNTWrapperSession {
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ export class NodeIKernelLoginListener {
|
|||||||
|
|
||||||
onLoginState (..._args: any[]): any {
|
onLoginState (..._args: any[]): any {
|
||||||
}
|
}
|
||||||
|
|
||||||
onLoginRecordUpdate (..._args: any[]): any {
|
onLoginRecordUpdate (..._args: any[]): any {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -228,8 +228,9 @@ export class PacketOperationContext {
|
|||||||
const res = trans.UploadForwardMsg.parse(resp);
|
const res = trans.UploadForwardMsg.parse(resp);
|
||||||
return res.result.resId;
|
return res.result.resId;
|
||||||
}
|
}
|
||||||
|
|
||||||
async UploadForwardMsgV2 (msg: UploadForwardMsgParams[], groupUin: number = 0) {
|
async UploadForwardMsgV2 (msg: UploadForwardMsgParams[], groupUin: number = 0) {
|
||||||
//await this.SendPreprocess(msg, groupUin);
|
// await this.SendPreprocess(msg, groupUin);
|
||||||
// 遍历上传资源(跳过已有原始数据的项)
|
// 遍历上传资源(跳过已有原始数据的项)
|
||||||
await Promise.allSettled(msg.filter(item => item.actionMsg).map(async (item) => { return await this.SendPreprocess(item.actionMsg!, groupUin); }));
|
await Promise.allSettled(msg.filter(item => item.actionMsg).map(async (item) => { return await this.SendPreprocess(item.actionMsg!, groupUin); }));
|
||||||
const req = trans.UploadForwardMsgV2.build(this.context.napcore.basicInfo.uid, msg, groupUin);
|
const req = trans.UploadForwardMsgV2.build(this.context.napcore.basicInfo.uid, msg, groupUin);
|
||||||
@@ -237,6 +238,7 @@ export class PacketOperationContext {
|
|||||||
const res = trans.UploadForwardMsg.parse(resp);
|
const res = trans.UploadForwardMsg.parse(resp);
|
||||||
return res.result.resId;
|
return res.result.resId;
|
||||||
}
|
}
|
||||||
|
|
||||||
async MoveGroupFile (
|
async MoveGroupFile (
|
||||||
groupUin: number,
|
groupUin: number,
|
||||||
fileUUID: string,
|
fileUUID: string,
|
||||||
|
|||||||
@@ -511,14 +511,14 @@ export class PacketMsgPttElement extends IPacketMsgElement<SendPttElement> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override buildElement (): NapProtoEncodeStructType<typeof Elem>[] {
|
override buildElement (): NapProtoEncodeStructType<typeof Elem>[] {
|
||||||
//return [];
|
// return [];
|
||||||
if (!this.msgInfo) return [];
|
if (!this.msgInfo) return [];
|
||||||
return [{
|
return [{
|
||||||
commonElem: {
|
commonElem: {
|
||||||
serviceType: 48,
|
serviceType: 48,
|
||||||
pbElem: new NapProtoMsg(MsgInfo).encode(this.msgInfo),
|
pbElem: new NapProtoMsg(MsgInfo).encode(this.msgInfo),
|
||||||
businessType: 22,
|
businessType: 22,
|
||||||
}
|
},
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class UploadForwardMsgV2 extends PacketTransformer<typeof proto.SendLongMsgResp>
|
|||||||
actionCommand: item.actionCommand,
|
actionCommand: item.actionCommand,
|
||||||
actionData: {
|
actionData: {
|
||||||
msgBody: item.actionMsgBody ?? this.msgBuilder.buildFakeMsg(selfUid, item.actionMsg ?? []),
|
msgBody: item.actionMsgBody ?? this.msgBuilder.buildFakeMsg(selfUid, item.actionMsg ?? []),
|
||||||
}
|
},
|
||||||
}));
|
}));
|
||||||
const longMsgResultData = new NapProtoMsg(proto.LongMsgResult).encode(
|
const longMsgResultData = new NapProtoMsg(proto.LongMsgResult).encode(
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export interface NodeIKernelStorageCleanService {
|
|||||||
// "C:\\Users\\nanaeo\\AppData\\Roaming\\QQ\\Partitions\\qqnt_9212"
|
// "C:\\Users\\nanaeo\\AppData\\Roaming\\QQ\\Partitions\\qqnt_9212"
|
||||||
// ]
|
// ]
|
||||||
// ]
|
// ]
|
||||||
addCacheScanedPaths (paths: Map<`tmp` | `SilentCacheappSessionPartation9212` | `hotUpdate`, unknown>): unknown;
|
addCacheScanedPaths (paths: Map<'tmp' | 'SilentCacheappSessionPartation9212' | 'hotUpdate', unknown>): unknown;
|
||||||
|
|
||||||
addFilesScanedPaths (arg: unknown): unknown;
|
addFilesScanedPaths (arg: unknown): unknown;
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ type SQLInputValue = import('node:sqlite').SQLInputValue;
|
|||||||
let _DatabaseSync: DatabaseSyncCtor | null = null;
|
let _DatabaseSync: DatabaseSyncCtor | null = null;
|
||||||
let _sqliteChecked = false;
|
let _sqliteChecked = false;
|
||||||
|
|
||||||
|
|
||||||
async function loadSqlite (): Promise<DatabaseSyncCtor | null> {
|
async function loadSqlite (): Promise<DatabaseSyncCtor | null> {
|
||||||
if (_sqliteChecked) return _DatabaseSync;
|
if (_sqliteChecked) return _DatabaseSync;
|
||||||
_sqliteChecked = true;
|
_sqliteChecked = true;
|
||||||
@@ -299,7 +298,6 @@ export function listTablesFromFile (filePath: string): TableInfo[] {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export function listTablesFromBuffer (data: Buffer): TableInfo[] {
|
export function listTablesFromBuffer (data: Buffer): TableInfo[] {
|
||||||
const tmpPath = path.join(os.tmpdir(), `napcat_db_${Date.now()}_${Math.random().toString(36).slice(2)}.db`);
|
const tmpPath = path.join(os.tmpdir(), `napcat_db_${Date.now()}_${Math.random().toString(36).slice(2)}.db`);
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -47,12 +47,12 @@ const itemsToCopy = [
|
|||||||
'package.json',
|
'package.json',
|
||||||
'QBar.dll',
|
'QBar.dll',
|
||||||
'wrapper.node',
|
'wrapper.node',
|
||||||
'LightQuic.dll'
|
'LightQuic.dll',
|
||||||
];
|
];
|
||||||
|
|
||||||
const win64ItemsToCopy = [
|
const win64ItemsToCopy = [
|
||||||
'SSOShareInfoHelper64.dll',
|
'SSOShareInfoHelper64.dll',
|
||||||
'parent-ipc-core-x64.dll'
|
'parent-ipc-core-x64.dll',
|
||||||
];
|
];
|
||||||
|
|
||||||
async function copyAll () {
|
async function copyAll () {
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ export async function NCoreInitFramework (
|
|||||||
const nativePacketHandler = new NativePacketHandler({ logger }); // 初始化 NativePacketHandler 用于后续使用
|
const nativePacketHandler = new NativePacketHandler({ logger }); // 初始化 NativePacketHandler 用于后续使用
|
||||||
const napi2nativeLoader = new Napi2NativeLoader({ logger }); // 初始化 Napi2NativeLoader 用于后续使用
|
const napi2nativeLoader = new Napi2NativeLoader({ logger }); // 初始化 Napi2NativeLoader 用于后续使用
|
||||||
const napcatConfig = loadNapcatConfig(pathWrapper.configPath);
|
const napcatConfig = loadNapcatConfig(pathWrapper.configPath);
|
||||||
//console.log('[NapCat] [Napi2NativeLoader]', napi2nativeLoader.nativeExports.enableAllBypasses?.());
|
// console.log('[NapCat] [Napi2NativeLoader]', napi2nativeLoader.nativeExports.enableAllBypasses?.());
|
||||||
if (process.env['NAPCAT_DISABLE_BYPASS'] !== '1') {
|
if (process.env['NAPCAT_DISABLE_BYPASS'] !== '1') {
|
||||||
const bypassOptions = napcatConfig.bypass ?? {};
|
const bypassOptions = napcatConfig.bypass ?? {};
|
||||||
const bypassEnabled = napi2nativeLoader.nativeExports.enableAllBypasses?.(bypassOptions);
|
const bypassEnabled = napi2nativeLoader.nativeExports.enableAllBypasses?.(bypassOptions);
|
||||||
@@ -60,7 +60,7 @@ export async function NCoreInitFramework (
|
|||||||
// nativePacketHandler.onAll((packet) => {
|
// nativePacketHandler.onAll((packet) => {
|
||||||
// console.log('[Packet]', packet.uin, packet.cmd, packet.hex_data);
|
// console.log('[Packet]', packet.uin, packet.cmd, packet.hex_data);
|
||||||
// });
|
// });
|
||||||
await nativePacketHandler.init(basicInfoWrapper.getFullQQVersion(), napcatConfig.o3HookMode === 1 ? true : false);
|
await nativePacketHandler.init(basicInfoWrapper.getFullQQVersion(), napcatConfig.o3HookMode === 1);
|
||||||
// 在 init 之后注册监听器
|
// 在 init 之后注册监听器
|
||||||
|
|
||||||
// 登录前监听 OidbSvcTrpcTcp.0xcde_2 数据包,获取数据库 passphrase
|
// 登录前监听 OidbSvcTrpcTcp.0xcde_2 数据包,获取数据库 passphrase
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ function bufferToReadStream (buffer: Buffer): ReadStream {
|
|||||||
read () {
|
read () {
|
||||||
this.push(buffer);
|
this.push(buffer);
|
||||||
this.push(null);
|
this.push(null);
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
return readable as unknown as ReadStream;
|
return readable as unknown as ReadStream;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ export class JpegParser implements ImageParser {
|
|||||||
const bufferSize = buffer.length;
|
const bufferSize = buffer.length;
|
||||||
const MIN_REQUIRED_BYTES = 10; // SOF段最低字节数
|
const MIN_REQUIRED_BYTES = 10; // SOF段最低字节数
|
||||||
|
|
||||||
|
|
||||||
// 从JPEG头部后开始扫描
|
// 从JPEG头部后开始扫描
|
||||||
while (offset < bufferSize - MIN_REQUIRED_BYTES) {
|
while (offset < bufferSize - MIN_REQUIRED_BYTES) {
|
||||||
// 寻找FF标记
|
// 寻找FF标记
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ export const ActionExamples = {
|
|||||||
errors: [
|
errors: [
|
||||||
{ code: 1400, description: '请求参数错误或业务逻辑执行失败' },
|
{ code: 1400, description: '请求参数错误或业务逻辑执行失败' },
|
||||||
{ code: 1401, description: '权限不足' },
|
{ code: 1401, description: '权限不足' },
|
||||||
{ code: 1404, description: '资源不存在' }
|
{ code: 1404, description: '资源不存在' },
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export class OB11Response {
|
export class OB11Response {
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ export const ExtendsActionsExamples = {
|
|||||||
{
|
{
|
||||||
type: 'string',
|
type: 'string',
|
||||||
characters: [
|
characters: [
|
||||||
{ character_id: 'id', character_name: 'name', preview_url: 'url' }
|
{ character_id: 'id', character_name: 'name', preview_url: 'url' },
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
GetClientkey: {
|
GetClientkey: {
|
||||||
|
|||||||
@@ -27,10 +27,12 @@ export class ClickInlineKeyboardButton extends OneBotAction<PayloadType, ReturnT
|
|||||||
bot_appid: '1234567890',
|
bot_appid: '1234567890',
|
||||||
button_id: 'btn_1',
|
button_id: 'btn_1',
|
||||||
callback_data: '',
|
callback_data: '',
|
||||||
msg_seq: '10086'
|
msg_seq: '10086',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
};
|
};
|
||||||
|
|
||||||
async _handle (payload: PayloadType) {
|
async _handle (payload: PayloadType) {
|
||||||
return await this.core.apis.MsgApi.clickInlineKeyboardButton({
|
return await this.core.apis.MsgApi.clickInlineKeyboardButton({
|
||||||
buttonId: payload.button_id,
|
buttonId: payload.button_id,
|
||||||
|
|||||||
@@ -21,11 +21,12 @@ export class CreateCollection extends OneBotAction<PayloadType, ReturnType> {
|
|||||||
override actionTags = ['扩展接口'];
|
override actionTags = ['扩展接口'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
rawData: '收藏内容',
|
rawData: '收藏内容',
|
||||||
brief: '收藏标题'
|
brief: '收藏标题',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
result: 0,
|
result: 0,
|
||||||
errMsg: ''
|
errMsg: '',
|
||||||
};
|
};
|
||||||
|
|
||||||
async _handle (payload: PayloadType) {
|
async _handle (payload: PayloadType) {
|
||||||
|
|||||||
@@ -23,9 +23,11 @@ export class DelGroupAlbumMedia extends OneBotAction<PayloadType, ReturnType> {
|
|||||||
album_id: 'album_id_1',
|
album_id: 'album_id_1',
|
||||||
lloc: 'media_id_1',
|
lloc: 'media_id_1',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
result: {}
|
result: {},
|
||||||
};
|
};
|
||||||
|
|
||||||
override payloadSchema = PayloadSchema;
|
override payloadSchema = PayloadSchema;
|
||||||
override returnSchema = ReturnSchema;
|
override returnSchema = ReturnSchema;
|
||||||
|
|
||||||
|
|||||||
@@ -19,11 +19,13 @@ export class DoGroupAlbumComment extends OneBotAction<DoGroupAlbumCommentPayload
|
|||||||
group_id: '123456',
|
group_id: '123456',
|
||||||
album_id: 'album_id_1',
|
album_id: 'album_id_1',
|
||||||
lloc: 'media_id_1',
|
lloc: 'media_id_1',
|
||||||
content: '很有意思'
|
content: '很有意思',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
result: {}
|
result: {},
|
||||||
};
|
};
|
||||||
|
|
||||||
override payloadSchema = DoGroupAlbumCommentPayloadSchema;
|
override payloadSchema = DoGroupAlbumCommentPayloadSchema;
|
||||||
override returnSchema = Type.Any({ description: '评论结果' });
|
override returnSchema = Type.Any({ description: '评论结果' });
|
||||||
|
|
||||||
|
|||||||
@@ -19,10 +19,11 @@ export class FetchCustomFace extends OneBotAction<PayloadType, ReturnType> {
|
|||||||
override actionSummary = '获取自定义表情';
|
override actionSummary = '获取自定义表情';
|
||||||
override actionTags = ['系统扩展'];
|
override actionTags = ['系统扩展'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
count: 10
|
count: 10,
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = [
|
override returnExample = [
|
||||||
'http://example.com/face1.png'
|
'http://example.com/face1.png',
|
||||||
];
|
];
|
||||||
|
|
||||||
async _handle (payload: PayloadType) {
|
async _handle (payload: PayloadType) {
|
||||||
@@ -30,4 +31,3 @@ export class FetchCustomFace extends OneBotAction<PayloadType, ReturnType> {
|
|||||||
return ret.emojiInfoList.map(e => e.url);
|
return ret.emojiInfoList.map(e => e.url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8,7 +8,7 @@ const PayloadSchema = Type.Object({
|
|||||||
emojiId: Type.Union([Type.Number(), Type.String()], { description: '表情ID' }),
|
emojiId: Type.Union([Type.Number(), Type.String()], { description: '表情ID' }),
|
||||||
emojiType: Type.Union([Type.Number(), Type.String()], { description: '表情类型' }),
|
emojiType: Type.Union([Type.Number(), Type.String()], { description: '表情类型' }),
|
||||||
count: Type.Union([Type.Number(), Type.String()], { default: 20, description: '获取数量' }),
|
count: Type.Union([Type.Number(), Type.String()], { default: 20, description: '获取数量' }),
|
||||||
cookie: Type.String({ default: '', description: '分页Cookie' })
|
cookie: Type.String({ default: '', description: '分页Cookie' }),
|
||||||
});
|
});
|
||||||
|
|
||||||
type PayloadType = Static<typeof PayloadSchema>;
|
type PayloadType = Static<typeof PayloadSchema>;
|
||||||
@@ -37,22 +37,24 @@ export class FetchEmojiLike extends OneBotAction<PayloadType, ReturnType> {
|
|||||||
emojiId: '123',
|
emojiId: '123',
|
||||||
emojiType: 1,
|
emojiType: 1,
|
||||||
count: 10,
|
count: 10,
|
||||||
cookie: ''
|
cookie: '',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
emojiLikesList: [
|
emojiLikesList: [
|
||||||
{
|
{
|
||||||
tinyId: '123456',
|
tinyId: '123456',
|
||||||
nickName: '测试用户',
|
nickName: '测试用户',
|
||||||
headUrl: 'http://example.com/avatar.png'
|
headUrl: 'http://example.com/avatar.png',
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
cookie: '',
|
cookie: '',
|
||||||
isLastPage: true,
|
isLastPage: true,
|
||||||
isFirstPage: true,
|
isFirstPage: true,
|
||||||
result: 0,
|
result: 0,
|
||||||
errMsg: ''
|
errMsg: '',
|
||||||
};
|
};
|
||||||
|
|
||||||
override payloadSchema = PayloadSchema;
|
override payloadSchema = PayloadSchema;
|
||||||
override returnSchema = ReturnSchema;
|
override returnSchema = ReturnSchema;
|
||||||
|
|
||||||
|
|||||||
@@ -21,32 +21,33 @@ export class GetCollectionList extends OneBotAction<PayloadType, ReturnType> {
|
|||||||
override actionTags = ['系统扩展'];
|
override actionTags = ['系统扩展'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
category: '0',
|
category: '0',
|
||||||
count: '50'
|
count: '50',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
errCode: 0,
|
errCode: 0,
|
||||||
errMsg: "",
|
errMsg: '',
|
||||||
collectionSearchList: {
|
collectionSearchList: {
|
||||||
collectionItemList: [
|
collectionItemList: [
|
||||||
{
|
{
|
||||||
cid: "123456",
|
cid: '123456',
|
||||||
type: 8,
|
type: 8,
|
||||||
status: 1,
|
status: 1,
|
||||||
author: {
|
author: {
|
||||||
type: 2,
|
type: 2,
|
||||||
numId: "123456",
|
numId: '123456',
|
||||||
strId: "昵称",
|
strId: '昵称',
|
||||||
groupId: "123456",
|
groupId: '123456',
|
||||||
groupName: "群名",
|
groupName: '群名',
|
||||||
uid: "123456"
|
uid: '123456',
|
||||||
},
|
},
|
||||||
bid: 1,
|
bid: 1,
|
||||||
category: 1,
|
category: 1,
|
||||||
createTime: "1769169157000",
|
createTime: '1769169157000',
|
||||||
collectTime: "1769413477691",
|
collectTime: '1769413477691',
|
||||||
modifyTime: "1769413477691",
|
modifyTime: '1769413477691',
|
||||||
sequence: "1769413476735",
|
sequence: '1769413476735',
|
||||||
shareUrl: "",
|
shareUrl: '',
|
||||||
customGroupId: 0,
|
customGroupId: 0,
|
||||||
securityBeat: false,
|
securityBeat: false,
|
||||||
summary: {
|
summary: {
|
||||||
@@ -58,21 +59,21 @@ export class GetCollectionList extends OneBotAction<PayloadType, ReturnType> {
|
|||||||
fileSummary: null,
|
fileSummary: null,
|
||||||
locationSummary: null,
|
locationSummary: null,
|
||||||
richMediaSummary: {
|
richMediaSummary: {
|
||||||
title: "",
|
title: '',
|
||||||
subTitle: "",
|
subTitle: '',
|
||||||
brief: "text",
|
brief: 'text',
|
||||||
picList: [],
|
picList: [],
|
||||||
contentType: 1,
|
contentType: 1,
|
||||||
originalUri: "",
|
originalUri: '',
|
||||||
publisher: "",
|
publisher: '',
|
||||||
richMediaVersion: 0
|
richMediaVersion: 0,
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
hasMore: false,
|
hasMore: false,
|
||||||
bottomTimeStamp: "1769413477691"
|
bottomTimeStamp: '1769413477691',
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
async _handle (payload: PayloadType) {
|
async _handle (payload: PayloadType) {
|
||||||
|
|||||||
@@ -30,16 +30,18 @@ export class GetEmojiLikes extends OneBotAction<PayloadType, ReturnType> {
|
|||||||
override actionTags = ['消息扩展'];
|
override actionTags = ['消息扩展'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
message_id: '12345',
|
message_id: '12345',
|
||||||
emoji_id: '123'
|
emoji_id: '123',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
emoji_like_list: [
|
emoji_like_list: [
|
||||||
{
|
{
|
||||||
user_id: '654321',
|
user_id: '654321',
|
||||||
nick_name: '测试用户'
|
nick_name: '测试用户',
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
override payloadSchema = PayloadSchema;
|
override payloadSchema = PayloadSchema;
|
||||||
override returnSchema = ReturnSchema;
|
override returnSchema = ReturnSchema;
|
||||||
|
|
||||||
@@ -64,7 +66,7 @@ export class GetEmojiLikes extends OneBotAction<PayloadType, ReturnType> {
|
|||||||
const emojiType = payload.emoji_type ?? (payload.emoji_id.length > 3 ? '2' : '1');
|
const emojiType = payload.emoji_type ?? (payload.emoji_id.length > 3 ? '2' : '1');
|
||||||
const emojiLikeList: Array<{ user_id: string; nick_name: string; }> = [];
|
const emojiLikeList: Array<{ user_id: string; nick_name: string; }> = [];
|
||||||
let cookie = '';
|
let cookie = '';
|
||||||
let needFetchCount = payload.count == 0 ? 200 : Math.ceil(payload.count / 15);
|
const needFetchCount = payload.count == 0 ? 200 : Math.ceil(payload.count / 15);
|
||||||
for (let page = 0; page < needFetchCount; page++) {
|
for (let page = 0; page < needFetchCount; page++) {
|
||||||
const res = await this.core.apis.MsgApi.getMsgEmojiLikesList(
|
const res = await this.core.apis.MsgApi.getMsgEmojiLikesList(
|
||||||
peer, msg.msgSeq, payload.emoji_id.toString(), emojiType, cookie, 15
|
peer, msg.msgSeq, payload.emoji_id.toString(), emojiType, cookie, 15
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ export class GetFriendWithCategory extends OneBotAction<void, ReturnType> {
|
|||||||
categoryId: 1,
|
categoryId: 1,
|
||||||
categoryName: '我的好友',
|
categoryName: '我的好友',
|
||||||
categoryMbCount: 1,
|
categoryMbCount: 1,
|
||||||
buddyList: []
|
buddyList: [],
|
||||||
}
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
async _handle () {
|
async _handle () {
|
||||||
|
|||||||
@@ -37,8 +37,8 @@ export default class GetGroupAddRequest extends OneBotAction<void, ReturnType> {
|
|||||||
group_name: '群名称',
|
group_name: '群名称',
|
||||||
checked: false,
|
checked: false,
|
||||||
actor: 0,
|
actor: 0,
|
||||||
requester_nick: '请求者'
|
requester_nick: '请求者',
|
||||||
}
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
async _handle (): Promise<ReturnType> {
|
async _handle (): Promise<ReturnType> {
|
||||||
|
|||||||
@@ -22,11 +22,13 @@ export class GetGroupAlbumMediaList extends OneBotAction<PayloadType, ReturnType
|
|||||||
group_id: '123456',
|
group_id: '123456',
|
||||||
album_id: 'album_id_1',
|
album_id: 'album_id_1',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
media_list: [
|
media_list: [
|
||||||
{ media_id: 'media_id_1', url: 'http://example.com/1.jpg' }
|
{ media_id: 'media_id_1', url: 'http://example.com/1.jpg' },
|
||||||
]
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
override payloadSchema = PayloadSchema;
|
override payloadSchema = PayloadSchema;
|
||||||
override returnSchema = ReturnSchema;
|
override returnSchema = ReturnSchema;
|
||||||
|
|
||||||
|
|||||||
@@ -16,11 +16,13 @@ export class GetGroupInfoEx extends OneBotAction<PayloadType, ReturnType> {
|
|||||||
override actionSummary = '获取群详细信息 (扩展)';
|
override actionSummary = '获取群详细信息 (扩展)';
|
||||||
override actionTags = ['群组扩展'];
|
override actionTags = ['群组扩展'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
group_id: '123456'
|
group_id: '123456',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
override payloadSchema = PayloadSchema;
|
override payloadSchema = PayloadSchema;
|
||||||
override returnSchema = ReturnSchema;
|
override returnSchema = ReturnSchema;
|
||||||
|
|
||||||
|
|||||||
@@ -52,13 +52,15 @@ export class GetMiniAppArk extends GetPacketStatusDepends<PayloadType, ReturnTyp
|
|||||||
title: '测试标题',
|
title: '测试标题',
|
||||||
desc: '测试描述',
|
desc: '测试描述',
|
||||||
picUrl: 'http://example.com/pic.jpg',
|
picUrl: 'http://example.com/pic.jpg',
|
||||||
jumpUrl: 'http://example.com'
|
jumpUrl: 'http://example.com',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
data: {
|
data: {
|
||||||
ark: 'ark_content'
|
ark: 'ark_content',
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
async _handle (payload: PayloadType) {
|
async _handle (payload: PayloadType) {
|
||||||
let reqParam: MiniAppReqParams;
|
let reqParam: MiniAppReqParams;
|
||||||
const customParams: MiniAppReqCustomParams = {
|
const customParams: MiniAppReqCustomParams = {
|
||||||
|
|||||||
@@ -39,8 +39,9 @@ export class GetProfileLike extends OneBotAction<PayloadType, ReturnType> {
|
|||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
user_id: '123456789',
|
user_id: '123456789',
|
||||||
start: 0,
|
start: 0,
|
||||||
count: 10
|
count: 10,
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
uid: 'u_123',
|
uid: 'u_123',
|
||||||
time: '1734567890',
|
time: '1734567890',
|
||||||
@@ -48,15 +49,15 @@ export class GetProfileLike extends OneBotAction<PayloadType, ReturnType> {
|
|||||||
userInfos: [],
|
userInfos: [],
|
||||||
total_count: 10,
|
total_count: 10,
|
||||||
last_time: 1734567890,
|
last_time: 1734567890,
|
||||||
today_count: 5
|
today_count: 5,
|
||||||
},
|
},
|
||||||
voteInfo: {
|
voteInfo: {
|
||||||
total_count: 100,
|
total_count: 100,
|
||||||
new_count: 2,
|
new_count: 2,
|
||||||
new_nearby_count: 0,
|
new_nearby_count: 0,
|
||||||
last_visit_time: 1734567890,
|
last_visit_time: 1734567890,
|
||||||
userInfos: []
|
userInfos: [],
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
async _handle (payload: PayloadType): Promise<ReturnType> {
|
async _handle (payload: PayloadType): Promise<ReturnType> {
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import { OneBotAction } from '@/napcat-onebot/action/OneBotAction';
|
|||||||
import { ActionName } from '@/napcat-onebot/action/router';
|
import { ActionName } from '@/napcat-onebot/action/router';
|
||||||
import { Static, Type } from '@sinclair/typebox';
|
import { Static, Type } from '@sinclair/typebox';
|
||||||
|
|
||||||
|
|
||||||
const PayloadSchema = Type.Object({
|
const PayloadSchema = Type.Object({
|
||||||
group_id: Type.String({ description: '群号' }),
|
group_id: Type.String({ description: '群号' }),
|
||||||
attach_info: Type.String({ default: '', description: '附加信息(用于分页,从上一次返回结果中获取)' }),
|
attach_info: Type.String({ default: '', description: '附加信息(用于分页,从上一次返回结果中获取)' }),
|
||||||
@@ -26,18 +25,20 @@ export class GetQunAlbumList extends OneBotAction<PayloadType, GetQunAlbumListRe
|
|||||||
group_id: '123456',
|
group_id: '123456',
|
||||||
attach_info: '',
|
attach_info: '',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
album_list: [
|
album_list: [
|
||||||
{
|
{
|
||||||
album_id: 'album_1',
|
album_id: 'album_1',
|
||||||
album_name: '测试相册',
|
album_name: '测试相册',
|
||||||
cover_url: 'http://example.com/cover.jpg',
|
cover_url: 'http://example.com/cover.jpg',
|
||||||
create_time: 1734567890
|
create_time: 1734567890,
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
attach_info: '',
|
attach_info: '',
|
||||||
has_more: false,
|
has_more: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
override payloadSchema = PayloadSchema;
|
override payloadSchema = PayloadSchema;
|
||||||
override returnSchema = ReturnSchema;
|
override returnSchema = ReturnSchema;
|
||||||
|
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ export class GetRkey extends GetPacketStatusDepends<void, ReturnType> {
|
|||||||
override payloadExample = {};
|
override payloadExample = {};
|
||||||
override returnExample = [
|
override returnExample = [
|
||||||
{
|
{
|
||||||
"key": "rkey_value",
|
key: 'rkey_value',
|
||||||
"expired": 1734567890
|
expired: 1734567890,
|
||||||
}
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
async _handle () {
|
async _handle () {
|
||||||
|
|||||||
@@ -12,8 +12,9 @@ export class GetRobotUinRange extends OneBotAction<void, ReturnType> {
|
|||||||
override actionTags = ['系统扩展'];
|
override actionTags = ['系统扩展'];
|
||||||
override payloadExample = {};
|
override payloadExample = {};
|
||||||
override returnExample = [
|
override returnExample = [
|
||||||
{ minUin: '12345678', maxUin: '87654321' }
|
{ minUin: '12345678', maxUin: '87654321' },
|
||||||
];
|
];
|
||||||
|
|
||||||
override payloadSchema = Type.Object({});
|
override payloadSchema = Type.Object({});
|
||||||
override returnSchema = ReturnSchema;
|
override returnSchema = ReturnSchema;
|
||||||
|
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ export class GetUnidirectionalFriendList extends OneBotAction<void, ReturnType>
|
|||||||
uid: 'u_123',
|
uid: 'u_123',
|
||||||
nick_name: '单向好友',
|
nick_name: '单向好友',
|
||||||
age: 20,
|
age: 20,
|
||||||
source: '来源'
|
source: '来源',
|
||||||
}
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
async pack_data (data: string): Promise<Uint8Array> {
|
async pack_data (data: string): Promise<Uint8Array> {
|
||||||
|
|||||||
@@ -22,11 +22,12 @@ export class GetUserStatus extends GetPacketStatusDepends<PayloadType, ReturnTyp
|
|||||||
override actionSummary = '获取用户在线状态';
|
override actionSummary = '获取用户在线状态';
|
||||||
override actionTags = ['系统扩展'];
|
override actionTags = ['系统扩展'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
user_id: '123456789'
|
user_id: '123456789',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
status: 10,
|
status: 10,
|
||||||
ext_status: 0
|
ext_status: 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
async _handle (payload: PayloadType) {
|
async _handle (payload: PayloadType) {
|
||||||
|
|||||||
@@ -28,9 +28,11 @@ export class MoveGroupFile extends GetPacketStatusDepends<PayloadType, ReturnTyp
|
|||||||
current_parent_directory: '/current_folder_id',
|
current_parent_directory: '/current_folder_id',
|
||||||
target_parent_directory: '/target_folder_id',
|
target_parent_directory: '/target_folder_id',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
ok: true
|
ok: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
override payloadSchema = PayloadSchema;
|
override payloadSchema = PayloadSchema;
|
||||||
override returnSchema = ReturnSchema;
|
override returnSchema = ReturnSchema;
|
||||||
|
|
||||||
|
|||||||
@@ -26,11 +26,13 @@ export class RenameGroupFile extends GetPacketStatusDepends<PayloadType, ReturnT
|
|||||||
group_id: '123456',
|
group_id: '123456',
|
||||||
file_id: '/file_id',
|
file_id: '/file_id',
|
||||||
current_parent_directory: '/',
|
current_parent_directory: '/',
|
||||||
new_name: 'new_name.jpg'
|
new_name: 'new_name.jpg',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
ok: true
|
ok: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
override payloadSchema = PayloadSchema;
|
override payloadSchema = PayloadSchema;
|
||||||
override returnSchema = ReturnSchema;
|
override returnSchema = ReturnSchema;
|
||||||
|
|
||||||
|
|||||||
@@ -24,8 +24,9 @@ export class SendPacket extends GetPacketStatusDepends<PayloadType, ReturnType>
|
|||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
cmd: 'Example.Cmd',
|
cmd: 'Example.Cmd',
|
||||||
data: '123456',
|
data: '123456',
|
||||||
rsp: true
|
rsp: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = '123456';
|
override returnExample = '123456';
|
||||||
|
|
||||||
async _handle (payload: PayloadType) {
|
async _handle (payload: PayloadType) {
|
||||||
|
|||||||
@@ -23,8 +23,9 @@ export class SetDiyOnlineStatus extends OneBotAction<PayloadType, ReturnType> {
|
|||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
face_id: '123',
|
face_id: '123',
|
||||||
face_type: '1',
|
face_type: '1',
|
||||||
wording: '自定义状态'
|
wording: '自定义状态',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = '';
|
override returnExample = '';
|
||||||
async _handle (payload: PayloadType) {
|
async _handle (payload: PayloadType) {
|
||||||
const ret = await this.core.apis.UserApi.setDiySelfOnlineStatus(
|
const ret = await this.core.apis.UserApi.setDiySelfOnlineStatus(
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ export default class SetGroupAddOption extends OneBotAction<PayloadType, ReturnT
|
|||||||
group_id: '123456',
|
group_id: '123456',
|
||||||
add_type: 1,
|
add_type: 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = null;
|
override returnExample = null;
|
||||||
override payloadSchema = PayloadSchema;
|
override payloadSchema = PayloadSchema;
|
||||||
override returnSchema = ReturnSchema;
|
override returnSchema = ReturnSchema;
|
||||||
|
|||||||
@@ -26,9 +26,11 @@ export class SetGroupAlbumMediaLike extends OneBotAction<PayloadType, ReturnType
|
|||||||
lloc: 'media_id_1',
|
lloc: 'media_id_1',
|
||||||
id: '123456',
|
id: '123456',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
result: {}
|
result: {},
|
||||||
};
|
};
|
||||||
|
|
||||||
override payloadSchema = PayloadSchema;
|
override payloadSchema = PayloadSchema;
|
||||||
override returnSchema = ReturnSchema;
|
override returnSchema = ReturnSchema;
|
||||||
|
|
||||||
|
|||||||
@@ -22,8 +22,9 @@ export default class SetGroupRemark extends OneBotAction<PayloadType, ReturnType
|
|||||||
override actionTags = ['群组扩展'];
|
override actionTags = ['群组扩展'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
group_id: '123456',
|
group_id: '123456',
|
||||||
remark: '测试群备注'
|
remark: '测试群备注',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = null;
|
override returnExample = null;
|
||||||
|
|
||||||
async _handle (payload: PayloadType): Promise<ReturnType> {
|
async _handle (payload: PayloadType): Promise<ReturnType> {
|
||||||
|
|||||||
@@ -19,8 +19,9 @@ export default class SetGroupRobotAddOption extends OneBotAction<PayloadType, Re
|
|||||||
override actionSummary = '设置群机器人加群选项';
|
override actionSummary = '设置群机器人加群选项';
|
||||||
override actionTags = ['群组扩展'];
|
override actionTags = ['群组扩展'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
group_id: '123456'
|
group_id: '123456',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = null;
|
override returnExample = null;
|
||||||
override payloadSchema = PayloadSchema;
|
override payloadSchema = PayloadSchema;
|
||||||
override returnSchema = ReturnSchema;
|
override returnSchema = ReturnSchema;
|
||||||
|
|||||||
@@ -19,8 +19,9 @@ export default class SetGroupSearch extends OneBotAction<PayloadType, ReturnType
|
|||||||
override actionSummary = '设置群搜索选项';
|
override actionSummary = '设置群搜索选项';
|
||||||
override actionTags = ['群组扩展'];
|
override actionTags = ['群组扩展'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
group_id: '123456'
|
group_id: '123456',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = null;
|
override returnExample = null;
|
||||||
override payloadSchema = PayloadSchema;
|
override payloadSchema = PayloadSchema;
|
||||||
override returnSchema = ReturnSchema;
|
override returnSchema = ReturnSchema;
|
||||||
|
|||||||
@@ -18,8 +18,9 @@ class SetGroupSignBase extends GetPacketStatusDepends<PayloadType, ReturnType> {
|
|||||||
override actionSummary = '群打卡';
|
override actionSummary = '群打卡';
|
||||||
override actionTags = ['群组扩展'];
|
override actionTags = ['群组扩展'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
group_id: '123456789'
|
group_id: '123456789',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = null;
|
override returnExample = null;
|
||||||
|
|
||||||
async _handle (payload: PayloadType) {
|
async _handle (payload: PayloadType) {
|
||||||
|
|||||||
@@ -22,8 +22,9 @@ export class SetInputStatus extends OneBotAction<PayloadType, ReturnType> {
|
|||||||
override actionTags = ['系统扩展'];
|
override actionTags = ['系统扩展'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
user_id: '123456789',
|
user_id: '123456789',
|
||||||
event_type: 1
|
event_type: 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = null;
|
override returnExample = null;
|
||||||
|
|
||||||
async _handle (payload: PayloadType) {
|
async _handle (payload: PayloadType) {
|
||||||
|
|||||||
@@ -24,8 +24,9 @@ export class SetOnlineStatus extends OneBotAction<PayloadType, ReturnType> {
|
|||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
status: 11,
|
status: 11,
|
||||||
ext_status: 0,
|
ext_status: 0,
|
||||||
battery_status: 100
|
battery_status: 100,
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = null;
|
override returnExample = null;
|
||||||
|
|
||||||
async _handle (payload: PayloadType) {
|
async _handle (payload: PayloadType) {
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ const ReturnSchema = Type.Any({ description: '分享结果' });
|
|||||||
type ReturnType = Static<typeof ReturnSchema>;
|
type ReturnType = Static<typeof ReturnSchema>;
|
||||||
|
|
||||||
export class SharePeerBase extends OneBotAction<PayloadType, ReturnType> {
|
export class SharePeerBase extends OneBotAction<PayloadType, ReturnType> {
|
||||||
|
|
||||||
override payloadSchema = PayloadSchema;
|
override payloadSchema = PayloadSchema;
|
||||||
override returnSchema = ReturnSchema;
|
override returnSchema = ReturnSchema;
|
||||||
override actionSummary = '分享用户 (Ark)';
|
override actionSummary = '分享用户 (Ark)';
|
||||||
@@ -23,10 +22,11 @@ export class SharePeerBase extends OneBotAction<PayloadType, ReturnType> {
|
|||||||
override actionTags = ['消息扩展'];
|
override actionTags = ['消息扩展'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
user_id: '123456',
|
user_id: '123456',
|
||||||
phone_number: ''
|
phone_number: '',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
ark: '...'
|
ark: '...',
|
||||||
};
|
};
|
||||||
|
|
||||||
async _handle (payload: PayloadType) {
|
async _handle (payload: PayloadType) {
|
||||||
@@ -58,8 +58,9 @@ export class ShareGroupExBase extends OneBotAction<PayloadTypeGroupEx, ReturnTyp
|
|||||||
override actionDescription = '获取群分享的 Ark 内容';
|
override actionDescription = '获取群分享的 Ark 内容';
|
||||||
override actionTags = ['消息扩展'];
|
override actionTags = ['消息扩展'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
group_id: '123456'
|
group_id: '123456',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = '{"app": "com.tencent.structmsg", ...}';
|
override returnExample = '{"app": "com.tencent.structmsg", ...}';
|
||||||
|
|
||||||
async _handle (payload: PayloadTypeGroupEx) {
|
async _handle (payload: PayloadTypeGroupEx) {
|
||||||
|
|||||||
@@ -22,11 +22,13 @@ export class TransGroupFile extends GetPacketStatusDepends<PayloadType, ReturnTy
|
|||||||
override actionTags = ['文件扩展'];
|
override actionTags = ['文件扩展'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
group_id: '123456',
|
group_id: '123456',
|
||||||
file_id: '/file_id'
|
file_id: '/file_id',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
ok: true
|
ok: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
override payloadSchema = PayloadSchema;
|
override payloadSchema = PayloadSchema;
|
||||||
override returnSchema = ReturnSchema;
|
override returnSchema = ReturnSchema;
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ export class TranslateEnWordToZn extends OneBotAction<PayloadType, ReturnType> {
|
|||||||
throw new Error('翻译失败');
|
throw new Error('翻译失败');
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
words: ret.words
|
words: ret.words,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -26,11 +26,13 @@ export class UploadImageToQunAlbum extends OneBotAction<PayloadType, ReturnType>
|
|||||||
group_id: '123456',
|
group_id: '123456',
|
||||||
album_id: 'album_id_1',
|
album_id: 'album_id_1',
|
||||||
album_name: '相册1',
|
album_name: '相册1',
|
||||||
file: '/path/to/image.jpg'
|
file: '/path/to/image.jpg',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
result: null
|
result: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
override payloadSchema = PayloadSchema;
|
override payloadSchema = PayloadSchema;
|
||||||
override returnSchema = ReturnSchema;
|
override returnSchema = ReturnSchema;
|
||||||
|
|
||||||
|
|||||||
@@ -26,10 +26,11 @@ export class CreateFlashTask extends OneBotAction<CreateFlashTaskPayload, any> {
|
|||||||
override actionTags = ['文件扩展'];
|
override actionTags = ['文件扩展'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
files: 'C:\\test.jpg',
|
files: 'C:\\test.jpg',
|
||||||
name: 'test_task'
|
name: 'test_task',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
task_id: 'task_123'
|
task_id: 'task_123',
|
||||||
};
|
};
|
||||||
|
|
||||||
async _handle (payload: CreateFlashTaskPayload) {
|
async _handle (payload: CreateFlashTaskPayload) {
|
||||||
|
|||||||
@@ -15,8 +15,9 @@ export class DownloadFileset extends OneBotAction<DownloadFilesetPayload, any> {
|
|||||||
override actionSummary = '下载文件集';
|
override actionSummary = '下载文件集';
|
||||||
override actionTags = ['文件扩展'];
|
override actionTags = ['文件扩展'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
fileset_id: 'set_123'
|
fileset_id: 'set_123',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = null;
|
override returnExample = null;
|
||||||
|
|
||||||
async _handle (payload: DownloadFilesetPayload) {
|
async _handle (payload: DownloadFilesetPayload) {
|
||||||
|
|||||||
@@ -12,15 +12,17 @@ export class GetFilesetId extends OneBotAction<GetFilesetIdPayload, { fileset_id
|
|||||||
override actionName = ActionName.GetFilesetId;
|
override actionName = ActionName.GetFilesetId;
|
||||||
override payloadSchema = GetFilesetIdPayloadSchema;
|
override payloadSchema = GetFilesetIdPayloadSchema;
|
||||||
override returnSchema = Type.Object({
|
override returnSchema = Type.Object({
|
||||||
fileset_id: Type.String({ description: '文件集 ID' })
|
fileset_id: Type.String({ description: '文件集 ID' }),
|
||||||
});
|
});
|
||||||
|
|
||||||
override actionSummary = '获取文件集 ID';
|
override actionSummary = '获取文件集 ID';
|
||||||
override actionTags = ['文件扩展'];
|
override actionTags = ['文件扩展'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
share_code: '123456'
|
share_code: '123456',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
fileset_id: 'set_123'
|
fileset_id: 'set_123',
|
||||||
};
|
};
|
||||||
|
|
||||||
async _handle (payload: GetFilesetIdPayload) {
|
async _handle (payload: GetFilesetIdPayload) {
|
||||||
|
|||||||
@@ -15,11 +15,12 @@ export class GetFilesetInfo extends OneBotAction<GetFilesetInfoPayload, any> {
|
|||||||
override actionSummary = '获取文件集信息';
|
override actionSummary = '获取文件集信息';
|
||||||
override actionTags = ['文件扩展'];
|
override actionTags = ['文件扩展'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
fileset_id: 'set_123'
|
fileset_id: 'set_123',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
fileset_id: 'set_123',
|
fileset_id: 'set_123',
|
||||||
file_list: []
|
file_list: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
async _handle (payload: GetFilesetInfoPayload) {
|
async _handle (payload: GetFilesetInfoPayload) {
|
||||||
|
|||||||
@@ -15,13 +15,14 @@ export class GetFlashFileList extends OneBotAction<GetFlashFileListPayload, any>
|
|||||||
override actionSummary = '获取闪传文件列表';
|
override actionSummary = '获取闪传文件列表';
|
||||||
override actionTags = ['文件扩展'];
|
override actionTags = ['文件扩展'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
fileset_id: 'set_123'
|
fileset_id: 'set_123',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = [
|
override returnExample = [
|
||||||
{
|
{
|
||||||
file_name: 'test.jpg',
|
file_name: 'test.jpg',
|
||||||
size: 1024
|
size: 1024,
|
||||||
}
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
async _handle (payload: GetFlashFileListPayload) {
|
async _handle (payload: GetFlashFileListPayload) {
|
||||||
|
|||||||
@@ -17,10 +17,11 @@ export class GetFlashFileUrl extends OneBotAction<GetFlashFileUrlPayload, any> {
|
|||||||
override actionSummary = '获取闪传文件链接';
|
override actionSummary = '获取闪传文件链接';
|
||||||
override actionTags = ['文件扩展'];
|
override actionTags = ['文件扩展'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
fileset_id: 'set_123'
|
fileset_id: 'set_123',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
url: 'http://example.com/flash.jpg'
|
url: 'http://example.com/flash.jpg',
|
||||||
};
|
};
|
||||||
|
|
||||||
async _handle (payload: GetFlashFileUrlPayload) {
|
async _handle (payload: GetFlashFileUrlPayload) {
|
||||||
|
|||||||
@@ -15,8 +15,9 @@ export class GetShareLink extends OneBotAction<GetShareLinkPayload, any> {
|
|||||||
override actionSummary = '获取文件分享链接';
|
override actionSummary = '获取文件分享链接';
|
||||||
override actionTags = ['文件扩展'];
|
override actionTags = ['文件扩展'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
fileset_id: 'set_123'
|
fileset_id: 'set_123',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = 'http://example.com/share';
|
override returnExample = 'http://example.com/share';
|
||||||
|
|
||||||
async _handle (payload: GetShareLinkPayload) {
|
async _handle (payload: GetShareLinkPayload) {
|
||||||
|
|||||||
@@ -19,10 +19,11 @@ export class SendFlashMsg extends OneBotAction<SendFlashMsgPayload, any> {
|
|||||||
override actionTags = ['文件扩展'];
|
override actionTags = ['文件扩展'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
fileset_id: 'set_123',
|
fileset_id: 'set_123',
|
||||||
user_id: '123456789'
|
user_id: '123456789',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
message_id: 123456
|
message_id: 123456,
|
||||||
};
|
};
|
||||||
|
|
||||||
async _handle (payload: SendFlashMsgPayload) {
|
async _handle (payload: SendFlashMsgPayload) {
|
||||||
|
|||||||
@@ -18,8 +18,9 @@ export class CancelOnlineFile extends OneBotAction<CancelOnlineFilePayload, any>
|
|||||||
override actionTags = ['文件扩展'];
|
override actionTags = ['文件扩展'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
user_id: '123456789',
|
user_id: '123456789',
|
||||||
msg_id: '123'
|
msg_id: '123',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = null;
|
override returnExample = null;
|
||||||
|
|
||||||
async _handle (payload: CancelOnlineFilePayload) {
|
async _handle (payload: CancelOnlineFilePayload) {
|
||||||
|
|||||||
@@ -16,8 +16,9 @@ export class GetOnlineFileMessages extends OneBotAction<GetOnlineFileMessagesPay
|
|||||||
override actionSummary = '获取在线文件消息';
|
override actionSummary = '获取在线文件消息';
|
||||||
override actionTags = ['文件扩展'];
|
override actionTags = ['文件扩展'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
user_id: '123456789'
|
user_id: '123456789',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = [];
|
override returnExample = [];
|
||||||
|
|
||||||
async _handle (payload: GetOnlineFileMessagesPayload) {
|
async _handle (payload: GetOnlineFileMessagesPayload) {
|
||||||
|
|||||||
@@ -20,8 +20,9 @@ export class ReceiveOnlineFile extends OneBotAction<ReceiveOnlineFilePayload, an
|
|||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
user_id: '123456789',
|
user_id: '123456789',
|
||||||
msg_id: '123',
|
msg_id: '123',
|
||||||
save_path: 'C:\\save'
|
save_path: 'C:\\save',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = null;
|
override returnExample = null;
|
||||||
|
|
||||||
async _handle (payload: ReceiveOnlineFilePayload) {
|
async _handle (payload: ReceiveOnlineFilePayload) {
|
||||||
|
|||||||
@@ -19,8 +19,9 @@ export class RefuseOnlineFile extends OneBotAction<RefuseOnlineFilePayload, any>
|
|||||||
override actionTags = ['文件扩展'];
|
override actionTags = ['文件扩展'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
user_id: '123456789',
|
user_id: '123456789',
|
||||||
msg_id: '123'
|
msg_id: '123',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = null;
|
override returnExample = null;
|
||||||
|
|
||||||
async _handle (payload: RefuseOnlineFilePayload) {
|
async _handle (payload: RefuseOnlineFilePayload) {
|
||||||
|
|||||||
@@ -20,8 +20,9 @@ export class SendOnlineFile extends OneBotAction<SendOnlineFilePayload, any> {
|
|||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
user_id: '123456789',
|
user_id: '123456789',
|
||||||
file_path: 'C:\\path\\to\\file.txt',
|
file_path: 'C:\\path\\to\\file.txt',
|
||||||
file_name: 'test.txt'
|
file_name: 'test.txt',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = null;
|
override returnExample = null;
|
||||||
|
|
||||||
async _handle (payload: SendOnlineFilePayload) {
|
async _handle (payload: SendOnlineFilePayload) {
|
||||||
|
|||||||
@@ -19,8 +19,9 @@ export class SendOnlineFolder extends OneBotAction<SendOnlineFolderPayload, any>
|
|||||||
override actionTags = ['文件扩展'];
|
override actionTags = ['文件扩展'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
user_id: '123456789',
|
user_id: '123456789',
|
||||||
folder_path: 'C:\\path\\to\\folder'
|
folder_path: 'C:\\path\\to\\folder',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = null;
|
override returnExample = null;
|
||||||
|
|
||||||
async _handle (payload: SendOnlineFolderPayload) {
|
async _handle (payload: SendOnlineFolderPayload) {
|
||||||
|
|||||||
@@ -28,11 +28,12 @@ export class CreateGroupFileFolder extends OneBotAction<PayloadType, ReturnType>
|
|||||||
override actionTags = ['Go-CQHTTP'];
|
override actionTags = ['Go-CQHTTP'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
group_id: '123456789',
|
group_id: '123456789',
|
||||||
folder_name: '新建文件夹'
|
folder_name: '新建文件夹',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
result: {},
|
result: {},
|
||||||
groupItem: {}
|
groupItem: {},
|
||||||
};
|
};
|
||||||
|
|
||||||
async _handle (payload: PayloadType) {
|
async _handle (payload: PayloadType) {
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ export class GoCQHTTPGetForwardMsgAction extends OneBotAction<PayloadType, Retur
|
|||||||
|
|
||||||
if (rootMsg) {
|
if (rootMsg) {
|
||||||
// 5. 获取消息内容
|
// 5. 获取消息内容
|
||||||
const data = await this.core.apis.MsgApi.getMsgHistory(rootMsg.Peer, rootMsg.MsgId, 1);//getMsgsIncludeSelf
|
const data = await this.core.apis.MsgApi.getMsgHistory(rootMsg.Peer, rootMsg.MsgId, 1);// getMsgsIncludeSelf
|
||||||
|
|
||||||
if (data && data.result === 0 && data.msgList.length > 0) {
|
if (data && data.result === 0 && data.msgList.length > 0) {
|
||||||
const singleMsg = data.msgList[0];
|
const singleMsg = data.msgList[0];
|
||||||
|
|||||||
@@ -18,10 +18,11 @@ export class GoCQHTTPSendForwardMsg extends GoCQHTTPSendForwardMsgBase {
|
|||||||
override actionTags = ['Go-CQHTTP'];
|
override actionTags = ['Go-CQHTTP'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
group_id: '123456789',
|
group_id: '123456789',
|
||||||
messages: []
|
messages: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
message_id: 123456
|
message_id: 123456,
|
||||||
};
|
};
|
||||||
|
|
||||||
protected override async check (payload: GoCQHTTPSendForwardMsgPayload) {
|
protected override async check (payload: GoCQHTTPSendForwardMsgPayload) {
|
||||||
@@ -35,11 +36,13 @@ export class GoCQHTTPSendPrivateForwardMsg extends GoCQHTTPSendForwardMsgBase {
|
|||||||
override actionTags = ['Go-CQHTTP'];
|
override actionTags = ['Go-CQHTTP'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
user_id: '123456789',
|
user_id: '123456789',
|
||||||
messages: []
|
messages: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
message_id: 123456
|
message_id: 123456,
|
||||||
};
|
};
|
||||||
|
|
||||||
override async _handle (payload: GoCQHTTPSendForwardMsgPayload): Promise<ReturnDataType> {
|
override async _handle (payload: GoCQHTTPSendForwardMsgPayload): Promise<ReturnDataType> {
|
||||||
return this.base_handle(payload, ContextMode.Private);
|
return this.base_handle(payload, ContextMode.Private);
|
||||||
}
|
}
|
||||||
@@ -51,11 +54,13 @@ export class GoCQHTTPSendGroupForwardMsg extends GoCQHTTPSendForwardMsgBase {
|
|||||||
override actionTags = ['Go-CQHTTP'];
|
override actionTags = ['Go-CQHTTP'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
group_id: '123456789',
|
group_id: '123456789',
|
||||||
messages: []
|
messages: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
message_id: 123456
|
message_id: 123456,
|
||||||
};
|
};
|
||||||
|
|
||||||
override async _handle (payload: GoCQHTTPSendForwardMsgPayload): Promise<ReturnDataType> {
|
override async _handle (payload: GoCQHTTPSendForwardMsgPayload): Promise<ReturnDataType> {
|
||||||
return this.base_handle(payload, ContextMode.Group);
|
return this.base_handle(payload, ContextMode.Group);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,8 +25,9 @@ export class GetAiRecord extends GetPacketStatusDepends<PayloadType, ReturnType>
|
|||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
character: 'ai_char_1',
|
character: 'ai_char_1',
|
||||||
group_id: '123456',
|
group_id: '123456',
|
||||||
text: '你好'
|
text: '你好',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = 'http://example.com/ai_voice.silk';
|
override returnExample = 'http://example.com/ai_voice.silk';
|
||||||
|
|
||||||
async _handle (payload: PayloadType) {
|
async _handle (payload: PayloadType) {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export class GetGroupIgnoredNotifies extends OneBotAction<PayloadType, ReturnTyp
|
|||||||
override returnExample = {
|
override returnExample = {
|
||||||
invited_requests: [],
|
invited_requests: [],
|
||||||
InvitedRequest: [],
|
InvitedRequest: [],
|
||||||
join_requests: []
|
join_requests: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
async _handle (): Promise<ReturnType> {
|
async _handle (): Promise<ReturnType> {
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ export class GetGroupNotice extends OneBotAction<PayloadType, ReturnType> {
|
|||||||
images: image,
|
images: image,
|
||||||
},
|
},
|
||||||
settings: retApiNotice.settings,
|
settings: retApiNotice.settings,
|
||||||
read_num: retApiNotice.read_num
|
read_num: retApiNotice.read_num,
|
||||||
};
|
};
|
||||||
retNotices.push(retNotice);
|
retNotices.push(retNotice);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,14 +19,15 @@ export class GetGroupShutList extends OneBotAction<PayloadType, ReturnType> {
|
|||||||
override actionSummary = '获取群禁言列表';
|
override actionSummary = '获取群禁言列表';
|
||||||
override actionTags = ['群组接口'];
|
override actionTags = ['群组接口'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
group_id: '123456789'
|
group_id: '123456789',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = [
|
override returnExample = [
|
||||||
{
|
{
|
||||||
user_id: 123456789,
|
user_id: 123456789,
|
||||||
nickname: '禁言用户',
|
nickname: '禁言用户',
|
||||||
shut_up_time: 1734567890
|
shut_up_time: 1734567890,
|
||||||
}
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
async _handle (payload: PayloadType) {
|
async _handle (payload: PayloadType) {
|
||||||
|
|||||||
@@ -27,8 +27,9 @@ export class SendGroupAiRecord extends GetPacketStatusDepends<PayloadType, Retur
|
|||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
character: 'ai_char_1',
|
character: 'ai_char_1',
|
||||||
group_id: '123456',
|
group_id: '123456',
|
||||||
text: '你好'
|
text: '你好',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {};
|
override returnExample = {};
|
||||||
|
|
||||||
async _handle (payload: PayloadType) {
|
async _handle (payload: PayloadType) {
|
||||||
|
|||||||
@@ -21,8 +21,9 @@ class DeleteMsg extends OneBotAction<PayloadType, ReturnType> {
|
|||||||
override actionDescription = '撤回已发送的消息';
|
override actionDescription = '撤回已发送的消息';
|
||||||
override actionTags = ['消息接口'];
|
override actionTags = ['消息接口'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
message_id: 12345
|
message_id: 12345,
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = null;
|
override returnExample = null;
|
||||||
|
|
||||||
async _handle (payload: PayloadType) {
|
async _handle (payload: PayloadType) {
|
||||||
|
|||||||
@@ -22,8 +22,9 @@ class ForwardSingleMsg extends OneBotAction<PayloadType, ReturnType> {
|
|||||||
override actionTags = ['消息接口'];
|
override actionTags = ['消息接口'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
message_id: 12345,
|
message_id: 12345,
|
||||||
group_id: '123456'
|
group_id: '123456',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = null;
|
override returnExample = null;
|
||||||
|
|
||||||
protected async getTargetPeer (payload: PayloadType): Promise<Peer> {
|
protected async getTargetPeer (payload: PayloadType): Promise<Peer> {
|
||||||
|
|||||||
@@ -21,8 +21,9 @@ class MarkMsgAsRead extends OneBotAction<PayloadType, ReturnType> {
|
|||||||
override actionDescription = '标记指定渠道的消息为已读';
|
override actionDescription = '标记指定渠道的消息为已读';
|
||||||
override actionTags = ['消息接口'];
|
override actionTags = ['消息接口'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
message_id: 12345
|
message_id: 12345,
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = null;
|
override returnExample = null;
|
||||||
|
|
||||||
async getPeer (payload: PayloadType): Promise<Peer> {
|
async getPeer (payload: PayloadType): Promise<Peer> {
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ export class SendMsgBase extends OneBotAction<SendMsgPayload, ReturnDataType> {
|
|||||||
} | null> {
|
} | null> {
|
||||||
const packetMsg: PacketMsg[] = [];
|
const packetMsg: PacketMsg[] = [];
|
||||||
const delFiles: string[] = [];
|
const delFiles: string[] = [];
|
||||||
const innerMsg: Array<{ uuid: string, packetMsg?: PacketMsg[], actionMsgBody?: UploadForwardMsgParams['actionMsgBody']; }> = new Array();
|
const innerMsg: Array<{ uuid: string, packetMsg?: PacketMsg[], actionMsgBody?: UploadForwardMsgParams['actionMsgBody']; }> = [];
|
||||||
for (const node of messageNodes) {
|
for (const node of messageNodes) {
|
||||||
if (dp >= 3) {
|
if (dp >= 3) {
|
||||||
this.core.context.logger.logWarn('转发消息深度超过3层,将停止解析!');
|
this.core.context.logger.logWarn('转发消息深度超过3层,将停止解析!');
|
||||||
@@ -243,7 +243,6 @@ export class SendMsgBase extends OneBotAction<SendMsgPayload, ReturnDataType> {
|
|||||||
innerMsg.push(m);
|
innerMsg.push(m);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
const sendElementsCreateReturn = await this.obContext.apis.MsgApi.createSendElements(OB11Data, msgPeer);
|
const sendElementsCreateReturn = await this.obContext.apis.MsgApi.createSendElements(OB11Data, msgPeer);
|
||||||
sendElements = sendElementsCreateReturn.sendElements;
|
sendElements = sendElementsCreateReturn.sendElements;
|
||||||
@@ -340,8 +339,8 @@ export class SendMsgBase extends OneBotAction<SendMsgPayload, ReturnDataType> {
|
|||||||
},
|
},
|
||||||
} as SendArkElement,
|
} as SendArkElement,
|
||||||
res_id: resid,
|
res_id: resid,
|
||||||
uuid: uuid,
|
uuid,
|
||||||
packetMsg: packetMsg,
|
packetMsg,
|
||||||
innerPacketMsg: innerMsg,
|
innerPacketMsg: innerMsg,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,10 +9,11 @@ class SendPrivateMsg extends SendMsgBase {
|
|||||||
override actionTags = ['消息接口'];
|
override actionTags = ['消息接口'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
user_id: '123456789',
|
user_id: '123456789',
|
||||||
message: 'hello'
|
message: 'hello',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
message_id: 123456
|
message_id: 123456,
|
||||||
};
|
};
|
||||||
|
|
||||||
protected override async check (payload: SendMsgPayload): Promise<BaseCheckResult> {
|
protected override async check (payload: SendMsgPayload): Promise<BaseCheckResult> {
|
||||||
|
|||||||
@@ -22,11 +22,13 @@ export class SetMsgEmojiLike extends OneBotAction<PayloadType, ReturnType> {
|
|||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
message_id: 12345,
|
message_id: 12345,
|
||||||
emoji_id: '123',
|
emoji_id: '123',
|
||||||
set: true
|
set: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
result: true
|
result: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
override payloadSchema = PayloadSchema;
|
override payloadSchema = PayloadSchema;
|
||||||
override returnSchema = ReturnSchema;
|
override returnSchema = ReturnSchema;
|
||||||
|
|
||||||
|
|||||||
@@ -20,8 +20,9 @@ export class SetDoubtFriendsAddRequest extends OneBotAction<SetDoubtFriendsAddRe
|
|||||||
override actionTags = ['系统接口'];
|
override actionTags = ['系统接口'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
flag: '12345',
|
flag: '12345',
|
||||||
approve: true
|
approve: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = null;
|
override returnExample = null;
|
||||||
|
|
||||||
async _handle (payload: SetDoubtFriendsAddRequestPayload) {
|
async _handle (payload: SetDoubtFriendsAddRequestPayload) {
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ export class GetRkeyEx extends GetPacketStatusDepends<void, GetRkeyExReturn> {
|
|||||||
type: 'private',
|
type: 'private',
|
||||||
rkey: 'rkey_123',
|
rkey: 'rkey_123',
|
||||||
created_at: 1734567890,
|
created_at: 1734567890,
|
||||||
ttl: 3600
|
ttl: 3600,
|
||||||
}
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
async _handle () {
|
async _handle () {
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ export class GetRkeyServer extends GetPacketStatusDepends<void, GetRkeyServerRet
|
|||||||
expired_time: 1694560000,
|
expired_time: 1694560000,
|
||||||
name: 'NapCat 4',
|
name: 'NapCat 4',
|
||||||
};
|
};
|
||||||
|
|
||||||
override payloadSchema = Type.Object({});
|
override payloadSchema = Type.Object({});
|
||||||
override returnSchema = GetRkeyServerReturnSchema;
|
override returnSchema = GetRkeyServerReturnSchema;
|
||||||
|
|
||||||
|
|||||||
@@ -94,5 +94,5 @@ export const OB11MessageSchema = Type.Intersect([
|
|||||||
emoji_type: Type.String({ description: '表情符号类型' }),
|
emoji_type: Type.String({ description: '表情符号类型' }),
|
||||||
likes_cnt: Type.String({ description: '点赞数' }),
|
likes_cnt: Type.String({ description: '点赞数' }),
|
||||||
})),
|
})),
|
||||||
}, { description: 'OneBot 11 消息信息' })
|
}, { description: 'OneBot 11 消息信息' }),
|
||||||
], { $id: 'OB11ActionMessage', description: 'OneBot 11 消息信息' });
|
], { $id: 'OB11ActionMessage', description: 'OneBot 11 消息信息' });
|
||||||
@@ -10,8 +10,9 @@ export class CleanStreamTempFile extends OneBotAction<void, void> {
|
|||||||
override actionTags = ['流式传输扩展'];
|
override actionTags = ['流式传输扩展'];
|
||||||
override payloadExample = {};
|
override payloadExample = {};
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
message: 'success'
|
message: 'success',
|
||||||
};
|
};
|
||||||
|
|
||||||
override payloadSchema = Type.Object({});
|
override payloadSchema = Type.Object({});
|
||||||
override returnSchema = Type.Null();
|
override returnSchema = Type.Null();
|
||||||
|
|
||||||
|
|||||||
@@ -20,11 +20,13 @@ export class DownloadFileImageStream extends BaseDownloadStream<DownloadFileImag
|
|||||||
override actionSummary = '下载图片文件流';
|
override actionSummary = '下载图片文件流';
|
||||||
override actionTags = ['流式传输扩展'];
|
override actionTags = ['流式传输扩展'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
file: 'image_file_id'
|
file: 'image_file_id',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
file: 'temp_image_path'
|
file: 'temp_image_path',
|
||||||
};
|
};
|
||||||
|
|
||||||
override payloadSchema = DownloadFileImageStreamPayloadSchema;
|
override payloadSchema = DownloadFileImageStreamPayloadSchema;
|
||||||
override returnSchema = Type.Any({ description: '下载结果 (流式)' });
|
override returnSchema = Type.Any({ description: '下载结果 (流式)' });
|
||||||
override useStream = true;
|
override useStream = true;
|
||||||
|
|||||||
@@ -23,11 +23,13 @@ export class DownloadFileRecordStream extends BaseDownloadStream<DownloadFileRec
|
|||||||
override actionSummary = '下载语音文件流';
|
override actionSummary = '下载语音文件流';
|
||||||
override actionTags = ['流式传输扩展'];
|
override actionTags = ['流式传输扩展'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
file: 'record_file_id'
|
file: 'record_file_id',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
file: 'temp_record_path'
|
file: 'temp_record_path',
|
||||||
};
|
};
|
||||||
|
|
||||||
override payloadSchema = DownloadFileRecordStreamPayloadSchema;
|
override payloadSchema = DownloadFileRecordStreamPayloadSchema;
|
||||||
override returnSchema = Type.Any({ description: '下载结果 (流式)' });
|
override returnSchema = Type.Any({ description: '下载结果 (流式)' });
|
||||||
override useStream = true;
|
override useStream = true;
|
||||||
|
|||||||
@@ -21,14 +21,16 @@ export class DownloadFileStream extends BaseDownloadStream<DownloadFileStreamPay
|
|||||||
override actionDescription = '以流式方式从网络或本地下载文件';
|
override actionDescription = '以流式方式从网络或本地下载文件';
|
||||||
override actionTags = ['流式接口'];
|
override actionTags = ['流式接口'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
file: 'http://example.com/file.png'
|
file: 'http://example.com/file.png',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
type: 'stream',
|
type: 'stream',
|
||||||
data_type: 'file_info',
|
data_type: 'file_info',
|
||||||
file_name: 'file.png',
|
file_name: 'file.png',
|
||||||
file_size: 1024
|
file_size: 1024,
|
||||||
};
|
};
|
||||||
|
|
||||||
override useStream = true;
|
override useStream = true;
|
||||||
|
|
||||||
async _handle (payload: DownloadFileStreamPayload, _adaptername: string, _config: NetworkAdapterConfig, req: OneBotRequestToolkit): Promise<StreamPacket<DownloadResult>> {
|
async _handle (payload: DownloadFileStreamPayload, _adaptername: string, _config: NetworkAdapterConfig, req: OneBotRequestToolkit): Promise<StreamPacket<DownloadResult>> {
|
||||||
|
|||||||
@@ -15,11 +15,13 @@ export class TestDownloadStream extends OneBotAction<TestDownloadStreamPayload,
|
|||||||
override actionSummary = '测试下载流';
|
override actionSummary = '测试下载流';
|
||||||
override actionTags = ['流式传输扩展'];
|
override actionTags = ['流式传输扩展'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
url: 'http://example.com/file'
|
url: 'http://example.com/file',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
success: true
|
success: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
override payloadSchema = TestDownloadStreamPayloadSchema;
|
override payloadSchema = TestDownloadStreamPayloadSchema;
|
||||||
override returnSchema = Type.Any({ description: '测试流数据' });
|
override returnSchema = Type.Any({ description: '测试流数据' });
|
||||||
override useStream = true;
|
override useStream = true;
|
||||||
|
|||||||
@@ -78,15 +78,17 @@ export class UploadFileStream extends OneBotAction<UploadFileStreamPayload, Stre
|
|||||||
chunk_data: 'SGVsbG8gV29ybGQ=',
|
chunk_data: 'SGVsbG8gV29ybGQ=',
|
||||||
chunk_index: 0,
|
chunk_index: 0,
|
||||||
total_chunks: 1,
|
total_chunks: 1,
|
||||||
file_size: 11
|
file_size: 11,
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
type: 'stream',
|
type: 'stream',
|
||||||
stream_id: 'uuid-1234-5678',
|
stream_id: 'uuid-1234-5678',
|
||||||
status: 'chunk_received',
|
status: 'chunk_received',
|
||||||
received_chunks: 1,
|
received_chunks: 1,
|
||||||
total_chunks: 1
|
total_chunks: 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
override useStream = true;
|
override useStream = true;
|
||||||
|
|
||||||
private static streams = new Map<string, StreamState>();
|
private static streams = new Map<string, StreamState>();
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export class GetCSRF extends OneBotAction<void, GetCSRFReturnType> {
|
|||||||
override actionTags = ['系统接口'];
|
override actionTags = ['系统接口'];
|
||||||
override payloadExample = {};
|
override payloadExample = {};
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
token: 123456789
|
token: 123456789,
|
||||||
};
|
};
|
||||||
|
|
||||||
async _handle () {
|
async _handle () {
|
||||||
|
|||||||
@@ -23,11 +23,12 @@ export class GetCredentials extends OneBotAction<GetCredentialsPayload, GetCrede
|
|||||||
override actionDescription = '获取登录凭证';
|
override actionDescription = '获取登录凭证';
|
||||||
override actionTags = ['系统接口'];
|
override actionTags = ['系统接口'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
domain: 'qun.qq.com'
|
domain: 'qun.qq.com',
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
cookies: 'uin=o123456789; skey=@abc12345;',
|
cookies: 'uin=o123456789; skey=@abc12345;',
|
||||||
token: 123456789
|
token: 123456789,
|
||||||
};
|
};
|
||||||
|
|
||||||
async _handle (payload: GetCredentialsPayload) {
|
async _handle (payload: GetCredentialsPayload) {
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export default class GetStatus extends OneBotAction<void, GetStatusReturnType> {
|
|||||||
override returnExample = {
|
override returnExample = {
|
||||||
online: true,
|
online: true,
|
||||||
good: true,
|
good: true,
|
||||||
stat: {}
|
stat: {},
|
||||||
};
|
};
|
||||||
|
|
||||||
async _handle (): Promise<GetStatusReturnType> {
|
async _handle (): Promise<GetStatusReturnType> {
|
||||||
|
|||||||
@@ -26,12 +26,13 @@ export class GetGroupSystemMsg extends OneBotAction<GetGroupSystemMsgPayload, Ge
|
|||||||
override actionDescription = '获取群系统消息';
|
override actionDescription = '获取群系统消息';
|
||||||
override actionTags = ['系统接口'];
|
override actionTags = ['系统接口'];
|
||||||
override payloadExample = {
|
override payloadExample = {
|
||||||
count: 50
|
count: 50,
|
||||||
};
|
};
|
||||||
|
|
||||||
override returnExample = {
|
override returnExample = {
|
||||||
invited_requests: [],
|
invited_requests: [],
|
||||||
InvitedRequest: [],
|
InvitedRequest: [],
|
||||||
join_requests: []
|
join_requests: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
async _handle (params: GetGroupSystemMsgPayload): Promise<GetGroupSystemMsgReturn> {
|
async _handle (params: GetGroupSystemMsgPayload): Promise<GetGroupSystemMsgReturn> {
|
||||||
|
|||||||
Loaded 100 of 176 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user