@karinjs/adapter-qqbot 3.0.8 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dist/apps/qqbot-file-to-url.d.ts +4 -0
- package/dist/apps/qqbot-file-to-url.js +94 -0
- package/dist/common-OHGAoohl.js +42 -0
- package/dist/index.d.ts +991 -15
- package/dist/index.js +1346 -317
- package/dist/utils-C0oZi6PR.js +5 -0
- package/dist/web.config.js +1 -1
- package/package.json +1 -1
- package/dist/utils-QpIUJhxK.js +0 -32
package/dist/web.config.js
CHANGED
package/package.json
CHANGED
package/dist/utils-QpIUJhxK.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import "./config-D1_LqrcJ.js";
|
|
2
|
-
import "./logger-sza6kuy3.js";
|
|
3
|
-
import { common, logger } from "node-karin";
|
|
4
|
-
import qrcode from "qrcode";
|
|
5
|
-
import size from "image-size";
|
|
6
|
-
import lodash from "node-karin/lodash";
|
|
7
|
-
import "@karinjs/geturls";
|
|
8
|
-
|
|
9
|
-
//#region src/utils/common.ts
|
|
10
|
-
/** QQBot统一API地址 */
|
|
11
|
-
const QQAPIBASEURL = "https://api.bot.qq.com";
|
|
12
|
-
/** 随机数 */
|
|
13
|
-
const random = (min, max) => lodash.random(min, max);
|
|
14
|
-
/**
|
|
15
|
-
* 伪事件日志(红字)
|
|
16
|
-
*/
|
|
17
|
-
const fakeEvent = (log) => {
|
|
18
|
-
logger.fatal(`${logger.red("[QQ Official Bot][虚假事件]")} ${log.replace(/\n/g, "\\n")}`);
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* 读取图片宽高
|
|
22
|
-
*/
|
|
23
|
-
const getImageSize = async (url) => {
|
|
24
|
-
const { width = 100, height = 100 } = size(await common.buffer(url));
|
|
25
|
-
return {
|
|
26
|
-
width,
|
|
27
|
-
height
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
//#endregion
|
|
32
|
-
export { random as i, fakeEvent as n, getImageSize as r, QQAPIBASEURL as t };
|