Compare commits

..

14 Commits
v4.2.0 ... dev

Author SHA1 Message Date
linyuchen
b7a7eeecd3 feat: moehoo version checker 2024-11-17 17:19:17 +08:00
idranme
d66d42cb5d refactor 2024-11-17 16:33:57 +08:00
linyuchen
5514bf0bb8 chore: bump version 2024-11-17 15:20:22 +08:00
linyuchen
f5d093cc45 fix: 调用发包接口时检查 QQ 版本,兼容 27333 - 27597 的戳一戳 2024-11-17 15:19:48 +08:00
linyuchen
2c1d12e04b Merge remote-tracking branch 'origin/dev' into dev 2024-11-16 23:01:39 +08:00
linyuchen
110193ea15 fix: 调用发包接口时检查QQ版本 2024-11-16 23:01:24 +08:00
idranme
fafcf058b1 refactor 2024-11-16 19:39:14 +08:00
linyuchen
c8d5eebe5d feat: new api set_friend_remark, set_friend_category, set_group_remark, set_group_msg_mask, set_restart 2024-11-16 14:48:45 +08:00
linyuchen
f6263375f1 chore: version 4.2.2 2024-11-15 11:01:25 +08:00
linyuchen
f79581d97e 🐛修复 hook ipc 时获取不到 callbackId 导致其他插件 ipc 通信失败 2024-11-15 10:58:35 +08:00
idranme
1f02c98c8f chore 2024-11-14 15:24:46 +08:00
linyuchen
e1e5c278b9 🐛修复 hook ipc 时获取不到 eventName 导致其他插件 ipc 通信失败 2024-11-14 14:51:01 +08:00
idranme
104839f7ea fix 2024-11-14 12:34:48 +08:00
idranme
bb8771a5b4 refactor 2024-11-14 11:40:19 +08:00
45 changed files with 1867 additions and 4332 deletions

View File

