mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-06 21:10:23 +00:00
style: lint
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { GetPacketStatusDepends } from "@/onebot/action/packet/GetPacketStatus";
|
||||
import { AIVoiceChatType } from "@/core/packet/entities/aiChat";
|
||||
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
||||
import { AIVoiceChatType } from '@/core/packet/entities/aiChat';
|
||||
import { Type, Static } from '@sinclair/typebox';
|
||||
|
||||
const SchemaData = Type.Object({
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { GetPacketStatusDepends } from "@/onebot/action/packet/GetPacketStatus";
|
||||
import { MiniAppInfo, MiniAppInfoHelper } from "@/core/packet/utils/helper/miniAppHelper";
|
||||
import { MiniAppData, MiniAppRawData, MiniAppReqCustomParams, MiniAppReqParams } from "@/core/packet/entities/miniApp";
|
||||
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
||||
import { MiniAppInfo, MiniAppInfoHelper } from '@/core/packet/utils/helper/miniAppHelper';
|
||||
import { MiniAppData, MiniAppRawData, MiniAppReqCustomParams, MiniAppReqParams } from '@/core/packet/entities/miniApp';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
|
||||
const SchemaData = Type.Union([
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { GetPacketStatusDepends } from "@/onebot/action/packet/GetPacketStatus";
|
||||
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
||||
|
||||
export class GetRkey extends GetPacketStatusDepends<void, Array<any>> {
|
||||
actionName = ActionName.GetRkey;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { GetPacketStatusDepends } from "@/onebot/action/packet/GetPacketStatus";
|
||||
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
|
||||
const SchemaData = Type.Object({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { GetPacketStatusDepends } from "@/onebot/action/packet/GetPacketStatus";
|
||||
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
|
||||
const SchemaData = Type.Object({
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { FileNapCatOneBotUUID } from '@/common/file-uuid';
|
||||
import { GetPacketStatusDepends } from "@/onebot/action/packet/GetPacketStatus";
|
||||
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
|
||||
const SchemaData = Type.Object({
|
||||
|
||||
@@ -18,7 +18,7 @@ export class GoCQHTTPGetModelShow extends OneBotAction<Payload, any> {
|
||||
}
|
||||
return [{
|
||||
variants: {
|
||||
model_show: "napcat",
|
||||
model_show: 'napcat',
|
||||
need_pay: false
|
||||
}
|
||||
}];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { GetPacketStatusDepends } from "@/onebot/action/packet/GetPacketStatus";
|
||||
import { AIVoiceChatType } from "@/core/packet/entities/aiChat";
|
||||
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
||||
import { AIVoiceChatType } from '@/core/packet/entities/aiChat';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
|
||||
const SchemaData = Type.Object({
|
||||
|
||||
@@ -46,7 +46,7 @@ class GetGroupMemberInfo extends OneBotAction<Payload, OB11GroupMember> {
|
||||
const member = await this.getGroupMemberInfo(payload, uid, isNocache);
|
||||
|
||||
if (!member) {
|
||||
this.core.context.logger.logDebug(`获取群成员详细信息失败, 只能返回基础信息`);
|
||||
this.core.context.logger.logDebug('获取群成员详细信息失败, 只能返回基础信息');
|
||||
}
|
||||
|
||||
return OB11Construct.groupMember(payload.group_id.toString(), member);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { GetPacketStatusDepends } from "@/onebot/action/packet/GetPacketStatus";
|
||||
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
|
||||
const SchemaData = Type.Object({
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { GetPacketStatusDepends } from "@/onebot/action/packet/GetPacketStatus";
|
||||
import { uriToLocalFile } from "@/common/file";
|
||||
import { ChatType, Peer } from "@/core";
|
||||
import { AIVoiceChatType } from "@/core/packet/entities/aiChat";
|
||||
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
||||
import { uriToLocalFile } from '@/common/file';
|
||||
import { ChatType, Peer } from '@/core';
|
||||
import { AIVoiceChatType } from '@/core/packet/entities/aiChat';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
|
||||
const SchemaData = Type.Object({
|
||||
|
||||
@@ -85,9 +85,9 @@ import { GetRkey } from './extends/GetRkey';
|
||||
import { SetSpecialTittle } from './extends/SetSpecialTittle';
|
||||
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";
|
||||
import { GetGroupFileUrl } from '@/onebot/action/file/GetGroupFileUrl';
|
||||
import { GetPacketStatus } from '@/onebot/action/packet/GetPacketStatus';
|
||||
import { FriendPoke } from '@/onebot/action/user/FriendPoke';
|
||||
import { GetCredentials } from './system/GetCredentials';
|
||||
import { SendGroupSign, SetGroupSign } from './extends/SetGroupSign';
|
||||
import { GoCQHTTPGetGroupAtAllRemain } from './go-cqhttp/GetGroupAtAllRemain';
|
||||
@@ -95,15 +95,15 @@ import { GoCQHTTPCheckUrlSafely } from './go-cqhttp/GoCQHTTPCheckUrlSafely';
|
||||
import { GoCQHTTPGetModelShow } from './go-cqhttp/GoCQHTTPGetModelShow';
|
||||
import { GoCQHTTPSetModelShow } from './go-cqhttp/GoCQHTTPSetModelShow';
|
||||
import { GoCQHTTPDeleteFriend } from './go-cqhttp/GoCQHTTPDeleteFriend';
|
||||
import { GetMiniAppArk } from "@/onebot/action/extends/GetMiniAppArk";
|
||||
import { GetAiRecord } from "@/onebot/action/group/GetAiRecord";
|
||||
import { SendGroupAiRecord } from "@/onebot/action/group/SendGroupAiRecord";
|
||||
import { GetAiCharacters } from "@/onebot/action/extends/GetAiCharacters";
|
||||
import { GetMiniAppArk } from '@/onebot/action/extends/GetMiniAppArk';
|
||||
import { GetAiRecord } from '@/onebot/action/group/GetAiRecord';
|
||||
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";
|
||||
import { SendPoke } from '@/onebot/action/packet/SendPoke';
|
||||
|
||||
export function createActionMap(obContext: NapCatOneBot11Adapter, core: NapCatCore) {
|
||||
|
||||
|
||||
@@ -11,10 +11,10 @@ import { decodeCQCode } from '@/onebot/helper/cqcode';
|
||||
import { MessageUnique } from '@/common/message-unique';
|
||||
import { ChatType, ElementType, NapCatCore, Peer, RawMessage, SendArkElement, SendMessageElement } from '@/core';
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ForwardMsgBuilder } from "@/common/forward-msg-builder";
|
||||
import { stringifyWithBigInt } from "@/common/helper";
|
||||
import { PacketMsg } from "@/core/packet/message/message";
|
||||
import { rawMsgWithSendMsg } from "@/core/packet/message/converter";
|
||||
import { ForwardMsgBuilder } from '@/common/forward-msg-builder';
|
||||
import { stringifyWithBigInt } from '@/common/helper';
|
||||
import { PacketMsg } from '@/core/packet/message/message';
|
||||
import { rawMsgWithSendMsg } from '@/core/packet/message/converter';
|
||||
|
||||
export interface ReturnDataType {
|
||||
message_id: number;
|
||||
@@ -174,7 +174,7 @@ export class SendMsgBase extends OneBotAction<OB11PostSendMsg, ReturnDataType> {
|
||||
if (getSpecialMsgNum({ message: OB11Data }, OB11MessageDataType.node)) {
|
||||
const uploadReturnData = await this.uploadForwardedNodesPacket(msgPeer, OB11Data as OB11MessageNode[], node.data.source, node.data.news, node.data.summary, node.data.prompt, {
|
||||
user_id: (node.data.user_id ?? node.data.uin)?.toString() ?? parentMeta?.user_id ?? this.core.selfInfo.uin,
|
||||
nickname: (node.data.nickname || node.data.name) ?? parentMeta?.nickname ?? "QQ用户",
|
||||
nickname: (node.data.nickname || node.data.name) ?? parentMeta?.nickname ?? 'QQ用户',
|
||||
}, dp + 1);
|
||||
sendElements = uploadReturnData?.finallySendElements ? [uploadReturnData.finallySendElements] : [];
|
||||
} else {
|
||||
@@ -184,7 +184,7 @@ export class SendMsgBase extends OneBotAction<OB11PostSendMsg, ReturnDataType> {
|
||||
|
||||
const packetMsgElements: rawMsgWithSendMsg = {
|
||||
senderUin: Number((node.data.user_id ?? node.data.uin) ?? parentMeta?.user_id) || +this.core.selfInfo.uin,
|
||||
senderName: (node.data.nickname || node.data.name) ?? parentMeta?.nickname ?? "QQ用户",
|
||||
senderName: (node.data.nickname || node.data.name) ?? parentMeta?.nickname ?? 'QQ用户',
|
||||
groupId: msgPeer.chatType === ChatType.KCHATTYPEGROUP ? +msgPeer.peerUid : undefined,
|
||||
time: Number(node.data.time) || Date.now(),
|
||||
msg: sendElements,
|
||||
@@ -219,7 +219,7 @@ export class SendMsgBase extends OneBotAction<OB11PostSendMsg, ReturnDataType> {
|
||||
return {
|
||||
finallySendElements: {
|
||||
elementType: ElementType.ARK,
|
||||
elementId: "",
|
||||
elementId: '',
|
||||
arkElement: {
|
||||
bytesData: JSON.stringify(forwardJson),
|
||||
},
|
||||
|
||||
@@ -7,8 +7,8 @@ export abstract class GetPacketStatusDepends<PT, RT> extends OneBotAction<PT, RT
|
||||
if (!this.core.apis.PacketApi.available) {
|
||||
return {
|
||||
valid: false,
|
||||
message: "packetBackend不可用,请参照文档 https://napneko.github.io/config/advanced 和启动日志检查packetBackend状态或进行配置!" +
|
||||
"错误堆栈信息:" + this.core.apis.PacketApi.clientLogStack,
|
||||
message: 'packetBackend不可用,请参照文档 https://napneko.github.io/config/advanced 和启动日志检查packetBackend状态或进行配置!' +
|
||||
'错误堆栈信息:' + this.core.apis.PacketApi.clientLogStack,
|
||||
};
|
||||
}
|
||||
return await super.check(payload);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { GetPacketStatusDepends } from "@/onebot/action/packet/GetPacketStatus";
|
||||
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
|
||||
const SchemaData = Type.Object({
|
||||
|
||||
@@ -134,16 +134,16 @@ export const ActionName = {
|
||||
|
||||
GetGroupIgnoredNotifies: 'get_group_ignored_notifies',
|
||||
|
||||
SetGroupSign: "set_group_sign",
|
||||
SendGroupSign: "send_group_sign",
|
||||
SendPacket: "send_packet",
|
||||
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",
|
||||
GetClientkey: 'get_clientkey',
|
||||
|
||||
SendPoke: 'send_poke',
|
||||
} as const;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { GetPacketStatusDepends } from "@/onebot/action/packet/GetPacketStatus";
|
||||
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
|
||||
const SchemaData = Type.Object({
|
||||
|
||||
Reference in New Issue
Block a user