mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
refactor: utils structure
This commit is contained in:
@@ -9,9 +9,9 @@ import {
|
||||
ElementType
|
||||
} from "../types";
|
||||
import path from "path";
|
||||
import {log} from "../../common/utils";
|
||||
import fs from "fs";
|
||||
import {ReceiveCmdS} from "../hook";
|
||||
import {log} from "../../common/utils/log";
|
||||
|
||||
export class NTQQFileApi{
|
||||
static async getFileType(filePath: string) {
|
||||
|
@@ -2,9 +2,9 @@ import {ReceiveCmdS} from "../hook";
|
||||
import {Group, GroupMember, GroupMemberRole, GroupNotifies, GroupNotify, GroupRequestOperateTypes} from "../types";
|
||||
import {callNTQQApi, GeneralCallResult, NTQQApiClass, NTQQApiMethod} from "../ntcall";
|
||||
import {uidMaps} from "../../common/data";
|
||||
import {log} from "../../common/utils";
|
||||
import {BrowserWindow} from "electron";
|
||||
import {dbUtil} from "../../common/db";
|
||||
import {log} from "../../common/utils/log";
|
||||
|
||||
export class NTQQGroupApi{
|
||||
static async getGroups(forced = false) {
|
||||
|
@@ -1,9 +1,10 @@
|
||||
import {callNTQQApi, GeneralCallResult, NTQQApiMethod} from "../ntcall";
|
||||
import {ChatType, RawMessage, SendMessageElement} from "../types";
|
||||
import {log, sleep} from "../../common/utils";
|
||||
import {dbUtil} from "../../common/db";
|
||||
import {selfInfo} from "../../common/data";
|
||||
import {ReceiveCmdS, registerReceiveHook} from "../hook";
|
||||
import {log} from "../../common/utils/log";
|
||||
import {sleep} from "../../common/utils/helper";
|
||||
|
||||
export let sendMessagePool: Record<string, ((sendSuccessMsg: RawMessage) => void) | null> = {}// peerUid: callbackFunnc
|
||||
|
||||
|
@@ -11,10 +11,12 @@ import {
|
||||
SendTextElement,
|
||||
SendVideoElement
|
||||
} from "./types";
|
||||
import {calculateFileMD5, encodeSilk, getVideoInfo, isGIF, log, sleep} from "../common/utils";
|
||||
import {promises as fs} from "node:fs";
|
||||
import ffmpeg from "fluent-ffmpeg"
|
||||
import {NTQQFileApi} from "./api/file";
|
||||
import {calculateFileMD5, encodeSilk, getVideoInfo, isGIF} from "../common/utils/file";
|
||||
import {log} from "../common/utils/log";
|
||||
import {sleep} from "../common/utils/helper";
|
||||
|
||||
|
||||
export class SendMsgElementConstructor {
|
||||
|
2
src/ntqqapi/external/ccpoke/index.ts
vendored
2
src/ntqqapi/external/ccpoke/index.ts
vendored
@@ -1,4 +1,4 @@
|
||||
import {log} from "../../../common/utils";
|
||||
import {log} from "../../../common/utils/log";
|
||||
|
||||
let pokeEngine: any = null
|
||||
|
||||
|
@@ -1,16 +1,17 @@
|
||||
import {BrowserWindow} from 'electron';
|
||||
import {getConfigUtil, log, sleep} from "../common/utils";
|
||||
import {NTQQApiClass} from "./ntcall";
|
||||
import {NTQQMsgApi, sendMessagePool} from "./api/msg"
|
||||
import {ChatType, Group, RawMessage, User} from "./types";
|
||||
import {friends, groups, receivedTempUinMap, selfInfo, tempGroupCodeMap, uidMaps} from "../common/data";
|
||||
import {friends, groups, selfInfo, tempGroupCodeMap, uidMaps} from "../common/data";
|
||||
import {OB11GroupDecreaseEvent} from "../onebot11/event/notice/OB11GroupDecreaseEvent";
|
||||
import {v4 as uuidv4} from "uuid"
|
||||
import {postOB11Event} from "../onebot11/server/postOB11Event";
|
||||
import {HOOK_LOG} from "../common/config";
|
||||
import {getConfigUtil, HOOK_LOG} from "../common/config";
|
||||
import fs from "fs";
|
||||
import {dbUtil} from "../common/db";
|
||||
import {NTQQGroupApi} from "./api/group";
|
||||
import {log} from "../common/utils/log";
|
||||
import {sleep} from "../common/utils/helper";
|
||||
|
||||
export let hookApiCallbacks: Record<string, (apiReturn: any) => void> = {}
|
||||
|
||||
|
@@ -1,8 +1,8 @@
|
||||
import {ipcMain} from "electron";
|
||||
import {hookApiCallbacks, ReceiveCmd, registerReceiveHook, removeReceiveHook} from "./hook";
|
||||
import {log} from "../common/utils";
|
||||
|
||||
import {v4 as uuidv4} from "uuid"
|
||||
import {log} from "../common/utils/log";
|
||||
|
||||
export enum NTQQApiClass {
|
||||
NT_API = "ns-ntApi",
|
||||
|
Reference in New Issue
Block a user