@@ -23,10 +23,6 @@ TG 群:<https://t.me/+nLZEnpne-pQ1OWFl>
[![Stargazers over time](https://starchart.cc/LLOneBot/LLOneBot.svg?variant=adaptive)](https://starchart.cc/LLOneBot/LLOneBot)
## 贡献者
[![Contributors](https://contributors-img.web.app/image?repo=LLOneBot/LLOneBot)](https://github.com/LOneBot/LLOneBot/graphs/contributors)
## 鸣谢
- [NapCatQQ](https://github.com/NapNeko/NapCatQQ)

View File

@@ -4,7 +4,7 @@
"name": "LLOneBot",
"slug": "LLOneBot",
"description": "实现 OneBot 11 和 Satori 协议,用于 QQ 机器人开发",
"version": "4.2.0",
"version": "4.3.2",
"icon": "./icon.webp",
"authors": [
{

View File

@@ -12,7 +12,7 @@
"deploy-win": "cmd /c \"xcopy /C /S /Y dist\\* %LITELOADERQQNT_PROFILE%\\plugins\\LLOneBot\\\"",
"format": "prettier -cw .",
"check": "tsc",
"compile:proto": "pbjs --no-create --no-convert --no-delimited --no-verify -t static-module -w es6 -p src/ntqqapi/proto -o src/ntqqapi/proto/compiled.js profileLikeTip.proto groupNotify.proto message.proto richMedia.proto && pbts -o src/ntqqapi/proto/compiled.d.ts src/ntqqapi/proto/compiled.js"
"compile:proto": "pbjs --no-create --no-convert --no-delimited --no-verify -t static-module -w es6 -p src/ntqqapi/proto -o src/ntqqapi/proto/compiled.js profileLikeTip.proto groupNotify.proto message.proto richMedia.proto oidb.proto && pbts -o src/ntqqapi/proto/compiled.d.ts src/ntqqapi/proto/compiled.js"
},
"author": "",
"license": "MIT",
@@ -42,7 +42,7 @@
"electron-vite": "^2.3.0",
"protobufjs-cli": "^1.1.3",
"typescript": "^5.6.3",
"vite": "^5.4.10",
"vite": "^5.4.11",
"vite-plugin-cp": "^4.0.8"
},
"packageManager": "yarn@4.5.1"

View File

@@ -17,6 +17,11 @@ export function getBuildVersion(): number {
return +globalThis.LiteLoader.package.qqnt.buildVersion
}
/** QQ Full Version */
export function getFullVersion(): string {
return globalThis.LiteLoader.versions.qqnt
}
/** 在保证老对象已有的属性不变化的情况下将新对象的属性复制到老对象 */
export function mergeNewProperties(newObj: Dict, oldObj: Dict) {
Object.keys(newObj).forEach((key) => {

View File

@@ -35,9 +35,7 @@ import {
NTQQWindowApi
} from '../ntqqapi/api'
import { existsSync, mkdirSync } from 'node:fs'
import { initWrapperSession} from '@/ntqqapi/native/napcat-protocol-packet'
initWrapperSession().then()
import { NTQQSystemApi } from '@/ntqqapi/api/system'
declare module 'cordis' {
interface Events {
@@ -77,6 +75,7 @@ function onLoad() {
ctx.plugin(NTQQWebApi)
ctx.plugin(NTQQWindowApi)
ctx.plugin(Database)
ctx.plugin(NTQQSystemApi)
let started = false
@@ -231,6 +230,9 @@ function onLoad() {
// 创建窗口时触发
function onBrowserWindowCreated(window: BrowserWindow) {
if (window.id === 2) {
mainWindow = window
}
}
try {

View File

@@ -107,7 +107,7 @@ export class NTQQFriendApi extends Service {
return ret.arkMsg
}
async setBuddyRemark(uid: string, remark: string) {
async setBuddyRemark(uid: string, remark = '') {
return await invoke('nodeIKernelBuddyService/setBuddyRemark', [{
remarkParams: { uid, remark }
}])
@@ -122,4 +122,8 @@ export class NTQQFriendApi extends Service {
}
}])
}
async setBuddyCategory(uid: string, categoryId: number) {
return await invoke('nodeIKernelBuddyService/setBuddyCategory', [{ uid, categoryId }])
}
}

View File

@@ -9,7 +9,8 @@ import {
PublishGroupBulletinReq,
GroupAllInfo,
GroupFileInfo,
GroupBulletinListResult
GroupBulletinListResult,
GroupMsgMask
} from '../types'
import { invoke, NTClass, NTMethod } from '../ntcall'
import { GeneralCallResult } from '../services'
@@ -341,4 +342,12 @@ export class NTQQGroupApi extends Service {
[{ groupId }]
)
}
async setGroupMsgMask(groupCode: string, msgMask: GroupMsgMask) {
return await invoke('nodeIKernelGroupService/setGroupMsgMask', [{ groupCode, msgMask }])
}
async setGroupRemark(groupCode: string, groupRemark = '') {
return await invoke('nodeIKernelGroupService/modifyGroupRemark', [{ groupCode, groupRemark }])
}
}

View File

@@ -284,4 +284,8 @@ export class NTQQMsgApi extends Service {
async fetchUnitedCommendConfig(groups: string[]) {
return await invoke('nodeIKernelUnitedConfigService/fetchUnitedCommendConfig', [{ groups }])
}
async sendSsoCmdReqByContend(ssoCmd: string, content: string) {
return await invoke('nodeIKernelMsgService/sendSsoCmdReqByContend', [{ ssoCmd, content }])
}
}

38
src/ntqqapi/api/system.ts Normal file
View File

@@ -0,0 +1,38 @@
import { Context, Service } from 'cordis'
import { invoke, NTClass } from '@/ntqqapi/ntcall'
declare module 'cordis' {
interface Context {
ntSystemApi: NTQQSystemApi
}
}
export class NTQQSystemApi extends Service {
constructor(protected ctx: Context) {
super(ctx, 'ntSystemApi', true)
}
async restart() {
// todo: 调用此接口后会将 NTQQ 设置里面的自动登录和无需手机确认打开,重启后将状态恢复到之前的状态
// 设置自动登录
await this.setSettingAutoLogin(true)
// 退出账号
invoke('quitAccount', [], {
className: NTClass.BUSINESS_API
}).then()
invoke('notifyQQClose', [{ type: 1 }], { className: NTClass.QQ_EX_API }).then()
// 等待登录界面,模拟点击登录按钮?还是直接调用登录方法?
}
async getSettingAutoLogin() {
// 查询是否自动登录
return invoke('nodeIKernelNodeMiscService/queryAutoRun', [])
}
async setSettingAutoLogin(state: boolean) {
await invoke('nodeIKernelSettingService/setNeedConfirmSwitch', [{ state: 1 }]) // 1不需要手机确认2需要手机确认
await invoke('nodeIKernelSettingService/setAutoLoginSwitch', [{ state }])
}
}

View File

@@ -41,12 +41,14 @@ class Core extends Service {
static inject = ['ntMsgApi', 'ntFriendApi', 'ntGroupApi', 'store']
public startTime = 0
public native
public ntqqPacketApi: NTQQPacketApi
public packet!: NTQQPacketApi
constructor(protected ctx: Context, public config: Core.Config) {
super(ctx, 'app', true)
this.native = new Native(ctx)
initWrapperSession().then(session=>{this.ntqqPacketApi = new NTQQPacketApi(session)})
initWrapperSession().then(session => {
this.packet = new NTQQPacketApi(session)
})
}
public start() {

View File

@@ -0,0 +1,86 @@
{
"3.2.12-28418-x64": {
"recv": "A0723E0",
"send": "A06EAE0"
},
"9.9.15-28418-x64": {
"recv": "37A9004",
"send": "37A4BD0"
},
"6.9.56-28418-x64": {
"send": "4471360",
"recv": "4473BCC"
},
"6.9.56-28418-arm64": {
"send": "3FBDBF8",
"recv": "3FC0410"
},
"9.9.15-28498-x64": {
"recv": "37A9004",
"send": "37A4BD0"
},
"9.9.16-28788-x64": {
"send": "38076D0",
"recv": "380BB04"
},
"3.2.13-28788-x64": {
"send": "A0CEC20",
"recv": "A0D2520"
},
"3.2.13-28788-arm64": {
"send": "6E91018",
"recv": "6E94850"
},
"9.9.16-28971-x64": {
"send": "38079F0",
"recv": "380BE24"
},
"3.2.13-28971-x64": {
"send": "A0CEF60",
"recv": "A0D2860"
},
"3.2.12-28971-arm64": {
"send": "6E91318",
"recv": "6E94B50"
},
"6.9.58-28971-x64": {
"send": "449ACA0",
"recv": "449D50C"
},
"6.9.58-28971-arm64": {
"send": "3FE0DB0",
"recv": "3FE35C8"
},
"9.9.16-29271-x64": {
"send": "3833510",
"recv": "3837944"
},
"3.2.13-29271-x64": {
"send": "A11E680",
"recv": "A121F80"
},
"3.2.13-29271-arm64": {
"send": "6ECA098",
"recv": "6ECD8D0"
},
"9.9.16-29456-x64": {
"send": "3835CD0",
"recv": "383A104"
},
"3.2.13-29456-x64": {
"send": "A11E820",
"recv": "A122120"
},
"3.2.13-29456-arm64": {
"send": "6ECA130",
"recv": "6ECD968"
},
"6.9.59-29456-x64": {
"send": "44C57A0",
"recv": "44C800C"
},
"6.9.59-29456-arm64": {
"send": "4005FE8",
"recv": "4008800"
}
}

View File

@@ -2,6 +2,7 @@ import { NTMethod } from './ntcall'
import { log } from '@/common/utils'
import { randomUUID } from 'node:crypto'
import { ipcMain } from 'electron'
import { Dict } from 'cosmokit'
export const hookApiCallbacks: Record<string, (res: any) => void> = {}
@@ -45,8 +46,8 @@ export function startHook() {
const senderExclude = Symbol()
ipcMain.emit = new Proxy(ipcMain.emit, {
apply(target, thisArg, args: [eventName: string, ...args: any]) {
if (args[2]?.eventName.startsWith('ns-LoggerApi')) {
apply(target, thisArg, args: [channel: string, ...args: any]) {
if (args[2]?.eventName?.startsWith('ns-LoggerApi')) {
return target.apply(thisArg, args)
}
if (logHook) {
@@ -56,15 +57,15 @@ export function startHook() {
if (event.sender && !event.sender[senderExclude]) {
event.sender[senderExclude] = true
event.sender.send = new Proxy(event.sender.send, {
apply(target, thisArg, args: any[]) {
if (args[1].eventName?.startsWith('ns-LoggerApi')) {
apply(target, thisArg, args: [channel: string, meta: Dict, data: Dict[]]) {
if (args[1]?.eventName?.startsWith('ns-LoggerApi')) {
return target.apply(thisArg, args)
}
if (logHook) {
log('received', args)
}
const callbackId = args[1].callbackId
const callbackId = args[1]?.callbackId
if (callbackId) {
if (hookApiCallbacks[callbackId]) {
Promise.resolve(hookApiCallbacks[callbackId](args[2]))
@@ -96,7 +97,7 @@ export function startHook() {
}
}
return target.apply(thisArg, args)
}
},
})
}

View File

@@ -11,7 +11,7 @@ export class Native {
public activated = false
private crychic?: Dict
private seq = 0
private cb: Map<number, Function> = new Map()
private cb: Map<number, (res: any) => void> = new Map()
constructor(private ctx: Context) {
ctx.on('ready', () => {

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,138 @@
import { Context } from 'cordis'
import { arch } from 'node:os'
import { getFullVersion, getBuildVersion } from '@/common/utils/misc'
import { selfInfo, TEMP_DIR } from '@/common/globalVars'
import { Dict } from 'cosmokit'
import { copyFile } from 'node:fs/promises'
import { createHash } from 'node:crypto'
import { Oidb } from '@/ntqqapi/proto/compiled'
import path from 'node:path'
import offset from '@/ntqqapi/helper/offset.json'
interface Offset {
[key: string]: {
recv: string
send: string
}
}
export class Native {
available = false
moehoo?: Dict
constructor(private ctx: Context) {
ctx.on('ready', async () => {
this.init()
})
}
private async init() {
const key = getFullVersion() + '-' + arch()
const currOffset = (offset as Offset)[key]
if (!currOffset) {
return
}
const platform = process.platform + '.' + process.arch
try {
const fileName = 'MoeHoo.' + platform + '.node' // todo: 需要加入版本号或者hash不然多开QQ时会导致copyFile失败从而无法进行在线更新
const src = path.join(__dirname, 'Moehoo', fileName)
const dest = path.join(TEMP_DIR, fileName)
try {
await copyFile(src, dest)
} catch (e) {
// resource busy or locked?
this.ctx.logger.warn(e)
}
this.moehoo = require(dest)
this.moehoo!.InitHook(currOffset.send, currOffset.recv, () => {
})
this.available = true
} catch (e) {
this.ctx.logger.warn('moehoo 加载失败', e)
}
}
private async sendPacket(cmd: string, data: string) {
const traceId = `${Date.now()}${data}`.slice(0, data.length / 2)
const traceIdMd5 = createHash('md5').update(traceId).digest('hex')
this.moehoo!.SendPacket(cmd, data, traceIdMd5)
const res = await this.ctx.ntMsgApi.sendSsoCmdReqByContend(cmd, traceId)
if (res.result !== 0) {
throw new Error(res.errMsg)
}
}
private check() {
if (this.available) {
return
}
const minVersion = 28418
const maxVersion = 29456
const currVersion = getBuildVersion()
if (currVersion < minVersion || currVersion > maxVersion) {
throw new Error(`当前 QQ 版本 ${getBuildVersion()} 不支持,可尝试其他版本 ${minVersion}${maxVersion}`)
} else {
throw new Error('packet backend 当前不可用')
}
}
async groupPoke(groupCode: number, uin: number) {
this.check()
const data = Oidb.Oidb_0xED3_1.encode({
uin,
groupCode
}).finish()
const req = buildOidbRequest(0xED3, 1, data)
await this.sendPacket(req.cmd, req.data)
}
async friendPoke(uin: number) {
this.check()
const data = Oidb.Oidb_0xED3_1.encode({
uin,
friendUin: uin
}).finish()
const req = buildOidbRequest(0xED3, 1, data)
await this.sendPacket(req.cmd, req.data)
}
async groupSign(groupCode: string) {
this.check()
const data = Oidb.Oidb_0xEB7_1.encode({
body: {
uin: selfInfo.uin,
groupCode
}
}).finish()
const req = buildOidbRequest(0xEB7, 1, data)
await this.sendPacket(req.cmd, req.data)
}
async setGroupSpecialTitle(groupCode: number, uid: string, title: string) {
this.check()
const data = Oidb.Oidb_0X8FC_2.encode({
groupCode,
body: {
targetUid: uid,
specialTitle: title,
expiredTime: -1,
uinName: title
}
}).finish()
const req = buildOidbRequest(0X8FC, 2, data, false)
await this.sendPacket(req.cmd, req.data)
}
}
function buildOidbRequest(cmd: number, subCmd: number, body: Uint8Array, reserved = true) {
const data = Oidb.Base.encode({
command: cmd,
subCommand: subCmd,
body,
isReserved: reserved ? 1 : 0
}).finish()
return {
cmd: `OidbSvcTrpcTcp.0x${cmd.toString(16).toUpperCase()}_${subCmd}`,
data: Buffer.from(data).toString('hex')
}
}

View File

@@ -0,0 +1,35 @@
import os from 'os'
import offset from '@/ntqqapi/helper/offset.json'
import { getFullVersion } from '@/common/utils'
function getSupportVersions() {
let fullVersionStart: string = ''
switch (os.platform()) {
case 'linux':
fullVersionStart = '3'
break
case 'darwin':
fullVersionStart = '6'
break
case 'win32':
fullVersionStart = '9'
break
}
const supportVersions: string[] = []
for (const offsetKey in offset) {
if (offsetKey.startsWith(fullVersionStart) && offsetKey.endsWith(os.arch())) {
supportVersions.push(offsetKey)
}
}
return supportVersions
}
export function checkSupportVersion(){
// 检查当前 QQ 版本是否支持,不支持则抛出异常
const qqFullVersion = getFullVersion() // todo: 去除llqqnt依赖
const _ = offset[qqFullVersion + '-' + os.arch()]
if (!_) {
const supportVersion = getSupportVersions()
throw new Error('当前 QQ 版本不支持, 只支持: ' + supportVersion.join(', '))
}
}

View File

@@ -1,13 +1,13 @@
import { WrapperSession } from './wrapper-session/types';
export { initWrapperSession } from './wrapper-session';
export declare function checkSupportVersion(): void;
export declare class NTQQPacketApi {
private qqVersion;
private packetSession;
private readonly packetClient;
private readonly packer;
private logger;
private readonly wrapperSession;
constructor(wrapperSession: WrapperSession);
get available(): boolean;
private checkQQVersion;
private InitSendPacket;
private sendPacket;
private sendOidbPacket;

File diff suppressed because one or more lines are too long

View File

@@ -29,7 +29,8 @@ export enum NTClass {
SKEY_API = 'ns-SkeyApi',
GROUP_HOME_WORK = 'ns-GroupHomeWork',
GROUP_ESSENCE = 'ns-GroupEssence',
NODE_STORE_API = 'ns-NodeStoreApi'
NODE_STORE_API = 'ns-NodeStoreApi',
QQ_EX_API = 'ns-QQEXApi',
}
export enum NTMethod {

View File

@@ -2186,3 +2186,367 @@ export namespace RichMedia {
public static getTypeUrl(typeUrlPrefix?: string): string;
}
}
/** Namespace Oidb. */
export namespace Oidb {
/** Properties of a Base. */
interface IBase {
/** Base command */
command?: (number|null);
/** Base subCommand */
subCommand?: (number|null);
/** Base errorCode */
errorCode?: (number|null);
/** Base body */
body?: (Uint8Array|null);
/** Base errorMsg */
errorMsg?: (string|null);
/** Base isReserved */
isReserved?: (number|null);
}
/** Represents a Base. */
class Base implements IBase {
/**
* Constructs a new Base.
* @param [properties] Properties to set
*/
constructor(properties?: Oidb.IBase);
/** Base command. */
public command: number;
/** Base subCommand. */
public subCommand: number;
/** Base errorCode. */
public errorCode: number;
/** Base body. */
public body: Uint8Array;
/** Base errorMsg. */
public errorMsg?: (string|null);
/** Base isReserved. */
public isReserved: number;
/**
* Encodes the specified Base message. Does not implicitly {@link Oidb.Base.verify|verify} messages.
* @param message Base message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: Oidb.IBase, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes a Base message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns Base
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Oidb.Base;
/**
* Gets the default type url for Base
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
/** Properties of an Oidb_0xED3_1. */
interface IOidb_0xED3_1 {
/** Oidb_0xED3_1 uin */
uin?: (number|null);
/** Oidb_0xED3_1 groupCode */
groupCode?: (number|null);
/** Oidb_0xED3_1 friendUin */
friendUin?: (number|null);
/** Oidb_0xED3_1 ext */
ext?: (number|null);
}
/** Represents an Oidb_0xED3_1. */
class Oidb_0xED3_1 implements IOidb_0xED3_1 {
/**
* Constructs a new Oidb_0xED3_1.
* @param [properties] Properties to set
*/
constructor(properties?: Oidb.IOidb_0xED3_1);
/** Oidb_0xED3_1 uin. */
public uin: number;
/** Oidb_0xED3_1 groupCode. */
public groupCode: number;
/** Oidb_0xED3_1 friendUin. */
public friendUin: number;
/** Oidb_0xED3_1 ext. */
public ext?: (number|null);
/**
* Encodes the specified Oidb_0xED3_1 message. Does not implicitly {@link Oidb.Oidb_0xED3_1.verify|verify} messages.
* @param message Oidb_0xED3_1 message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: Oidb.IOidb_0xED3_1, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes an Oidb_0xED3_1 message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns Oidb_0xED3_1
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Oidb.Oidb_0xED3_1;
/**
* Gets the default type url for Oidb_0xED3_1
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
/** Properties of an Oidb_0xEB7_1. */
interface IOidb_0xEB7_1 {
/** Oidb_0xEB7_1 body */
body?: (Oidb.IOidb_0xEB7_1_Body|null);
}
/** Represents an Oidb_0xEB7_1. */
class Oidb_0xEB7_1 implements IOidb_0xEB7_1 {
/**
* Constructs a new Oidb_0xEB7_1.
* @param [properties] Properties to set
*/
constructor(properties?: Oidb.IOidb_0xEB7_1);
/** Oidb_0xEB7_1 body. */
public body?: (Oidb.IOidb_0xEB7_1_Body|null);
/**
* Encodes the specified Oidb_0xEB7_1 message. Does not implicitly {@link Oidb.Oidb_0xEB7_1.verify|verify} messages.
* @param message Oidb_0xEB7_1 message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: Oidb.IOidb_0xEB7_1, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes an Oidb_0xEB7_1 message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns Oidb_0xEB7_1
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Oidb.Oidb_0xEB7_1;
/**
* Gets the default type url for Oidb_0xEB7_1
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
/** Properties of an Oidb_0xEB7_1_Body. */
interface IOidb_0xEB7_1_Body {
/** Oidb_0xEB7_1_Body uin */
uin?: (string|null);
/** Oidb_0xEB7_1_Body groupCode */
groupCode?: (string|null);
/** Oidb_0xEB7_1_Body version */
version?: (string|null);
}
/** Represents an Oidb_0xEB7_1_Body. */
class Oidb_0xEB7_1_Body implements IOidb_0xEB7_1_Body {
/**
* Constructs a new Oidb_0xEB7_1_Body.
* @param [properties] Properties to set
*/
constructor(properties?: Oidb.IOidb_0xEB7_1_Body);
/** Oidb_0xEB7_1_Body uin. */
public uin: string;
/** Oidb_0xEB7_1_Body groupCode. */
public groupCode: string;
/** Oidb_0xEB7_1_Body version. */
public version: string;
/**
* Encodes the specified Oidb_0xEB7_1_Body message. Does not implicitly {@link Oidb.Oidb_0xEB7_1_Body.verify|verify} messages.
* @param message Oidb_0xEB7_1_Body message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: Oidb.IOidb_0xEB7_1_Body, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes an Oidb_0xEB7_1_Body message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns Oidb_0xEB7_1_Body
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Oidb.Oidb_0xEB7_1_Body;
/**
* Gets the default type url for Oidb_0xEB7_1_Body
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
/** Properties of an Oidb_0X8FC_2. */
interface IOidb_0X8FC_2 {
/** Oidb_0X8FC_2 groupCode */
groupCode?: (number|null);
/** Oidb_0X8FC_2 body */
body?: (Oidb.IOidb_0X8FC_2_Body|null);
}
/** Represents an Oidb_0X8FC_2. */
class Oidb_0X8FC_2 implements IOidb_0X8FC_2 {
/**
* Constructs a new Oidb_0X8FC_2.
* @param [properties] Properties to set
*/
constructor(properties?: Oidb.IOidb_0X8FC_2);
/** Oidb_0X8FC_2 groupCode. */
public groupCode: number;
/** Oidb_0X8FC_2 body. */
public body?: (Oidb.IOidb_0X8FC_2_Body|null);
/**
* Encodes the specified Oidb_0X8FC_2 message. Does not implicitly {@link Oidb.Oidb_0X8FC_2.verify|verify} messages.
* @param message Oidb_0X8FC_2 message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: Oidb.IOidb_0X8FC_2, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes an Oidb_0X8FC_2 message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns Oidb_0X8FC_2
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Oidb.Oidb_0X8FC_2;
/**
* Gets the default type url for Oidb_0X8FC_2
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
/** Properties of an Oidb_0X8FC_2_Body. */
interface IOidb_0X8FC_2_Body {
/** Oidb_0X8FC_2_Body targetUid */
targetUid?: (string|null);
/** Oidb_0X8FC_2_Body specialTitle */
specialTitle?: (string|null);
/** Oidb_0X8FC_2_Body expiredTime */
expiredTime?: (number|null);
/** Oidb_0X8FC_2_Body uinName */
uinName?: (string|null);
/** Oidb_0X8FC_2_Body targetName */
targetName?: (string|null);
}
/** Represents an Oidb_0X8FC_2_Body. */
class Oidb_0X8FC_2_Body implements IOidb_0X8FC_2_Body {
/**
* Constructs a new Oidb_0X8FC_2_Body.
* @param [properties] Properties to set
*/
constructor(properties?: Oidb.IOidb_0X8FC_2_Body);
/** Oidb_0X8FC_2_Body targetUid. */
public targetUid: string;
/** Oidb_0X8FC_2_Body specialTitle. */
public specialTitle: string;
/** Oidb_0X8FC_2_Body expiredTime. */
public expiredTime: number;
/** Oidb_0X8FC_2_Body uinName. */
public uinName: string;
/** Oidb_0X8FC_2_Body targetName. */
public targetName: string;
/**
* Encodes the specified Oidb_0X8FC_2_Body message. Does not implicitly {@link Oidb.Oidb_0X8FC_2_Body.verify|verify} messages.
* @param message Oidb_0X8FC_2_Body message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: Oidb.IOidb_0X8FC_2_Body, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes an Oidb_0X8FC_2_Body message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns Oidb_0X8FC_2_Body
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Oidb.Oidb_0X8FC_2_Body;
/**
* Gets the default type url for Oidb_0X8FC_2_Body
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
}

View File

@@ -5421,4 +5421,841 @@ export const RichMedia = $root.RichMedia = (() => {
return RichMedia;
})();
export const Oidb = $root.Oidb = (() => {
/**
* Namespace Oidb.
* @exports Oidb
* @namespace
*/
const Oidb = {};
Oidb.Base = (function() {
/**
* Properties of a Base.
* @memberof Oidb
* @interface IBase
* @property {number|null} [command] Base command
* @property {number|null} [subCommand] Base subCommand
* @property {number|null} [errorCode] Base errorCode
* @property {Uint8Array|null} [body] Base body
* @property {string|null} [errorMsg] Base errorMsg
* @property {number|null} [isReserved] Base isReserved
*/
/**
* Constructs a new Base.
* @memberof Oidb
* @classdesc Represents a Base.
* @implements IBase
* @constructor
* @param {Oidb.IBase=} [properties] Properties to set
*/
function Base(properties) {
if (properties)
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* Base command.
* @member {number} command
* @memberof Oidb.Base
* @instance
*/
Base.prototype.command = 0;
/**
* Base subCommand.
* @member {number} subCommand
* @memberof Oidb.Base
* @instance
*/
Base.prototype.subCommand = 0;
/**
* Base errorCode.
* @member {number} errorCode
* @memberof Oidb.Base
* @instance
*/
Base.prototype.errorCode = 0;
/**
* Base body.
* @member {Uint8Array} body
* @memberof Oidb.Base
* @instance
*/
Base.prototype.body = $util.newBuffer([]);
/**
* Base errorMsg.
* @member {string|null|undefined} errorMsg
* @memberof Oidb.Base
* @instance
*/
Base.prototype.errorMsg = null;
/**
* Base isReserved.
* @member {number} isReserved
* @memberof Oidb.Base
* @instance
*/
Base.prototype.isReserved = 0;
// OneOf field names bound to virtual getters and setters
let $oneOfFields;
// Virtual OneOf for proto3 optional field
Object.defineProperty(Base.prototype, "_errorMsg", {
get: $util.oneOfGetter($oneOfFields = ["errorMsg"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* Encodes the specified Base message. Does not implicitly {@link Oidb.Base.verify|verify} messages.
* @function encode
* @memberof Oidb.Base
* @static
* @param {Oidb.IBase} message Base message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
Base.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.command != null && Object.hasOwnProperty.call(message, "command"))
writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.command);
if (message.subCommand != null && Object.hasOwnProperty.call(message, "subCommand"))
writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.subCommand);
if (message.errorCode != null && Object.hasOwnProperty.call(message, "errorCode"))
writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.errorCode);
if (message.body != null && Object.hasOwnProperty.call(message, "body"))
writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.body);
if (message.errorMsg != null && Object.hasOwnProperty.call(message, "errorMsg"))
writer.uint32(/* id 5, wireType 2 =*/42).string(message.errorMsg);
if (message.isReserved != null && Object.hasOwnProperty.call(message, "isReserved"))
writer.uint32(/* id 12, wireType 0 =*/96).uint32(message.isReserved);
return writer;
};
/**
* Decodes a Base message from the specified reader or buffer.
* @function decode
* @memberof Oidb.Base
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {Oidb.Base} Base
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
Base.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
let end = length === undefined ? reader.len : reader.pos + length, message = new $root.Oidb.Base();
while (reader.pos < end) {
let tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.command = reader.uint32();
break;
}
case 2: {
message.subCommand = reader.uint32();
break;
}
case 3: {
message.errorCode = reader.uint32();
break;
}
case 4: {
message.body = reader.bytes();
break;
}
case 5: {
message.errorMsg = reader.string();
break;
}
case 12: {
message.isReserved = reader.uint32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Gets the default type url for Base
* @function getTypeUrl
* @memberof Oidb.Base
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
Base.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/Oidb.Base";
};
return Base;
})();
Oidb.Oidb_0xED3_1 = (function() {
/**
* Properties of an Oidb_0xED3_1.
* @memberof Oidb
* @interface IOidb_0xED3_1
* @property {number|null} [uin] Oidb_0xED3_1 uin
* @property {number|null} [groupCode] Oidb_0xED3_1 groupCode
* @property {number|null} [friendUin] Oidb_0xED3_1 friendUin
* @property {number|null} [ext] Oidb_0xED3_1 ext
*/
/**
* Constructs a new Oidb_0xED3_1.
* @memberof Oidb
* @classdesc Represents an Oidb_0xED3_1.
* @implements IOidb_0xED3_1
* @constructor
* @param {Oidb.IOidb_0xED3_1=} [properties] Properties to set
*/
function Oidb_0xED3_1(properties) {
if (properties)
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* Oidb_0xED3_1 uin.
* @member {number} uin
* @memberof Oidb.Oidb_0xED3_1
* @instance
*/
Oidb_0xED3_1.prototype.uin = 0;
/**
* Oidb_0xED3_1 groupCode.
* @member {number} groupCode
* @memberof Oidb.Oidb_0xED3_1
* @instance
*/
Oidb_0xED3_1.prototype.groupCode = 0;
/**
* Oidb_0xED3_1 friendUin.
* @member {number} friendUin
* @memberof Oidb.Oidb_0xED3_1
* @instance
*/
Oidb_0xED3_1.prototype.friendUin = 0;
/**
* Oidb_0xED3_1 ext.
* @member {number|null|undefined} ext
* @memberof Oidb.Oidb_0xED3_1
* @instance
*/
Oidb_0xED3_1.prototype.ext = null;
// OneOf field names bound to virtual getters and setters
let $oneOfFields;
// Virtual OneOf for proto3 optional field
Object.defineProperty(Oidb_0xED3_1.prototype, "_ext", {
get: $util.oneOfGetter($oneOfFields = ["ext"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* Encodes the specified Oidb_0xED3_1 message. Does not implicitly {@link Oidb.Oidb_0xED3_1.verify|verify} messages.
* @function encode
* @memberof Oidb.Oidb_0xED3_1
* @static
* @param {Oidb.IOidb_0xED3_1} message Oidb_0xED3_1 message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
Oidb_0xED3_1.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.uin != null && Object.hasOwnProperty.call(message, "uin"))
writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.uin);
if (message.groupCode != null && Object.hasOwnProperty.call(message, "groupCode"))
writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.groupCode);
if (message.friendUin != null && Object.hasOwnProperty.call(message, "friendUin"))
writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.friendUin);
if (message.ext != null && Object.hasOwnProperty.call(message, "ext"))
writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.ext);
return writer;
};
/**
* Decodes an Oidb_0xED3_1 message from the specified reader or buffer.
* @function decode
* @memberof Oidb.Oidb_0xED3_1
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {Oidb.Oidb_0xED3_1} Oidb_0xED3_1
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
Oidb_0xED3_1.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
let end = length === undefined ? reader.len : reader.pos + length, message = new $root.Oidb.Oidb_0xED3_1();
while (reader.pos < end) {
let tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.uin = reader.uint32();
break;
}
case 2: {
message.groupCode = reader.uint32();
break;
}
case 5: {
message.friendUin = reader.uint32();
break;
}
case 6: {
message.ext = reader.uint32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Gets the default type url for Oidb_0xED3_1
* @function getTypeUrl
* @memberof Oidb.Oidb_0xED3_1
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
Oidb_0xED3_1.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/Oidb.Oidb_0xED3_1";
};
return Oidb_0xED3_1;
})();
Oidb.Oidb_0xEB7_1 = (function() {
/**
* Properties of an Oidb_0xEB7_1.
* @memberof Oidb
* @interface IOidb_0xEB7_1
* @property {Oidb.IOidb_0xEB7_1_Body|null} [body] Oidb_0xEB7_1 body
*/
/**
* Constructs a new Oidb_0xEB7_1.
* @memberof Oidb
* @classdesc Represents an Oidb_0xEB7_1.
* @implements IOidb_0xEB7_1
* @constructor
* @param {Oidb.IOidb_0xEB7_1=} [properties] Properties to set
*/
function Oidb_0xEB7_1(properties) {
if (properties)
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* Oidb_0xEB7_1 body.
* @member {Oidb.IOidb_0xEB7_1_Body|null|undefined} body
* @memberof Oidb.Oidb_0xEB7_1
* @instance
*/
Oidb_0xEB7_1.prototype.body = null;
/**
* Encodes the specified Oidb_0xEB7_1 message. Does not implicitly {@link Oidb.Oidb_0xEB7_1.verify|verify} messages.
* @function encode
* @memberof Oidb.Oidb_0xEB7_1
* @static
* @param {Oidb.IOidb_0xEB7_1} message Oidb_0xEB7_1 message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
Oidb_0xEB7_1.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.body != null && Object.hasOwnProperty.call(message, "body"))
$root.Oidb.Oidb_0xEB7_1_Body.encode(message.body, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
return writer;
};
/**
* Decodes an Oidb_0xEB7_1 message from the specified reader or buffer.
* @function decode
* @memberof Oidb.Oidb_0xEB7_1
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {Oidb.Oidb_0xEB7_1} Oidb_0xEB7_1
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
Oidb_0xEB7_1.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
let end = length === undefined ? reader.len : reader.pos + length, message = new $root.Oidb.Oidb_0xEB7_1();
while (reader.pos < end) {
let tag = reader.uint32();
switch (tag >>> 3) {
case 2: {
message.body = $root.Oidb.Oidb_0xEB7_1_Body.decode(reader, reader.uint32());
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Gets the default type url for Oidb_0xEB7_1
* @function getTypeUrl
* @memberof Oidb.Oidb_0xEB7_1
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
Oidb_0xEB7_1.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/Oidb.Oidb_0xEB7_1";
};
return Oidb_0xEB7_1;
})();
Oidb.Oidb_0xEB7_1_Body = (function() {
/**
* Properties of an Oidb_0xEB7_1_Body.
* @memberof Oidb
* @interface IOidb_0xEB7_1_Body
* @property {string|null} [uin] Oidb_0xEB7_1_Body uin
* @property {string|null} [groupCode] Oidb_0xEB7_1_Body groupCode
* @property {string|null} [version] Oidb_0xEB7_1_Body version
*/
/**
* Constructs a new Oidb_0xEB7_1_Body.
* @memberof Oidb
* @classdesc Represents an Oidb_0xEB7_1_Body.
* @implements IOidb_0xEB7_1_Body
* @constructor
* @param {Oidb.IOidb_0xEB7_1_Body=} [properties] Properties to set
*/
function Oidb_0xEB7_1_Body(properties) {
if (properties)
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* Oidb_0xEB7_1_Body uin.
* @member {string} uin
* @memberof Oidb.Oidb_0xEB7_1_Body
* @instance
*/
Oidb_0xEB7_1_Body.prototype.uin = "";
/**
* Oidb_0xEB7_1_Body groupCode.
* @member {string} groupCode
* @memberof Oidb.Oidb_0xEB7_1_Body
* @instance
*/
Oidb_0xEB7_1_Body.prototype.groupCode = "";
/**
* Oidb_0xEB7_1_Body version.
* @member {string} version
* @memberof Oidb.Oidb_0xEB7_1_Body
* @instance
*/
Oidb_0xEB7_1_Body.prototype.version = "";
/**
* Encodes the specified Oidb_0xEB7_1_Body message. Does not implicitly {@link Oidb.Oidb_0xEB7_1_Body.verify|verify} messages.
* @function encode
* @memberof Oidb.Oidb_0xEB7_1_Body
* @static
* @param {Oidb.IOidb_0xEB7_1_Body} message Oidb_0xEB7_1_Body message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
Oidb_0xEB7_1_Body.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.uin != null && Object.hasOwnProperty.call(message, "uin"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.uin);
if (message.groupCode != null && Object.hasOwnProperty.call(message, "groupCode"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.groupCode);
if (message.version != null && Object.hasOwnProperty.call(message, "version"))
writer.uint32(/* id 3, wireType 2 =*/26).string(message.version);
return writer;
};
/**
* Decodes an Oidb_0xEB7_1_Body message from the specified reader or buffer.
* @function decode
* @memberof Oidb.Oidb_0xEB7_1_Body
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {Oidb.Oidb_0xEB7_1_Body} Oidb_0xEB7_1_Body
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
Oidb_0xEB7_1_Body.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
let end = length === undefined ? reader.len : reader.pos + length, message = new $root.Oidb.Oidb_0xEB7_1_Body();
while (reader.pos < end) {
let tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.uin = reader.string();
break;
}
case 2: {
message.groupCode = reader.string();
break;
}
case 3: {
message.version = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Gets the default type url for Oidb_0xEB7_1_Body
* @function getTypeUrl
* @memberof Oidb.Oidb_0xEB7_1_Body
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
Oidb_0xEB7_1_Body.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/Oidb.Oidb_0xEB7_1_Body";
};
return Oidb_0xEB7_1_Body;
})();
Oidb.Oidb_0X8FC_2 = (function() {
/**
* Properties of an Oidb_0X8FC_2.
* @memberof Oidb
* @interface IOidb_0X8FC_2
* @property {number|null} [groupCode] Oidb_0X8FC_2 groupCode
* @property {Oidb.IOidb_0X8FC_2_Body|null} [body] Oidb_0X8FC_2 body
*/
/**
* Constructs a new Oidb_0X8FC_2.
* @memberof Oidb
* @classdesc Represents an Oidb_0X8FC_2.
* @implements IOidb_0X8FC_2
* @constructor
* @param {Oidb.IOidb_0X8FC_2=} [properties] Properties to set
*/
function Oidb_0X8FC_2(properties) {
if (properties)
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* Oidb_0X8FC_2 groupCode.
* @member {number} groupCode
* @memberof Oidb.Oidb_0X8FC_2
* @instance
*/
Oidb_0X8FC_2.prototype.groupCode = 0;
/**
* Oidb_0X8FC_2 body.
* @member {Oidb.IOidb_0X8FC_2_Body|null|undefined} body
* @memberof Oidb.Oidb_0X8FC_2
* @instance
*/
Oidb_0X8FC_2.prototype.body = null;
/**
* Encodes the specified Oidb_0X8FC_2 message. Does not implicitly {@link Oidb.Oidb_0X8FC_2.verify|verify} messages.
* @function encode
* @memberof Oidb.Oidb_0X8FC_2
* @static
* @param {Oidb.IOidb_0X8FC_2} message Oidb_0X8FC_2 message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
Oidb_0X8FC_2.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.groupCode != null && Object.hasOwnProperty.call(message, "groupCode"))
writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.groupCode);
if (message.body != null && Object.hasOwnProperty.call(message, "body"))
$root.Oidb.Oidb_0X8FC_2_Body.encode(message.body, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
return writer;
};
/**
* Decodes an Oidb_0X8FC_2 message from the specified reader or buffer.
* @function decode
* @memberof Oidb.Oidb_0X8FC_2
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {Oidb.Oidb_0X8FC_2} Oidb_0X8FC_2
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
Oidb_0X8FC_2.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
let end = length === undefined ? reader.len : reader.pos + length, message = new $root.Oidb.Oidb_0X8FC_2();
while (reader.pos < end) {
let tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.groupCode = reader.uint32();
break;
}
case 3: {
message.body = $root.Oidb.Oidb_0X8FC_2_Body.decode(reader, reader.uint32());
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Gets the default type url for Oidb_0X8FC_2
* @function getTypeUrl
* @memberof Oidb.Oidb_0X8FC_2
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
Oidb_0X8FC_2.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/Oidb.Oidb_0X8FC_2";
};
return Oidb_0X8FC_2;
})();
Oidb.Oidb_0X8FC_2_Body = (function() {
/**
* Properties of an Oidb_0X8FC_2_Body.
* @memberof Oidb
* @interface IOidb_0X8FC_2_Body
* @property {string|null} [targetUid] Oidb_0X8FC_2_Body targetUid
* @property {string|null} [specialTitle] Oidb_0X8FC_2_Body specialTitle
* @property {number|null} [expiredTime] Oidb_0X8FC_2_Body expiredTime
* @property {string|null} [uinName] Oidb_0X8FC_2_Body uinName
* @property {string|null} [targetName] Oidb_0X8FC_2_Body targetName
*/
/**
* Constructs a new Oidb_0X8FC_2_Body.
* @memberof Oidb
* @classdesc Represents an Oidb_0X8FC_2_Body.
* @implements IOidb_0X8FC_2_Body
* @constructor
* @param {Oidb.IOidb_0X8FC_2_Body=} [properties] Properties to set
*/
function Oidb_0X8FC_2_Body(properties) {
if (properties)
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* Oidb_0X8FC_2_Body targetUid.
* @member {string} targetUid
* @memberof Oidb.Oidb_0X8FC_2_Body
* @instance
*/
Oidb_0X8FC_2_Body.prototype.targetUid = "";
/**
* Oidb_0X8FC_2_Body specialTitle.
* @member {string} specialTitle
* @memberof Oidb.Oidb_0X8FC_2_Body
* @instance
*/
Oidb_0X8FC_2_Body.prototype.specialTitle = "";
/**
* Oidb_0X8FC_2_Body expiredTime.
* @member {number} expiredTime
* @memberof Oidb.Oidb_0X8FC_2_Body
* @instance
*/
Oidb_0X8FC_2_Body.prototype.expiredTime = 0;
/**
* Oidb_0X8FC_2_Body uinName.
* @member {string} uinName
* @memberof Oidb.Oidb_0X8FC_2_Body
* @instance
*/
Oidb_0X8FC_2_Body.prototype.uinName = "";
/**
* Oidb_0X8FC_2_Body targetName.
* @member {string} targetName
* @memberof Oidb.Oidb_0X8FC_2_Body
* @instance
*/
Oidb_0X8FC_2_Body.prototype.targetName = "";
/**
* Encodes the specified Oidb_0X8FC_2_Body message. Does not implicitly {@link Oidb.Oidb_0X8FC_2_Body.verify|verify} messages.
* @function encode
* @memberof Oidb.Oidb_0X8FC_2_Body
* @static
* @param {Oidb.IOidb_0X8FC_2_Body} message Oidb_0X8FC_2_Body message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
Oidb_0X8FC_2_Body.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.targetUid != null && Object.hasOwnProperty.call(message, "targetUid"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.targetUid);
if (message.specialTitle != null && Object.hasOwnProperty.call(message, "specialTitle"))
writer.uint32(/* id 5, wireType 2 =*/42).string(message.specialTitle);
if (message.expiredTime != null && Object.hasOwnProperty.call(message, "expiredTime"))
writer.uint32(/* id 6, wireType 0 =*/48).sint32(message.expiredTime);
if (message.uinName != null && Object.hasOwnProperty.call(message, "uinName"))
writer.uint32(/* id 7, wireType 2 =*/58).string(message.uinName);
if (message.targetName != null && Object.hasOwnProperty.call(message, "targetName"))
writer.uint32(/* id 8, wireType 2 =*/66).string(message.targetName);
return writer;
};
/**
* Decodes an Oidb_0X8FC_2_Body message from the specified reader or buffer.
* @function decode
* @memberof Oidb.Oidb_0X8FC_2_Body
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {Oidb.Oidb_0X8FC_2_Body} Oidb_0X8FC_2_Body
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
Oidb_0X8FC_2_Body.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
let end = length === undefined ? reader.len : reader.pos + length, message = new $root.Oidb.Oidb_0X8FC_2_Body();
while (reader.pos < end) {
let tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.targetUid = reader.string();
break;
}
case 5: {
message.specialTitle = reader.string();
break;
}
case 6: {
message.expiredTime = reader.sint32();
break;
}
case 7: {
message.uinName = reader.string();
break;
}
case 8: {
message.targetName = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Gets the default type url for Oidb_0X8FC_2_Body
* @function getTypeUrl
* @memberof Oidb.Oidb_0X8FC_2_Body
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
Oidb_0X8FC_2_Body.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/Oidb.Oidb_0X8FC_2_Body";
};
return Oidb_0X8FC_2_Body;
})();
return Oidb;
})();
export { $root as default };

View File

@@ -0,0 +1,41 @@
syntax = "proto3";
package Oidb;
message Base {
uint32 command = 1;
uint32 subCommand = 2;
uint32 errorCode = 3;
bytes body = 4;
optional string errorMsg = 5;
uint32 isReserved = 12;
}
message Oidb_0xED3_1 {
uint32 uin = 1;
uint32 groupCode = 2;
uint32 friendUin = 5;
optional uint32 ext = 6;
}
message Oidb_0xEB7_1 {
Oidb_0xEB7_1_Body body = 2;
}
message Oidb_0xEB7_1_Body {
string uin = 1;
string groupCode = 2;
string version = 3;
}
message Oidb_0X8FC_2 {
uint32 groupCode = 1;
Oidb_0X8FC_2_Body body = 3;
}
message Oidb_0X8FC_2_Body {
string targetUid = 1;
string specialTitle = 5;
sint32 expiredTime = 6;
string uinName = 7;
string targetName = 8;
}

View File

@@ -13,7 +13,7 @@ export interface NodeIKernelBuddyService {
}[]
}>
setBuddyRemark(arg: unknown): void
setBuddyRemark(arg: unknown): Promise<GeneralCallResult>
isBuddy(uid: string): boolean

View File

@@ -12,4 +12,6 @@ export interface NodeIKernelNodeMiscService {
score: ''
}[]
}>
queryAutoRun(): Promise<boolean>
}

View File

@@ -1,10 +1,3 @@
export enum GroupListUpdateType {
REFRESHALL,
GETALL,
MODIFIED,
REMOVE
}
export interface Group {
groupCode: string
maxMember: number
@@ -188,3 +181,10 @@ export interface GroupBulletinListResult {
nextIndex: number
jointime: string
}
export enum GroupMsgMask {
AllowNotify = 1, // 允许提醒
AllowNotNotify = 4, // 接受消息不提醒
BoxNotNotify = 2, // 收进群助手不提醒
NotAllow = 3, // 屏蔽
}

View File

@@ -442,6 +442,7 @@ export interface RawMessage {
attrType: number
attrId: string
}>
isOnlineMsg: boolean
}
export interface Peer {

View File

@@ -1,6 +1,5 @@
import { BaseAction, Schema } from '../BaseAction'
import { ActionName } from '../types'
import { getBuildVersion } from '@/common/utils/misc'
import { selfInfo } from '@/common/globalVars'
interface Payload {
@@ -14,7 +13,7 @@ export class SendGroupSign extends BaseAction<Payload, null> {
})
async _handle(payload: Payload) {
await this.ctx.app.ntqqPacketApi.sendGroupSignPacket(selfInfo.uin, payload.group_id.toString())
await this.ctx.app.packet.sendGroupSignPacket(selfInfo.uin, payload.group_id.toString())
return null
}
}

View File

@@ -1,6 +1,5 @@
import { BaseAction, Schema } from '../BaseAction'
import { ActionName } from '../types'
import { getBuildVersion } from '@/common/utils/misc'
import { selfInfo } from '@/common/globalVars'
import { GroupMemberRole } from '@/ntqqapi/types'
@@ -25,7 +24,7 @@ export class SetGroupSpecialTitle extends BaseAction<Payload, null> {
if (self.role !== GroupMemberRole.Owner){
throw new Error(`不是群${payload.group_id}的群主,无法设置群头衔`)
}
await this.ctx.app.ntqqPacketApi.sendSetSpecialTittlePacket(payload.group_id.toString(), uid, payload.special_title || "")
await this.ctx.app.packet.sendSetSpecialTittlePacket(payload.group_id.toString(), uid, payload.special_title || "")
return null
}
}

View File

@@ -80,6 +80,11 @@ import { GetGroupFileSystemInfo } from './go-cqhttp/GetGroupFileSystemInfo'
import { GetCredentials } from './system/GetCredentials'
import { SetGroupSpecialTitle } from '@/onebot11/action/go-cqhttp/SetGroupSpecialTitle'
import { SendGroupSign } from '@/onebot11/action/go-cqhttp/SendGroupSign'
import { SetRestart } from '@/onebot11/action/system/SetRestart'
import { SetFriendCategory } from '@/onebot11/action/llonebot/SetFriendCategory'
import { SetFriendRemark } from '@/onebot11/action/llonebot/SetFriendRemark'
import { SetGroupMsgMask } from '@/onebot11/action/llonebot/SetGroupMsgMask'
import { SetGroupRemark } from '@/onebot11/action/llonebot/SetGroupRemark'
export function initActionMap(adapter: Adapter) {
const actionHandlers = [
@@ -100,6 +105,10 @@ export function initActionMap(adapter: Adapter) {
new GetRobotUinRange(adapter),
new GroupPoke(adapter),
new FriendPoke(adapter),
new SetFriendCategory(adapter),
new SetFriendRemark(adapter),
new SetGroupMsgMask(adapter),
new SetGroupRemark(adapter),
// onebot11
new SendLike(adapter),
new GetMsg(adapter),
@@ -133,6 +142,7 @@ export function initActionMap(adapter: Adapter) {
new ForwardFriendSingleMsg(adapter),
new ForwardGroupSingleMsg(adapter),
new GetCredentials(adapter),
new SetRestart(adapter),
// go-cqhttp
new GetEssenceMsgList(adapter),
new GetGroupHonorInfo(adapter),

View File

@@ -1,6 +1,6 @@
import { BaseAction, Schema } from '../BaseAction'
import { ActionName } from '../types'
import { getBuildVersion } from '@/common/utils/misc'
import { getBuildVersion } from '@/common/utils'
interface Payload {
user_id: number | string
@@ -13,15 +13,12 @@ export class FriendPoke extends BaseAction<Payload, null> {
})
async _handle(payload: Payload) {
// if (!this.ctx.app.native.checkPlatform()) {
// throw new Error('当前系统平台或架构不支持')
// }
// if (!this.ctx.app.native.checkVersion()) {
// throw new Error(`当前 QQ 版本 ${getBuildVersion()} 不支持,可尝试其他版本 27333—27597`)
// }
// await this.ctx.app.native.sendFriendPoke(+payload.user_id)
await this.ctx.app.ntqqPacketApi.sendPokePacket(+payload.user_id)
if (!this.ctx.app.native.checkPlatform() || !this.ctx.app.native.checkVersion()) {
await this.ctx.app.packet.sendPokePacket(+payload.user_id)
}
else{
await this.ctx.app.native.sendFriendPoke(+payload.user_id)
}
return null
}
}

View File

@@ -1,7 +1,6 @@
import { BaseAction, Schema } from '../BaseAction'
import { ActionName } from '../types'
import { getBuildVersion } from '@/common/utils/misc'
import {NTQQPacketApi} from '@/ntqqapi/native/napcat-protocol-packet'
import { getBuildVersion } from '@/common/utils'
interface Payload {
group_id: number | string
@@ -16,14 +15,12 @@ export class GroupPoke extends BaseAction<Payload, null> {
})
async _handle(payload: Payload) {
// if (!this.ctx.app.native.checkPlatform()) {
// throw new Error('当前系统平台或架构不支持')
// }
// if (!this.ctx.app.native.checkVersion()) {
// throw new Error(`当前 QQ 版本 ${getBuildVersion()} 不支持,可尝试其他版本 27333—27597`)
// }
// await this.ctx.app.native.sendGroupPoke(+payload.group_id, +payload.user_id)
await this.ctx.app.ntqqPacketApi.sendPokePacket(+payload.user_id, +payload.group_id)
if (!this.ctx.app.native.checkPlatform() || !this.ctx.app.native.checkVersion()) {
await this.ctx.app.packet.sendPokePacket(+payload.user_id, +payload.group_id)
}
else{
await this.ctx.app.native.sendGroupPoke(+payload.group_id, +payload.user_id)
}
return null
}
}

View File

@@ -0,0 +1,21 @@
import { BaseAction, Schema } from '../BaseAction'
import { ActionName } from '../types'
interface Payload {
user_id: number | string
category_id: number | string
}
export class SetFriendCategory extends BaseAction<Payload, unknown> {
actionName = ActionName.SetFriendCategory
payloadSchema = Schema.object({
user_id: Schema.union([Number, String]).required(),
category_id: Schema.union([Number, String]).required()
})
protected async _handle(payload: Payload) {
const uid = await this.ctx.ntUserApi.getUidByUin(payload.user_id.toString())
if (!uid) throw new Error('无法获取好友信息')
return this.ctx.ntFriendApi.setBuddyCategory(uid, +payload.category_id)
}
}

View File

@@ -0,0 +1,21 @@
import { BaseAction, Schema } from '../BaseAction'
import { ActionName } from '../types'
interface Payload {
user_id: number | string
remark?: string
}
export class SetFriendRemark extends BaseAction<Payload, unknown> {
actionName = ActionName.SetFriendRemark
payloadSchema = Schema.object({
user_id: Schema.union([Number, String]).required(),
remark: Schema.string()
})
protected async _handle(payload: Payload) {
const uid = await this.ctx.ntUserApi.getUidByUin(payload.user_id.toString())
if (!uid) throw new Error('无法获取好友信息')
return this.ctx.ntFriendApi.setBuddyRemark(uid, payload.remark || '')
}
}

View File

@@ -0,0 +1,19 @@
import { BaseAction, Schema } from '../BaseAction'
import { ActionName } from '../types'
interface Payload {
group_id: number | string
mask: number | string // 1, 2, 3, 4
}
export class SetGroupMsgMask extends BaseAction<Payload, unknown> {
actionName = ActionName.SetGroupMsgMask
payloadSchema = Schema.object({
group_id: Schema.union([Number, String]).required(),
mask: Schema.union([Number, String]).required()
})
protected async _handle(payload: Payload) {
return this.ctx.ntGroupApi.setGroupMsgMask(payload.group_id.toString(), +payload.mask)
}
}

View File

@@ -0,0 +1,15 @@
import { BaseAction } from '../BaseAction'
import { ActionName } from '../types'
interface Payload {
group_id: string,
remark?: string
}
export class SetGroupRemark extends BaseAction<Payload, unknown> {
actionName = ActionName.SetGroupRemark
protected async _handle(payload: Payload): Promise<unknown>{
return this.ctx.ntGroupApi.setGroupRemark(payload.group_id.toString(), payload.remark)
}
}

View File

@@ -7,62 +7,52 @@ import { ChatCacheListItemBasic, CacheFileType } from '@/ntqqapi/types'
export default class CleanCache extends BaseAction<void, void> {
actionName = ActionName.CleanCache
protected _handle(): Promise<void> {
return new Promise<void>(async (res, rej) => {
try {
// dbUtil.clearCache()
const cacheFilePaths: string[] = []
protected async _handle(): Promise<void> {
const cacheFilePaths: string[] = []
await this.ctx.ntFileCacheApi.setCacheSilentScan(false)
await this.ctx.ntFileCacheApi.setCacheSilentScan(false)
cacheFilePaths.push(await this.ctx.ntFileCacheApi.getHotUpdateCachePath())
cacheFilePaths.push(await this.ctx.ntFileCacheApi.getDesktopTmpPath())
cacheFilePaths.push(await this.ctx.ntFileCacheApi.getHotUpdateCachePath())
cacheFilePaths.push(await this.ctx.ntFileCacheApi.getDesktopTmpPath())
const list = await this.ctx.ntFileCacheApi.getCacheSessionPathList()
list.forEach((e) => cacheFilePaths.push(e.value))
const list = await this.ctx.ntFileCacheApi.getCacheSessionPathList()
list.forEach((e) => cacheFilePaths.push(e.value))
// await NTQQApi.addCacheScannedPaths(); // XXX: 调用就崩溃,原因目前还未知
const cacheScanResult = await this.ctx.ntFileCacheApi.scanCache()
const cacheSize = parseInt(cacheScanResult.size[6])
// await NTQQApi.addCacheScannedPaths(); // XXX: 调用就崩溃,原因目前还未知
const cacheScanResult = await this.ctx.ntFileCacheApi.scanCache()
const cacheSize = parseInt(cacheScanResult.size[6])
if (cacheScanResult.result !== 0) {
throw 'Something went wrong while scanning cache. Code: ' + cacheScanResult.result
}
if (cacheScanResult.result !== 0) {
throw 'Something went wrong while scanning cache. Code: ' + cacheScanResult.result
}
await this.ctx.ntFileCacheApi.setCacheSilentScan(true)
if (cacheSize > 0 && cacheFilePaths.length > 2) {
// 存在缓存文件且大小不为 0 时执行清理动作
// await NTQQApi.clearCache([ 'tmp', 'hotUpdate', ...cacheScanResult ]) // XXX: 也是调用就崩溃,调用 fs 删除得了
deleteCachePath(cacheFilePaths)
}
await this.ctx.ntFileCacheApi.setCacheSilentScan(true)
if (cacheSize > 0 && cacheFilePaths.length > 2) {
// 存在缓存文件且大小不为 0 时执行清理动作
// await NTQQApi.clearCache([ 'tmp', 'hotUpdate', ...cacheScanResult ]) // XXX: 也是调用就崩溃,调用 fs 删除得了
deleteCachePath(cacheFilePaths)
}
// 获取聊天记录列表
// NOTE: 以防有人不需要删除聊天记录,暂时先注释掉,日后加个开关
// const privateChatCache = await getCacheList(ChatType.friend); // 私聊消息
// const groupChatCache = await getCacheList(ChatType.group); // 群聊消息
// const chatCacheList = [ ...privateChatCache, ...groupChatCache ];
const chatCacheList: ChatCacheListItemBasic[] = []
// 获取聊天记录列表
// NOTE: 以防有人不需要删除聊天记录,暂时先注释掉,日后加个开关
// const privateChatCache = await getCacheList(ChatType.friend); // 私聊消息
// const groupChatCache = await getCacheList(ChatType.group); // 群聊消息
// const chatCacheList = [ ...privateChatCache, ...groupChatCache ];
const chatCacheList: ChatCacheListItemBasic[] = []
// 获取聊天缓存文件列表
const cacheFileList: string[] = []
// 获取聊天缓存文件列表
const cacheFileList: string[] = []
for (const name in CacheFileType) {
if (!isNaN(parseInt(name))) continue
for (const name in CacheFileType) {
if (!isNaN(parseInt(name))) continue
const fileTypeAny: any = CacheFileType[name]
const fileType: CacheFileType = fileTypeAny
const fileType = CacheFileType[name] as unknown as CacheFileType
cacheFileList.push(...(await this.ctx.ntFileCacheApi.getFileCacheInfo(fileType)).infos.map((file) => file.fileKey))
}
cacheFileList.push(...(await this.ctx.ntFileCacheApi.getFileCacheInfo(fileType)).infos.map((file) => file.fileKey))
}
// 一并清除
await this.ctx.ntFileCacheApi.clearChatCache(chatCacheList, cacheFileList)
res()
} catch (e) {
console.error('清理缓存时发生了错误')
rej(e)
}
})
// 一并清除
await this.ctx.ntFileCacheApi.clearChatCache(chatCacheList, cacheFileList)
}
}

View File

@@ -0,0 +1,10 @@
import { BaseAction } from '@/onebot11/action/BaseAction'
import { ActionName } from '@/onebot11/action/types'
export class SetRestart extends BaseAction<null, void> {
actionName = ActionName.SetRestart
protected async _handle() {
await this.ctx.ntSystemApi.restart()
}
}

View File

@@ -29,6 +29,10 @@ export enum ActionName {
GetRobotUinRange = 'get_robot_uin_range',
GroupPoke = 'group_poke',
FriendPoke = 'friend_poke',
SetFriendRemark = 'set_friend_remark',
SetFriendCategory = 'set_friend_category',
SetGroupMsgMask = 'set_group_msg_mask',
SetGroupRemark = 'set_group_remark',
// onebot 11
SendLike = 'send_like',
GetLoginInfo = 'get_login_info',
@@ -47,6 +51,7 @@ export enum ActionName {
SetGroupLeave = 'set_group_leave',
GetVersionInfo = 'get_version_info',
GetStatus = 'get_status',
SetRestart = 'set_restart',
CanSendRecord = 'can_send_record',
CanSendImage = 'can_send_image',
SetGroupKick = 'set_group_kick',

View File

@@ -221,7 +221,7 @@ export class MessageEncoder {
}
}
async generate(content: any[]) {
async generate(content: OB11MessageData[]) {
await this.render(content)
return {
multiMsgItems: [{

View File

@@ -11,6 +11,10 @@ function isEmpty(value: unknown) {
}
async function onSettingWindowCreated(view: Element) {
console.log(view)
if (!view){
return
}
const config = await window.llonebot.getConfig()
const ob11Config = { ...config.ob11 }
@@ -247,7 +251,9 @@ async function onSettingWindowCreated(view: Element) {
} else {
errDom?.classList.add('show')
}
errCodeDom!.innerHTML = errMsg
if (errCodeDom) {
errCodeDom.innerHTML = errMsg
}
}
showError().then()
@@ -456,8 +462,8 @@ async function onSettingWindowCreated(view: Element) {
}
window.llonebot.checkVersion().then(checkVersionFunc)
window.addEventListener('beforeunload', () => {
window.llonebot.getConfig().then(oldConfig=>{
if(JSON.stringify(oldConfig) !== JSON.stringify(config)){
window.llonebot.getConfig().then(oldConfig => {
if (JSON.stringify(oldConfig) !== JSON.stringify(config)) {
window.llonebot.setConfig(true, config)
}
})

View File

@@ -91,7 +91,7 @@ class SatoriAdapter extends Service {
input.subMsgType === 12 &&
input.elements[0]?.grayTipElement?.xmlElement?.templId === '10382'
) {
// 机器人被表情回应
}
else {
// 普通的消息

View File

@@ -1 +1 @@
export const version = '4.2.0'
export const version = '4.3.2'