Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
duan602728596 committed Aug 27, 2023
2 parents 64a1642 + 8486fda commit bf62253
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ module.exports = {
'error',
{
commonjs: true,
ignore: ['^worker-loader!', '^@qqtools-api/']
ignore: ['^worker-loader!', '^@qqtools-api/', '^@qqtools-types/']
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@types/fs-extra": "^11",
"@types/js-yaml": "^4",
"@types/lodash-es": "^4",
"@types/node": "^18",
"@types/node": "^20",
"@types/node-schedule": "^2",
"@types/react": "^18",
"@types/react-dom": "^18",
Expand Down
5 changes: 3 additions & 2 deletions packages/NIMTest/node/createRoomId.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const path = require('node:path');
const { randomUUID } = require('node:crypto');
const _ = require('lodash');
const dayjs = require('dayjs');
const importESM = require('@sweet-milktea/utils/importESM');

require('dayjs/locale/zh-cn');
require('../../NIMNodePolyfill/NIMNodePolyfill.cjs');
Expand Down Expand Up @@ -45,7 +46,7 @@ function headers() {
// 获取房间信息
function getRoomInfo(chatroomId) {
return new Promise(async (resolve, reject) => {
const appKey = await import(path.join(__dirname, '../../qqtools/src/QQ/sdk/appKey.mjs'));
const appKey = await importESM(path.join(__dirname, '../../qqtools/src/QQ/sdk/appKey.mjs'));
const nimChatroomSocket = Chatroom.getInstance({
appKey: atob(appKey.default),
isAnonymous: true,
Expand Down Expand Up @@ -78,7 +79,7 @@ function getRoomInfo(chatroomId) {
function getServerInfo(serverId) {
return new Promise(async (resolve, reject) => {
try {
const appKey = await import(path.join(__dirname, '../../qqtools/src/QQ/sdk/appKey.mjs'));
const appKey = await importESM(path.join(__dirname, '../../qqtools/src/QQ/sdk/appKey.mjs'));
const qchat = new QChatSDK({
appkey: atob(appKey.default),
account: pocket48Account,
Expand Down
26 changes: 25 additions & 1 deletion packages/NIMTest/node/roomId.json
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,18 @@
"pinyin": "sun yushan",
"liveRoomId": 4311573
},
{
"ownerName": "杨晔",
"id": 407126,
"serverId": 6227955,
"channelId": 7587624,
"account": "20190415141708_jkyh2158qu3n658",
"team": "TEAM X",
"teamId": 1004,
"groupName": "SNH48",
"periodName": "BEJ48 一期生",
"pinyin": "yang ye"
},
{
"id": 407127,
"roomId": "67380550",
Expand Down Expand Up @@ -1627,6 +1639,18 @@
"ownerName": "CKG48-吴晶晶",
"liveRoomId": 19843743
},
{
"ownerName": "程戈",
"id": 618319,
"serverId": 8111741,
"channelId": 10191872,
"account": "20190415142725_mak792pzjhv3v5x",
"team": "IDFT",
"teamId": 1501,
"groupName": "IDFT",
"periodName": "SHY48 三期生",
"pinyin": "cheng ge"
},
{
"id": 624121,
"roomId": "67390999",
Expand Down Expand Up @@ -3844,5 +3868,5 @@
"liveRoomId": 187874323
}
],
"buildTime": "2023-06-19 22:07:00"
"buildTime": "2023-08-23 16:04:51"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as CQ from '../../../../parser/CQ';
import type { QQProtocol } from '../../../../../QQBotModals/ModalTypes';

let bilibiliFeedSpaceId: string; // bilibili空间id
let bilibiliFeedSpaceTimer: NodeJS.Timer | null = null;
let bilibiliFeedSpaceTimer: NodeJS.Timeout | null = null;
let latestTime: number | null = null; // 记录最新的时间
let protocol: QQProtocol; // 协议
let requestCookie: string; // 请求cookie
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ let userId: string; // 用户userId
let description: string; // 描述
let protocol: QQProtocol; // 协议:mirai或者oicq
let lastUpdateTime: number | 0 | null = null; // 记录最新发布视频的更新时间,为0表示当前没有数据,null表示请求数据失败了
let douyinTimer: NodeJS.Timer | undefined = undefined; // 轮询定时器
let douyinTimer: NodeJS.Timeout | undefined = undefined; // 轮询定时器
let cookieString: string | undefined = undefined;
let intervalTime: number = 10 * 60 * 1_000; // 轮询间隔

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ let protocol: QQProtocol; // 协议
let signProtocol: XHSProtocol;
let lastUpdateTime: number | 0 | null = null; // 记录最新发布的更新时间,为0表示当前没有数据,null表示请求数据失败了
const intervalTime: number = 5 * 60 * 1_000; // 轮询间隔
let xiaohongshuTimer: NodeJS.Timer | undefined = undefined; // 轮询定时器
let xiaohongshuTimer: NodeJS.Timeout | undefined = undefined; // 轮询定时器

/* 调试 */
const _startTime: string = dayjs().format('YYYY-MM-DD HH:mm:ss');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ type Listener = () => void;
/* 发送短信倒计时 */
class SMSStore {
time: number = 0;
timer: NodeJS.Timer | number | null = null;
timer: NodeJS.Timeout | number | null = null;
listeners: Array<Listener> = [];

getSnapshot: () => number = (): number => {
Expand Down
2 changes: 1 addition & 1 deletion packages/qqtools/src/services/48/jsdelivrCDN/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export type * from './interface';
/* 查找roomid */
export async function requestRoomId(): Promise<RoomIdObj> {
const controller: AbortController = new AbortController();
const timer: NodeJS.Timer = setTimeout((): void => {
const timer: NodeJS.Timeout = setTimeout((): void => {
controller.abort();
}, 10_000);
const res: Response = await fetch(
Expand Down

0 comments on commit bf62253

Please sign in to comment.