mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e7222653fa | ||
![]() |
014f0758f5 | ||
![]() |
0e8b416f6d | ||
![]() |
09a60a2204 |
@@ -4,7 +4,7 @@
|
||||
"name": "NapCatQQ",
|
||||
"slug": "NapCat.Framework",
|
||||
"description": "高性能的 OneBot 11 协议实现",
|
||||
"version": "3.0.5",
|
||||
"version": "3.0.6",
|
||||
"icon": "./logo.png",
|
||||
"authors": [
|
||||
{
|
||||
|
@@ -2,7 +2,7 @@
|
||||
"name": "napcat",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"version": "3.0.5",
|
||||
"version": "3.0.6",
|
||||
"scripts": {
|
||||
"build:framework": "vite build --mode framework",
|
||||
"build:shell": "vite build --mode shell",
|
||||
@@ -49,4 +49,4 @@
|
||||
"silk-wasm": "^3.6.1",
|
||||
"ws": "^8.18.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1 +1 @@
|
||||
export const napCatVersion = '3.0.5';
|
||||
export const napCatVersion = '3.0.6';
|
||||
|
@@ -73,8 +73,8 @@ export class NTQQPacketApi {
|
||||
return this.packetSession!.client.sendPacket(cmd, data, rsp);
|
||||
}
|
||||
|
||||
async sendPokePacket(group: number, peer: number) {
|
||||
const data = this.packetSession?.packer.packPokePacket(group, peer);
|
||||
async sendPokePacket(peer: number, group?: number) {
|
||||
const data = this.packetSession?.packer.packPokePacket(peer, group);
|
||||
await this.sendPacket('OidbSvcTrpcTcp.0xed3_1', data!, false);
|
||||
}
|
||||
|
||||
|
@@ -47,11 +47,11 @@ export class PacketPacker {
|
||||
});
|
||||
}
|
||||
|
||||
packPokePacket(group: number, peer: number): PacketHexStr {
|
||||
packPokePacket(peer: number, group?: number): PacketHexStr {
|
||||
const oidb_0xed3 = new NapProtoMsg(OidbSvcTrpcTcp0XED3_1).encode({
|
||||
uin: peer,
|
||||
groupUin: group,
|
||||
friendUin: group,
|
||||
friendUin: group ?? peer,
|
||||
ext: 0
|
||||
});
|
||||
return this.toHexStr(this.packOidbPacket(0xed3, 1, oidb_0xed3));
|
||||
|
@@ -18,6 +18,6 @@ export class GroupPoke extends GetPacketStatusDepends<Payload, any> {
|
||||
payloadSchema = SchemaData;
|
||||
|
||||
async _handle(payload: Payload) {
|
||||
await this.core.apis.PacketApi.sendPokePacket(+payload.group_id, +payload.user_id);
|
||||
await this.core.apis.PacketApi.sendPokePacket(+payload.user_id, +payload.group_id);
|
||||
}
|
||||
}
|
||||
|
@@ -91,6 +91,7 @@ import { GetGroupShutList } from './group/GetGroupShutList';
|
||||
import { GetGroupMemberList } from './group/GetGroupMemberList';
|
||||
import { GetGroupFileUrl } from "@/onebot/action/file/GetGroupFileUrl";
|
||||
import {GetPacketStatus} from "@/onebot/action/packet/GetPacketStatus";
|
||||
import {FriendPoke} from "@/onebot/action/user/FriendPoke";
|
||||
|
||||
|
||||
export type ActionMap = Map<string, BaseAction<any, any>>;
|
||||
@@ -189,6 +190,7 @@ export function createActionMap(obContext: NapCatOneBot11Adapter, core: NapCatCo
|
||||
new FetchUserProfileLike(obContext, core),
|
||||
new GetPacketStatus(obContext, core),
|
||||
new GroupPoke(obContext, core),
|
||||
new FriendPoke(obContext, core),
|
||||
new GetUserStatus(obContext, core),
|
||||
new GetRkey(obContext, core),
|
||||
new SetSpecialTittle(obContext, core),
|
||||
|
@@ -17,6 +17,7 @@ export enum ActionName {
|
||||
// 以下为扩展napcat扩展
|
||||
Unknown = 'unknown',
|
||||
GroupPoke = 'group_poke',
|
||||
FriendPoke = 'friend_poke',
|
||||
SharePeer = 'ArkSharePeer',
|
||||
ShareGroupEx = 'ArkShareGroup',
|
||||
RebootNormal = 'reboot_normal',//无快速登录重新启动
|
||||
|
22
src/onebot/action/user/FriendPoke.ts
Normal file
22
src/onebot/action/user/FriendPoke.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { ActionName } from '../types';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
import {GetPacketStatusDepends} from "@/onebot/action/packet/GetPacketStatus";
|
||||
|
||||
const SchemaData = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
user_id: { type: ['number', 'string'] },
|
||||
},
|
||||
required: ['user_id'],
|
||||
} as const satisfies JSONSchema;
|
||||
|
||||
type Payload = FromSchema<typeof SchemaData>;
|
||||
|
||||
export class FriendPoke extends GetPacketStatusDepends<Payload, any> {
|
||||
actionName = ActionName.FriendPoke;
|
||||
payloadSchema = SchemaData;
|
||||
|
||||
async _handle(payload: Payload) {
|
||||
await this.core.apis.PacketApi.sendPokePacket(+payload.user_id);
|
||||
}
|
||||
}
|
@@ -304,10 +304,10 @@ export class NapCatOneBot11Adapter {
|
||||
},
|
||||
m.msgId,
|
||||
);
|
||||
if (m.sourceType == MsgSourceType.K_DOWN_SOURCETYPE_AIOINNER) {
|
||||
// if (m.sourceType == MsgSourceType.K_DOWN_SOURCETYPE_AIOINNER) {
|
||||
await this.emitMsg(m)
|
||||
.catch(e => this.context.logger.logError.bind(this.context.logger)('处理消息失败', e));
|
||||
}
|
||||
// }
|
||||
}
|
||||
};
|
||||
|
||||
@@ -575,7 +575,7 @@ export class NapCatOneBot11Adapter {
|
||||
// }
|
||||
this.networkManager.emitEvent(ob11Msg);
|
||||
}).catch(e => this.context.logger.logError.bind(this.context.logger)('constructMessage error: ', e));
|
||||
|
||||
|
||||
this.apis.GroupApi.parseGroupEvent(message).then(groupEvent => {
|
||||
if (groupEvent) {
|
||||
// log("post group event", groupEvent);
|
||||
|
@@ -30,7 +30,7 @@ async function onSettingWindowCreated(view: Element) {
|
||||
SettingItem(
|
||||
'<span id="napcat-update-title">Napcat</span>',
|
||||
undefined,
|
||||
SettingButton('V3.0.5', 'napcat-update-button', 'secondary'),
|
||||
SettingButton('V3.0.6', 'napcat-update-button', 'secondary'),
|
||||
),
|
||||
]),
|
||||
SettingList([
|
||||
|
@@ -164,7 +164,7 @@ async function onSettingWindowCreated(view) {
|
||||
SettingItem(
|
||||
'<span id="napcat-update-title">Napcat</span>',
|
||||
void 0,
|
||||
SettingButton("V3.0.5", "napcat-update-button", "secondary")
|
||||
SettingButton("V3.0.6", "napcat-update-button", "secondary")
|
||||
)
|
||||
]),
|
||||
SettingList([
|
||||
|
Reference in New Issue
Block a user