mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-06 13:05:09 +00:00
refactor: normalize file names in common/utils
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
import BaseAction from '../BaseAction';
|
||||
import { ActionName } from '../types';
|
||||
import { MessageUnique } from '@/common/utils/MessageUnique';
|
||||
import { MessageUnique } from '@/common/utils/message-unique';
|
||||
|
||||
const SchemaData = {
|
||||
type: 'object',
|
||||
|
||||
@@ -2,7 +2,7 @@ import BaseAction from '../BaseAction';
|
||||
import { OB11ForwardMessage } from '@/onebot';
|
||||
import { ActionName } from '../types';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
import { MessageUnique } from '@/common/utils/MessageUnique';
|
||||
import { MessageUnique } from '@/common/utils/message-unique';
|
||||
|
||||
const SchemaData = {
|
||||
type: 'object',
|
||||
|
||||
@@ -3,7 +3,7 @@ import { OB11Message } from '@/onebot';
|
||||
import { ActionName } from '../types';
|
||||
import { ChatType, RawMessage } from '@/core/entities';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
import { MessageUnique } from '@/common/utils/MessageUnique';
|
||||
import { MessageUnique } from '@/common/utils/message-unique';
|
||||
|
||||
interface Response {
|
||||
messages: OB11Message[];
|
||||
|
||||
@@ -3,7 +3,7 @@ import { OB11Message } from '@/onebot';
|
||||
import { ActionName } from '../types';
|
||||
import { ChatType, Peer, RawMessage } from '@/core/entities';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
import { MessageUnique } from '@/common/utils/MessageUnique';
|
||||
import { MessageUnique } from '@/common/utils/message-unique';
|
||||
|
||||
interface Response {
|
||||
messages: OB11Message[];
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import BaseAction from '../BaseAction';
|
||||
import { ActionName } from '../types';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
import { MessageUnique } from '@/common/utils/MessageUnique';
|
||||
import { MessageUnique } from '@/common/utils/message-unique';
|
||||
|
||||
const SchemaData = {
|
||||
type: 'object',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import BaseAction from '../BaseAction';
|
||||
import { ActionName } from '../types';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
import { MessageUnique } from '@/common/utils/MessageUnique';
|
||||
import { MessageUnique } from '@/common/utils/message-unique';
|
||||
|
||||
const SchemaData = {
|
||||
type: 'object',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { ActionName } from '../types';
|
||||
import BaseAction from '../BaseAction';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
import { MessageUnique } from '@/common/utils/MessageUnique';
|
||||
import { MessageUnique } from '@/common/utils/message-unique';
|
||||
import { NodeIKernelMsgListener } from '@/core';
|
||||
|
||||
const SchemaData = {
|
||||
@@ -32,13 +32,8 @@ class DeleteMsg extends BaseAction<Payload, void> {
|
||||
'NodeIKernelMsgListener/onMsgInfoListUpdate',
|
||||
1,
|
||||
5000,
|
||||
(msgs) => {
|
||||
if (msgs.find(m => m.msgId === msg.MsgId && m.recallTime !== '0')) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
).catch(e => new Promise<undefined>((resolve, reject) => {
|
||||
(msgs) => !!msgs.find(m => m.msgId === msg.MsgId && m.recallTime !== '0')
|
||||
).catch(() => new Promise<undefined>((resolve) => {
|
||||
resolve(undefined);
|
||||
}));
|
||||
await NTQQMsgApi.recallMsg(msg.Peer, [msg.MsgId]);
|
||||
|
||||
@@ -2,7 +2,7 @@ import BaseAction from '../BaseAction';
|
||||
import { ChatType, Peer } from '@/core/entities';
|
||||
import { ActionName } from '../types';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
import { MessageUnique } from '@/common/utils/MessageUnique';
|
||||
import { MessageUnique } from '@/common/utils/message-unique';
|
||||
|
||||
const SchemaData = {
|
||||
type: 'object',
|
||||
|
||||
@@ -2,7 +2,7 @@ import { OB11Message } from '@/onebot';
|
||||
import BaseAction from '../BaseAction';
|
||||
import { ActionName } from '../types';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
import { MessageUnique } from '@/common/utils/MessageUnique';
|
||||
import { MessageUnique } from '@/common/utils/message-unique';
|
||||
|
||||
|
||||
export type ReturnDataType = OB11Message
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
} from '@/onebot/types';
|
||||
import { ActionName, BaseCheckResult } from '@/onebot/action/types';
|
||||
import { decodeCQCode } from '@/onebot/helper/cqcode';
|
||||
import { MessageUnique } from '@/common/utils/MessageUnique';
|
||||
import { MessageUnique } from '@/common/utils/message-unique';
|
||||
import { ChatType, ElementType, NapCatCore, Peer, RawMessage, SendMessageElement } from '@/core';
|
||||
import BaseAction from '../BaseAction';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { ActionName } from '../types';
|
||||
import BaseAction from '../BaseAction';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
import { MessageUnique } from '@/common/utils/MessageUnique';
|
||||
import { MessageUnique } from '@/common/utils/message-unique';
|
||||
|
||||
const SchemaData = {
|
||||
type: 'object',
|
||||
|
||||
@@ -5,7 +5,7 @@ import { OB11GroupIncreaseEvent } from '../event/notice/OB11GroupIncreaseEvent';
|
||||
import { OB11GroupDecreaseEvent } from '../event/notice/OB11GroupDecreaseEvent';
|
||||
import fastXmlParser from 'fast-xml-parser';
|
||||
import { OB11GroupMsgEmojiLikeEvent } from '../event/notice/OB11MsgEmojiLikeEvent';
|
||||
import { MessageUnique } from '@/common/utils/MessageUnique';
|
||||
import { MessageUnique } from '@/common/utils/message-unique';
|
||||
|
||||
export class OneBotGroupApi {
|
||||
obContext: NapCatOneBot11Adapter;
|
||||
@@ -21,7 +21,7 @@ export class OneBotGroupApi {
|
||||
if (!groupElement?.shutUp) return undefined;
|
||||
const memberUid = groupElement.shutUp!.member.uid;
|
||||
const adminUid = groupElement.shutUp!.admin.uid;
|
||||
let memberUin: string = '';
|
||||
let memberUin: string;
|
||||
let duration = parseInt(groupElement.shutUp!.duration);
|
||||
const subType: 'ban' | 'lift_ban' = duration > 0 ? 'ban' : 'lift_ban';
|
||||
if (memberUid) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { UUIDConverter } from '@/common/utils/helper';
|
||||
import { MessageUnique } from '@/common/utils/MessageUnique';
|
||||
import { MessageUnique } from '@/common/utils/message-unique';
|
||||
import {
|
||||
AtType,
|
||||
ChatType,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ConfigBase } from '@/common/utils/ConfigBase';
|
||||
import { ConfigBase } from '@/common/utils/config-base';
|
||||
import ob11DefaultConfig from '@/onebot/external/onebot11.json';
|
||||
import { NapCatCore } from '@/core';
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import { OB11GroupDecreaseEvent } from "../event/notice/OB11GroupDecreaseEvent";
|
||||
import { OB11GroupUploadNoticeEvent } from "../event/notice/OB11GroupUploadNoticeEvent";
|
||||
import { OB11GroupPokeEvent } from "../event/notice/OB11PokeEvent";
|
||||
import { OB11GroupEssenceEvent } from "../event/notice/OB11GroupEssenceEvent";
|
||||
import { MessageUnique } from "@/common/utils/MessageUnique";
|
||||
import { MessageUnique } from "@/common/utils/message-unique";
|
||||
import { OB11GroupTitleEvent } from "../event/notice/OB11GroupTitleEvent";
|
||||
import { NapCatCore, RawMessage, ChatType, NTGrayTipElementSubTypeV2, TipGroupElementType, Peer } from '@/core';
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import { OneBotFriendApi, OneBotGroupApi, OneBotMsgApi, OneBotUserApi } from '@/
|
||||
import { ActionMap, createActionMap } from '@/onebot/action';
|
||||
import { WebUiDataRuntime } from '@/webui/src/helper/Data';
|
||||
import { OB11InputStatusEvent } from '@/onebot/event/notice/OB11InputStatusEvent';
|
||||
import { MessageUnique } from '@/common/utils/MessageUnique';
|
||||
import { MessageUnique } from '@/common/utils/message-unique';
|
||||
import { proxiedListenerOf } from '@/common/utils/proxy-handler';
|
||||
import { OB11FriendRequestEvent } from '@/onebot/event/request/OB11FriendRequest';
|
||||
import { OB11GroupAdminNoticeEvent } from '@/onebot/event/notice/OB11GroupAdminNoticeEvent';
|
||||
@@ -35,7 +35,7 @@ import { GroupDecreaseSubType, OB11GroupDecreaseEvent } from '@/onebot/event/not
|
||||
import { OB11GroupRequestEvent } from '@/onebot/event/request/OB11GroupRequest';
|
||||
import { OB11FriendRecallNoticeEvent } from '@/onebot/event/notice/OB11FriendRecallNoticeEvent';
|
||||
import { OB11GroupRecallNoticeEvent } from '@/onebot/event/notice/OB11GroupRecallNoticeEvent';
|
||||
import { LRUCache } from '@/common/utils/LRU';
|
||||
import { LRUCache } from '@/common/utils/lru-cache';
|
||||
import { NT2GroupEvent, NT2PrivateEvent } from './helper';
|
||||
import { NodeIKernelRecentContactListener } from '@/core/listeners/NodeIKernelRecentContactListener';
|
||||
|
||||
@@ -135,7 +135,7 @@ export class NapCatOneBot11Adapter {
|
||||
// log("recent contact", msgList, arg0, arg1);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private async reloadNetwork(prev: OB11Config, now: OB11Config) {
|
||||
@@ -233,7 +233,7 @@ export class NapCatOneBot11Adapter {
|
||||
const msgListener = new NodeIKernelMsgListener();
|
||||
msgListener.onRecvSysMsg = msg => {
|
||||
//console.log('onRecvSysMsg', Buffer.from(msg).toString('hex'));
|
||||
}
|
||||
};
|
||||
msgListener.onInputStatusPush = async data => {
|
||||
const uin = await this.core.apis.UserApi.getUinByUidV2(data.fromUin);
|
||||
this.context.logger.log(`[Notice] [输入状态] ${uin} ${data.statusText}`);
|
||||
|
||||
Reference in New Issue
Block a user