mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
Compare commits
28 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
8248011a12 | ||
![]() |
5f454456d2 | ||
![]() |
e99a619c23 | ||
![]() |
1fc791bb68 | ||
![]() |
f1d83f7c16 | ||
![]() |
527bb72bcf | ||
![]() |
d78409fd07 | ||
![]() |
d5e7e8944f | ||
![]() |
fb405a5c1c | ||
![]() |
a9e471deca | ||
![]() |
9cd15ae337 | ||
![]() |
8ed4cc4b0a | ||
![]() |
a62de441cf | ||
![]() |
02a8999410 | ||
![]() |
59c7979d69 | ||
![]() |
bb7b28cd8f | ||
![]() |
056497b98a | ||
![]() |
ac2fb032c4 | ||
![]() |
c933bdd5d9 | ||
![]() |
89c71a58fa | ||
![]() |
27ba85b4ff | ||
![]() |
79a75fed8e | ||
![]() |
ee7a76b29f | ||
![]() |
c53bdc3ce0 | ||
![]() |
f36e328751 | ||
![]() |
b96076b297 | ||
![]() |
a1700dd503 | ||
![]() |
2954776539 |
@@ -1,6 +1,6 @@
|
||||
<div align="center">
|
||||
|
||||

|
||||

|
||||
|
||||
</div>
|
||||
|
||||
@@ -32,6 +32,8 @@ NapCatQQ 是现代化的基于 NTQQ 的 Bot 协议端实现
|
||||
|
||||
[Server.Other](https://docs.napcat.cyou/)
|
||||
|
||||
[Qbot.News](https://neko.qbot.news)
|
||||
|
||||
## 回家旅途
|
||||
[QQ Group#1](https://qm.qq.com/q/I6LU87a0Yq)
|
||||
|
||||
|
BIN
external/logo.png
vendored
Normal file
BIN
external/logo.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 204 KiB |
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"name": "qq-chat",
|
||||
"version": "9.9.16-29927",
|
||||
"verHash": "3e273e30",
|
||||
"linuxVersion": "3.2.13-29927",
|
||||
"linuxVerHash": "833d113c",
|
||||
"version": "9.9.17-30899",
|
||||
"verHash": "ececf273",
|
||||
"linuxVersion": "3.2.15-30899",
|
||||
"linuxVerHash": "63c751e8",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"description": "QQ",
|
||||
@@ -18,7 +18,7 @@
|
||||
"qd": "externals/devtools/cli/index.js"
|
||||
},
|
||||
"main": "./loadNapCat.js",
|
||||
"buildVersion": "29927",
|
||||
"buildVersion": "30899",
|
||||
"isPureShell": true,
|
||||
"isByteCodeShell": true,
|
||||
"platform": "win32",
|
||||
|
BIN
logo.png
BIN
logo.png
Binary file not shown.
Before Width: | Height: | Size: 335 KiB After Width: | Height: | Size: 684 KiB |
@@ -4,7 +4,7 @@
|
||||
"name": "NapCatQQ",
|
||||
"slug": "NapCat.Framework",
|
||||
"description": "高性能的 OneBot 11 协议实现",
|
||||
"version": "4.2.38",
|
||||
"version": "4.2.42",
|
||||
"icon": "./logo.png",
|
||||
"authors": [
|
||||
{
|
||||
|
@@ -2,7 +2,7 @@
|
||||
"name": "napcat",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"version": "4.2.38",
|
||||
"version": "4.2.42",
|
||||
"scripts": {
|
||||
"build:universal": "npm run build:webui && vite build --mode universal || exit 1",
|
||||
"build:framework": "npm run build:webui && vite build --mode framework || exit 1",
|
||||
|
@@ -1 +1 @@
|
||||
export const napCatVersion = '4.2.38';
|
||||
export const napCatVersion = '4.2.42';
|
||||
|
12
src/core/external/appid.json
vendored
12
src/core/external/appid.json
vendored
@@ -146,5 +146,17 @@
|
||||
"6.9.63-30851": {
|
||||
"appid": 537263820,
|
||||
"qua": "V1_MAC_NQ_6.9.63_30851_GW_B"
|
||||
},
|
||||
"9.9.17-30899": {
|
||||
"appid": 537263796,
|
||||
"qua": "V1_WIN_NQ_9.9.17_30899_GW_B"
|
||||
},
|
||||
"3.2.15-30899": {
|
||||
"appid": 537263831,
|
||||
"qua": "V1_LNX_NQ_3.2.15_30899_GW_B"
|
||||
},
|
||||
"6.9.63-30899": {
|
||||
"appid": 537263820,
|
||||
"qua": "V1_MAC_NQ_6.9.63_30899_GW_B"
|
||||
}
|
||||
}
|
36
src/core/external/offset.json
vendored
36
src/core/external/offset.json
vendored
@@ -166,5 +166,41 @@
|
||||
"9.9.17-30851-x64": {
|
||||
"send": "395C150",
|
||||
"recv": "3960584"
|
||||
},
|
||||
"3.2.15-30851-x64": {
|
||||
"send": "A4A03E0",
|
||||
"recv": "A4A3CE0"
|
||||
},
|
||||
"3.2.15-30851-arm64": {
|
||||
"send": "713A318",
|
||||
"recv": "713DB50"
|
||||
},
|
||||
"6.9.63.30851-x64": {
|
||||
"send": "46C8040",
|
||||
"recv": "46CA8AC"
|
||||
},
|
||||
"6.9.63-30851-arm64": {
|
||||
"send": "41DCBD8",
|
||||
"recv": "41DF3F0"
|
||||
},
|
||||
"9.9.17-30899-x64": {
|
||||
"send": "395C150",
|
||||
"recv": "3960584"
|
||||
},
|
||||
"3.2.15-30899-x64": {
|
||||
"send": "A4A03E0",
|
||||
"recv": "A4A3CE0"
|
||||
},
|
||||
"3.2.15-30899-arm64": {
|
||||
"send": "713A318",
|
||||
"recv": "713DB50"
|
||||
},
|
||||
"6.9.63.30899-x64": {
|
||||
"send": "46C8040",
|
||||
"recv": "46CA8AC"
|
||||
},
|
||||
"6.9.63-30899-arm64": {
|
||||
"send": "41DCBD8",
|
||||
"recv": "41DF3F0"
|
||||
}
|
||||
}
|
@@ -23,7 +23,9 @@ export class PacketClientSession {
|
||||
get operation() {
|
||||
return this.context.operation;
|
||||
}
|
||||
|
||||
get client() {
|
||||
return this.context.client;
|
||||
}
|
||||
// TODO: global message element adapter (?
|
||||
get msgConverter() {
|
||||
return this.context.msgConverter;
|
||||
|
14
src/onebot/action/extends/GetClientkey.ts
Normal file
14
src/onebot/action/extends/GetClientkey.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { OneBotAction } from '../OneBotAction';
|
||||
|
||||
interface GetClientkeyResponse {
|
||||
clientkey?: string;
|
||||
}
|
||||
|
||||
export class GetClientkey extends OneBotAction<void, GetClientkeyResponse> {
|
||||
actionName = ActionName.GetClientkey;
|
||||
|
||||
async _handle() {
|
||||
return { clientkey: (await this.core.apis.UserApi.forceFetchClientKey()).clientKey };
|
||||
}
|
||||
}
|
21
src/onebot/action/extends/SendPacket.ts
Normal file
21
src/onebot/action/extends/SendPacket.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
|
||||
const SchemaData = Type.Object({
|
||||
cmd: Type.String(),
|
||||
data: Type.String(),
|
||||
rsp: Type.Union([Type.String(), Type.Boolean()], { default: true }),
|
||||
});
|
||||
|
||||
type Payload = Static<typeof SchemaData>;
|
||||
|
||||
export class SendPacket extends GetPacketStatusDepends<Payload, any> {
|
||||
payloadSchema = SchemaData;
|
||||
actionName = ActionName.SendPacket;
|
||||
async _handle(payload: Payload) {
|
||||
const rsp = typeof payload.rsp === 'boolean' ? payload.rsp : payload.rsp === 'true';
|
||||
const data = await this.core.apis.PacketApi.pkt.client.sendOidbPacket({ cmd: payload.cmd, data: payload.data as any }, rsp);
|
||||
return typeof data === 'object' ? data.toString('hex') : undefined;
|
||||
}
|
||||
}
|
@@ -102,6 +102,9 @@ import { SendGroupAiRecord } from "@/onebot/action/group/SendGroupAiRecord";
|
||||
import { GetAiCharacters } from "@/onebot/action/extends/GetAiCharacters";
|
||||
import { GetGuildList } from './guild/GetGuildList';
|
||||
import { GetGuildProfile } from './guild/GetGuildProfile';
|
||||
import { GetClientkey } from './extends/GetClientkey';
|
||||
import { SendPacket } from './extends/SendPacket';
|
||||
import { SendPoke } from "@/onebot/action/packet/SendPoke";
|
||||
|
||||
export function createActionMap(obContext: NapCatOneBot11Adapter, core: NapCatCore) {
|
||||
|
||||
@@ -123,6 +126,7 @@ export function createActionMap(obContext: NapCatOneBot11Adapter, core: NapCatCo
|
||||
new GetGroupRootFiles(obContext, core),
|
||||
new SetGroupSign(obContext, core),
|
||||
new SendGroupSign(obContext, core),
|
||||
new GetClientkey(obContext, core),
|
||||
// onebot11
|
||||
new SendLike(obContext, core),
|
||||
new GetMsg(obContext, core),
|
||||
@@ -216,6 +220,8 @@ export function createActionMap(obContext: NapCatOneBot11Adapter, core: NapCatCo
|
||||
new GetAiRecord(obContext, core),
|
||||
new SendGroupAiRecord(obContext, core),
|
||||
new GetAiCharacters(obContext, core),
|
||||
new SendPacket(obContext, core),
|
||||
new SendPoke(obContext, core),
|
||||
];
|
||||
|
||||
type HandlerUnion = typeof actionHandlers[number];
|
||||
|
23
src/onebot/action/packet/SendPoke.ts
Normal file
23
src/onebot/action/packet/SendPoke.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { GetPacketStatusDepends } from "@/onebot/action/packet/GetPacketStatus";
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
|
||||
const SchemaData = Type.Object({
|
||||
group_id: Type.Optional(Type.Union([Type.Number(), Type.String()])),
|
||||
user_id: Type.Union([Type.Number(), Type.String()]),
|
||||
});
|
||||
|
||||
type Payload = Static<typeof SchemaData>;
|
||||
|
||||
export class SendPoke extends GetPacketStatusDepends<Payload, any> {
|
||||
actionName = ActionName.SendPoke;
|
||||
payloadSchema = SchemaData;
|
||||
|
||||
async _handle(payload: Payload) {
|
||||
if (payload.group_id) {
|
||||
this.core.apis.PacketApi.pkt.operation.GroupPoke(+payload.group_id, +payload.user_id);
|
||||
} else {
|
||||
this.core.apis.PacketApi.pkt.operation.FriendPoke(+payload.user_id);
|
||||
}
|
||||
}
|
||||
}
|
@@ -13,134 +13,138 @@ export interface InvalidCheckResult {
|
||||
[k: string | number]: any;
|
||||
}
|
||||
|
||||
export const ActionName = {
|
||||
export const ActionName = {
|
||||
// onebot 11
|
||||
SendPrivateMsg : 'send_private_msg',
|
||||
SendGroupMsg : 'send_group_msg',
|
||||
SendMsg : 'send_msg',
|
||||
DeleteMsg : 'delete_msg',
|
||||
GetMsg : 'get_msg',
|
||||
GoCQHTTP_GetForwardMsg : 'get_forward_msg',
|
||||
SendLike : 'send_like',
|
||||
SetGroupKick : 'set_group_kick',
|
||||
SetGroupBan : 'set_group_ban',
|
||||
SendPrivateMsg: 'send_private_msg',
|
||||
SendGroupMsg: 'send_group_msg',
|
||||
SendMsg: 'send_msg',
|
||||
DeleteMsg: 'delete_msg',
|
||||
GetMsg: 'get_msg',
|
||||
GoCQHTTP_GetForwardMsg: 'get_forward_msg',
|
||||
SendLike: 'send_like',
|
||||
SetGroupKick: 'set_group_kick',
|
||||
SetGroupBan: 'set_group_ban',
|
||||
// SetGroupAnoymousBan : 'set_group_anonymous_ban',
|
||||
SetGroupWholeBan : 'set_group_whole_ban',
|
||||
SetGroupAdmin : 'set_group_admin',
|
||||
SetGroupWholeBan: 'set_group_whole_ban',
|
||||
SetGroupAdmin: 'set_group_admin',
|
||||
// SetGroupAnoymous : 'set_group_anonymous',
|
||||
SetGroupCard : 'set_group_card',
|
||||
SetGroupName : 'set_group_name',
|
||||
SetGroupLeave : 'set_group_leave',
|
||||
SetSpecialTittle : 'set_group_special_title',
|
||||
SetFriendAddRequest : 'set_friend_add_request',
|
||||
SetGroupAddRequest : 'set_group_add_request',
|
||||
GetLoginInfo : 'get_login_info',
|
||||
GoCQHTTP_GetStrangerInfo : 'get_stranger_info',
|
||||
GetFriendList : 'get_friend_list',
|
||||
GetGroupInfo : 'get_group_info',
|
||||
GetGroupList : 'get_group_list',
|
||||
GetGroupMemberInfo : 'get_group_member_info',
|
||||
GetGroupMemberList : 'get_group_member_list',
|
||||
GetGroupHonorInfo : 'get_group_honor_info',
|
||||
GetCookies : 'get_cookies',
|
||||
GetCSRF : 'get_csrf_token',
|
||||
GetCredentials : 'get_credentials',
|
||||
GetRecord : 'get_record',
|
||||
GetImage : 'get_image',
|
||||
CanSendImage : 'can_send_image',
|
||||
CanSendRecord : 'can_send_record',
|
||||
GetStatus : 'get_status',
|
||||
GetVersionInfo : 'get_version_info',
|
||||
SetGroupCard: 'set_group_card',
|
||||
SetGroupName: 'set_group_name',
|
||||
SetGroupLeave: 'set_group_leave',
|
||||
SetSpecialTittle: 'set_group_special_title',
|
||||
SetFriendAddRequest: 'set_friend_add_request',
|
||||
SetGroupAddRequest: 'set_group_add_request',
|
||||
GetLoginInfo: 'get_login_info',
|
||||
GoCQHTTP_GetStrangerInfo: 'get_stranger_info',
|
||||
GetFriendList: 'get_friend_list',
|
||||
GetGroupInfo: 'get_group_info',
|
||||
GetGroupList: 'get_group_list',
|
||||
GetGroupMemberInfo: 'get_group_member_info',
|
||||
GetGroupMemberList: 'get_group_member_list',
|
||||
GetGroupHonorInfo: 'get_group_honor_info',
|
||||
GetCookies: 'get_cookies',
|
||||
GetCSRF: 'get_csrf_token',
|
||||
GetCredentials: 'get_credentials',
|
||||
GetRecord: 'get_record',
|
||||
GetImage: 'get_image',
|
||||
CanSendImage: 'can_send_image',
|
||||
CanSendRecord: 'can_send_record',
|
||||
GetStatus: 'get_status',
|
||||
GetVersionInfo: 'get_version_info',
|
||||
// Reboot : 'set_restart',
|
||||
// CleanCache : 'clean_cache',
|
||||
|
||||
// go-cqhttp
|
||||
SetQQProfile : 'set_qq_profile',
|
||||
SetQQProfile: 'set_qq_profile',
|
||||
// QidianGetAccountInfo : 'qidian_get_account_info',
|
||||
GoCQHTTP_GetModelShow : '_get_model_show',
|
||||
GoCQHTTP_SetModelShow : '_set_model_show',
|
||||
GetOnlineClient : 'get_online_clients',
|
||||
GoCQHTTP_GetModelShow: '_get_model_show',
|
||||
GoCQHTTP_SetModelShow: '_set_model_show',
|
||||
GetOnlineClient: 'get_online_clients',
|
||||
// GetUnidirectionalFriendList : 'get_unidirectional_friend_list',
|
||||
GoCQHTTP_DeleteFriend : 'delete_friend',
|
||||
GoCQHTTP_DeleteFriend: 'delete_friend',
|
||||
// DeleteUnidirectionalFriendList : 'delete_unidirectional_friend',
|
||||
GoCQHTTP_MarkMsgAsRead : 'mark_msg_as_read',
|
||||
GoCQHTTP_SendGroupForwardMsg : 'send_group_forward_msg',
|
||||
GoCQHTTP_SendPrivateForwardMsg : 'send_private_forward_msg',
|
||||
GoCQHTTP_GetGroupMsgHistory : 'get_group_msg_history',
|
||||
OCRImage : 'ocr_image',
|
||||
IOCRImage : '.ocr_image',
|
||||
GetGroupSystemMsg : 'get_group_system_msg',
|
||||
GoCQHTTP_GetEssenceMsg : 'get_essence_msg_list',
|
||||
GoCQHTTP_GetGroupAtAllRemain : 'get_group_at_all_remain',
|
||||
SetGroupPortrait : 'set_group_portrait',
|
||||
SetEssenceMsg : 'set_essence_msg',
|
||||
DelEssenceMsg : 'delete_essence_msg',
|
||||
GoCQHTTP_SendGroupNotice : '_send_group_notice',
|
||||
GoCQHTTP_GetGroupNotice : '_get_group_notice',
|
||||
GoCQHTTP_UploadGroupFile : 'upload_group_file',
|
||||
GOCQHTTP_DeleteGroupFile : 'delete_group_file',
|
||||
GoCQHTTP_CreateGroupFileFolder : 'create_group_file_folder',
|
||||
GoCQHTTP_DeleteGroupFileFolder : 'delete_group_folder',
|
||||
GoCQHTTP_GetGroupFileSystemInfo : 'get_group_file_system_info',
|
||||
GoCQHTTP_GetGroupRootFiles : 'get_group_root_files',
|
||||
GoCQHTTP_GetGroupFilesByFolder : 'get_group_files_by_folder',
|
||||
GOCQHTTP_GetGroupFileUrl : 'get_group_file_url',
|
||||
GOCQHTTP_UploadPrivateFile : 'upload_private_file',
|
||||
GoCQHTTP_MarkMsgAsRead: 'mark_msg_as_read',
|
||||
GoCQHTTP_SendGroupForwardMsg: 'send_group_forward_msg',
|
||||
GoCQHTTP_SendPrivateForwardMsg: 'send_private_forward_msg',
|
||||
GoCQHTTP_GetGroupMsgHistory: 'get_group_msg_history',
|
||||
OCRImage: 'ocr_image',
|
||||
IOCRImage: '.ocr_image',
|
||||
GetGroupSystemMsg: 'get_group_system_msg',
|
||||
GoCQHTTP_GetEssenceMsg: 'get_essence_msg_list',
|
||||
GoCQHTTP_GetGroupAtAllRemain: 'get_group_at_all_remain',
|
||||
SetGroupPortrait: 'set_group_portrait',
|
||||
SetEssenceMsg: 'set_essence_msg',
|
||||
DelEssenceMsg: 'delete_essence_msg',
|
||||
GoCQHTTP_SendGroupNotice: '_send_group_notice',
|
||||
GoCQHTTP_GetGroupNotice: '_get_group_notice',
|
||||
GoCQHTTP_UploadGroupFile: 'upload_group_file',
|
||||
GOCQHTTP_DeleteGroupFile: 'delete_group_file',
|
||||
GoCQHTTP_CreateGroupFileFolder: 'create_group_file_folder',
|
||||
GoCQHTTP_DeleteGroupFileFolder: 'delete_group_folder',
|
||||
GoCQHTTP_GetGroupFileSystemInfo: 'get_group_file_system_info',
|
||||
GoCQHTTP_GetGroupRootFiles: 'get_group_root_files',
|
||||
GoCQHTTP_GetGroupFilesByFolder: 'get_group_files_by_folder',
|
||||
GOCQHTTP_GetGroupFileUrl: 'get_group_file_url',
|
||||
GOCQHTTP_UploadPrivateFile: 'upload_private_file',
|
||||
// GOCQHTTP_ReloadEventFilter : 'reload_event_filter',
|
||||
GoCQHTTP_DownloadFile : 'download_file',
|
||||
GoCQHTTP_CheckUrlSafely : 'check_url_safely',
|
||||
GoCQHTTP_GetWordSlices : '.get_word_slices',
|
||||
GoCQHTTP_HandleQuickAction : '.handle_quick_operation',
|
||||
GoCQHTTP_DownloadFile: 'download_file',
|
||||
GoCQHTTP_CheckUrlSafely: 'check_url_safely',
|
||||
GoCQHTTP_GetWordSlices: '.get_word_slices',
|
||||
GoCQHTTP_HandleQuickAction: '.handle_quick_operation',
|
||||
|
||||
// 以下为扩展napcat扩展
|
||||
Unknown : 'unknown',
|
||||
SharePeer : 'ArkSharePeer',
|
||||
ShareGroupEx : 'ArkShareGroup',
|
||||
Unknown: 'unknown',
|
||||
SharePeer: 'ArkSharePeer',
|
||||
ShareGroupEx: 'ArkShareGroup',
|
||||
// RebootNormal : 'reboot_normal', //无快速登录重新启动
|
||||
GetRobotUinRange : 'get_robot_uin_range',
|
||||
SetOnlineStatus : 'set_online_status',
|
||||
GetFriendsWithCategory : 'get_friends_with_category',
|
||||
SetQQAvatar : 'set_qq_avatar',
|
||||
GetFile : 'get_file',
|
||||
ForwardFriendSingleMsg : 'forward_friend_single_msg',
|
||||
ForwardGroupSingleMsg : 'forward_group_single_msg',
|
||||
TranslateEnWordToZn : 'translate_en2zh',
|
||||
SetMsgEmojiLike : 'set_msg_emoji_like',
|
||||
GoCQHTTP_SendForwardMsg : 'send_forward_msg',
|
||||
MarkPrivateMsgAsRead : 'mark_private_msg_as_read',
|
||||
MarkGroupMsgAsRead : 'mark_group_msg_as_read',
|
||||
GetFriendMsgHistory : 'get_friend_msg_history',
|
||||
CreateCollection : 'create_collection',
|
||||
GetCollectionList : 'get_collection_list',
|
||||
SetLongNick : 'set_self_longnick',
|
||||
GetRecentContact : 'get_recent_contact',
|
||||
_MarkAllMsgAsRead : '_mark_all_as_read',
|
||||
GetProfileLike : 'get_profile_like',
|
||||
FetchCustomFace : 'fetch_custom_face',
|
||||
FetchEmojiLike : 'fetch_emoji_like',
|
||||
SetInputStatus : 'set_input_status',
|
||||
GetGroupInfoEx : 'get_group_info_ex',
|
||||
GetGroupIgnoreAddRequest : 'get_group_ignore_add_request',
|
||||
DelGroupNotice : '_del_group_notice',
|
||||
FetchUserProfileLike : 'fetch_user_profile_like',
|
||||
FriendPoke : 'friend_poke',
|
||||
GroupPoke : 'group_poke',
|
||||
GetPacketStatus : 'nc_get_packet_status',
|
||||
GetUserStatus : 'nc_get_user_status',
|
||||
GetRkey : 'nc_get_rkey',
|
||||
GetGroupShutList : 'get_group_shut_list',
|
||||
GetRobotUinRange: 'get_robot_uin_range',
|
||||
SetOnlineStatus: 'set_online_status',
|
||||
GetFriendsWithCategory: 'get_friends_with_category',
|
||||
SetQQAvatar: 'set_qq_avatar',
|
||||
GetFile: 'get_file',
|
||||
ForwardFriendSingleMsg: 'forward_friend_single_msg',
|
||||
ForwardGroupSingleMsg: 'forward_group_single_msg',
|
||||
TranslateEnWordToZn: 'translate_en2zh',
|
||||
SetMsgEmojiLike: 'set_msg_emoji_like',
|
||||
GoCQHTTP_SendForwardMsg: 'send_forward_msg',
|
||||
MarkPrivateMsgAsRead: 'mark_private_msg_as_read',
|
||||
MarkGroupMsgAsRead: 'mark_group_msg_as_read',
|
||||
GetFriendMsgHistory: 'get_friend_msg_history',
|
||||
CreateCollection: 'create_collection',
|
||||
GetCollectionList: 'get_collection_list',
|
||||
SetLongNick: 'set_self_longnick',
|
||||
GetRecentContact: 'get_recent_contact',
|
||||
_MarkAllMsgAsRead: '_mark_all_as_read',
|
||||
GetProfileLike: 'get_profile_like',
|
||||
FetchCustomFace: 'fetch_custom_face',
|
||||
FetchEmojiLike: 'fetch_emoji_like',
|
||||
SetInputStatus: 'set_input_status',
|
||||
GetGroupInfoEx: 'get_group_info_ex',
|
||||
GetGroupIgnoreAddRequest: 'get_group_ignore_add_request',
|
||||
DelGroupNotice: '_del_group_notice',
|
||||
FetchUserProfileLike: 'fetch_user_profile_like',
|
||||
FriendPoke: 'friend_poke',
|
||||
GroupPoke: 'group_poke',
|
||||
GetPacketStatus: 'nc_get_packet_status',
|
||||
GetUserStatus: 'nc_get_user_status',
|
||||
GetRkey: 'nc_get_rkey',
|
||||
GetGroupShutList: 'get_group_shut_list',
|
||||
|
||||
GetGuildList : 'get_guild_list',
|
||||
GetGuildProfile : 'get_guild_service_profile',
|
||||
GetGuildList: 'get_guild_list',
|
||||
GetGuildProfile: 'get_guild_service_profile',
|
||||
|
||||
GetGroupIgnoredNotifies : 'get_group_ignored_notifies',
|
||||
GetGroupIgnoredNotifies: 'get_group_ignored_notifies',
|
||||
|
||||
SetGroupSign : "set_group_sign",
|
||||
SendGroupSign : "send_group_sign",
|
||||
|
||||
GetMiniAppArk : "get_mini_app_ark",
|
||||
SetGroupSign: "set_group_sign",
|
||||
SendGroupSign: "send_group_sign",
|
||||
SendPacket: "send_packet",
|
||||
GetMiniAppArk: "get_mini_app_ark",
|
||||
// UploadForwardMsg : "upload_forward_msg",
|
||||
GetAiRecord : "get_ai_record",
|
||||
GetAiCharacters : "get_ai_characters",
|
||||
SendGroupAiRecord : "send_group_ai_record",
|
||||
GetAiRecord: "get_ai_record",
|
||||
GetAiCharacters: "get_ai_characters",
|
||||
SendGroupAiRecord: "send_group_ai_record",
|
||||
|
||||
GetClientkey: "get_clientkey",
|
||||
|
||||
SendPoke: 'send_poke',
|
||||
} as const;
|
||||
|
@@ -8,6 +8,8 @@ import {
|
||||
NapCatCore,
|
||||
NTGrayTipElementSubTypeV2,
|
||||
RawMessage,
|
||||
TipGroupElement,
|
||||
TipGroupElementType,
|
||||
} from '@/core';
|
||||
import { NapCatOneBot11Adapter } from '@/onebot';
|
||||
import { OB11GroupBanEvent } from '@/onebot/event/notice/OB11GroupBanEvent';
|
||||
@@ -19,6 +21,7 @@ import { OB11GroupPokeEvent } from '@/onebot/event/notice/OB11PokeEvent';
|
||||
import { OB11GroupEssenceEvent } from '@/onebot/event/notice/OB11GroupEssenceEvent';
|
||||
import { OB11GroupTitleEvent } from '@/onebot/event/notice/OB11GroupTitleEvent';
|
||||
import { OB11GroupUploadNoticeEvent } from '../event/notice/OB11GroupUploadNoticeEvent';
|
||||
import { OB11GroupNameEvent } from '../event/notice/OB11GroupNameEvent';
|
||||
import { pathToFileURL } from 'node:url';
|
||||
import { FileNapCatOneBotUUID } from '@/common/helper';
|
||||
|
||||
@@ -204,11 +207,25 @@ export class OneBotGroupApi {
|
||||
);
|
||||
}
|
||||
|
||||
async parseGroupElement(msg: RawMessage, element: TipGroupElement, elementWrapper: GrayTipElement) {
|
||||
if (element.type === TipGroupElementType.KGROUPNAMEMODIFIED) {
|
||||
this.core.context.logger.logDebug('收到群名称变更事件', element);
|
||||
return new OB11GroupNameEvent(
|
||||
this.core,
|
||||
parseInt(msg.peerUid),
|
||||
parseInt(await this.core.apis.UserApi.getUinByUidV2(element.memberUid)),
|
||||
element.groupName,
|
||||
);
|
||||
} else if (element.type === TipGroupElementType.KSHUTUP) {
|
||||
let event = await this.parseGroupBanEvent(msg.peerUid, elementWrapper);
|
||||
return event;
|
||||
}
|
||||
}
|
||||
|
||||
async parseGrayTipElement(msg: RawMessage, grayTipElement: GrayTipElement) {
|
||||
if (grayTipElement.subElementType === NTGrayTipElementSubTypeV2.GRAYTIP_ELEMENT_SUBTYPE_GROUP) {
|
||||
// 解析群组事件 由sysmsg解析
|
||||
// return await this.parseGroupElement(msg, grayTipElement.groupElement, grayTipElement);
|
||||
|
||||
return await this.parseGroupElement(msg, grayTipElement.groupElement, grayTipElement);
|
||||
} else if (grayTipElement.subElementType === NTGrayTipElementSubTypeV2.GRAYTIP_ELEMENT_SUBTYPE_XMLMSG) {
|
||||
// 筛选出表情回应 事件
|
||||
if (grayTipElement.xmlElement?.templId === '10382') {
|
||||
|
@@ -990,7 +990,7 @@ export class OneBotMsgApi {
|
||||
if (SysMessage.contentHead.type == 33 && SysMessage.body?.msgContent) {
|
||||
const groupChange = new NapProtoMsg(GroupChange).decode(SysMessage.body.msgContent);
|
||||
this.core.apis.GroupApi.refreshGroupMemberCache(groupChange.groupUin.toString()).then().catch();
|
||||
const operatorUid = groupChange.operatorInfo?.toString();
|
||||
const operatorUid = groupChange.operatorInfo ? Buffer.from(groupChange.operatorInfo).toString() : '';
|
||||
return new OB11GroupIncreaseEvent(
|
||||
this.core,
|
||||
groupChange.groupUin,
|
||||
|
13
src/onebot/event/notice/OB11GroupNameEvent.ts
Normal file
13
src/onebot/event/notice/OB11GroupNameEvent.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { OB11GroupNoticeEvent } from './OB11GroupNoticeEvent';
|
||||
import { NapCatCore } from '@/core';
|
||||
|
||||
export class OB11GroupNameEvent extends OB11GroupNoticeEvent {
|
||||
notice_type = 'notify';
|
||||
sub_type = 'group_name';
|
||||
name_new: string;
|
||||
|
||||
constructor(core: NapCatCore, groupId: number, userId: number, nameNew: string) {
|
||||
super(core, groupId, userId);
|
||||
this.name_new = nameNew;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user