koishi-core
Advanced tools
Comparing version 1.0.0-alpha.2 to 1.0.0-alpha.3
@@ -320,2 +320,23 @@ "use strict"; | ||
} | ||
// polyfill CQHTTP 3.x events | ||
// https://cqhttp.cc/docs/4.12/#/UpgradeGuide | ||
/* eslint-disable dot-notation */ | ||
if (typeof meta.anonymous === 'string') { | ||
meta.anonymous = { | ||
name: meta.anonymous, | ||
flag: meta['anonymousFlag'], | ||
}; | ||
delete meta['anonymousFlag']; | ||
// @ts-ignore | ||
} | ||
else if (meta.postType === 'event') { | ||
meta.postType = 'notice'; | ||
meta.noticeType = meta['event']; | ||
delete meta['event']; | ||
} | ||
else if (meta.postType === 'request') { | ||
meta.comment = meta.message; | ||
delete meta.message; | ||
} | ||
/* eslint-enable dot-notation */ | ||
// prepare events | ||
@@ -322,0 +343,0 @@ const events = []; |
@@ -86,4 +86,4 @@ "use strict"; | ||
return include1 | ||
? include2 && koishi_utils_1.isSubset(include2, include1) | ||
: include2 ? !koishi_utils_1.intersection(include2, exclude1).length : koishi_utils_1.isSubset(exclude1, exclude2); | ||
? include2 && koishi_utils_1.contain(include1, include2) | ||
: include2 ? !koishi_utils_1.intersection(include2, exclude1).length : koishi_utils_1.contain(exclude2, exclude1); | ||
}); | ||
@@ -90,0 +90,0 @@ } |
@@ -54,5 +54,7 @@ import { GroupData, User } from './database'; | ||
time?: number; | ||
status?: StatusInfo; | ||
interval?: number; | ||
} | ||
export interface AnonymousInfo { | ||
id: number; | ||
id?: number; | ||
name: string; | ||
@@ -59,0 +61,0 @@ flag: string; |
{ | ||
"name": "koishi-core", | ||
"version": "1.0.0-alpha.2", | ||
"version": "1.0.0-alpha.3", | ||
"main": "dist/index.js", | ||
@@ -29,3 +29,3 @@ "typings": "dist/index.d.ts", | ||
"husky": "^3.1.0", | ||
"koishi-test-utils": "^1.0.0-alpha.1" | ||
"koishi-test-utils": "^1.0.0-alpha.2" | ||
}, | ||
@@ -36,3 +36,3 @@ "dependencies": { | ||
"escape-string-regexp": "^2.0.0", | ||
"koishi-utils": "^1.0.0-alpha.0", | ||
"koishi-utils": "^1.0.0-alpha.1", | ||
"leven": "^3.1.0", | ||
@@ -39,0 +39,0 @@ "ws": "^7.2.0" |
90403
2325
Updatedkoishi-utils@^1.0.0-alpha.1