@alemonjs/qq-bot 2.1.10 → 2.1.11
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/lib/config.d.ts +1 -1
- package/lib/config.js +2 -13
- package/lib/sends.js +9 -1
- package/package.json +2 -2
package/lib/config.d.ts
CHANGED
|
@@ -7,4 +7,4 @@ export type Options = {
|
|
|
7
7
|
hideUnsupported?: boolean | number;
|
|
8
8
|
} & sdkOptions;
|
|
9
9
|
export declare const getQQBotConfig: () => Options;
|
|
10
|
-
export declare const getMaster: (UserId: string) =>
|
|
10
|
+
export declare const getMaster: (UserId: string) => boolean;
|
package/lib/config.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getConfigValue,
|
|
1
|
+
import { getConfigValue, isMaster } from 'alemonjs';
|
|
2
2
|
|
|
3
3
|
const platform = 'qq-bot';
|
|
4
4
|
const getQQBotConfig = () => {
|
|
@@ -6,18 +6,7 @@ const getQQBotConfig = () => {
|
|
|
6
6
|
return value[platform] || {};
|
|
7
7
|
};
|
|
8
8
|
const getMaster = (UserId) => {
|
|
9
|
-
|
|
10
|
-
const mainMasterKey = values.master_key || [];
|
|
11
|
-
const mainMasterId = values.master_id || [];
|
|
12
|
-
const config = getQQBotConfig();
|
|
13
|
-
const masterKey = config.master_key || [];
|
|
14
|
-
const masterId = config.master_id || [];
|
|
15
|
-
const UserKey = useUserHashKey({
|
|
16
|
-
Platform: platform,
|
|
17
|
-
UserId: UserId
|
|
18
|
-
});
|
|
19
|
-
const is = mainMasterKey.includes(UserKey) || mainMasterId.includes(UserId) || masterKey.includes(UserKey) || masterId.includes(UserId);
|
|
20
|
-
return [is, UserKey];
|
|
9
|
+
return isMaster(UserId, platform);
|
|
21
10
|
};
|
|
22
11
|
|
|
23
12
|
export { getMaster, getQQBotConfig, platform };
|
package/lib/sends.js
CHANGED
|
@@ -96,7 +96,15 @@ const mdFormatters = {
|
|
|
96
96
|
'MD.strikethrough': value => `~~${value}~~ `,
|
|
97
97
|
'MD.blockquote': value => `\n> ${value} `,
|
|
98
98
|
'MD.newline': () => '\n',
|
|
99
|
-
'MD.link': value =>
|
|
99
|
+
'MD.link': value => {
|
|
100
|
+
if (!value?.text && !value?.url) {
|
|
101
|
+
return '';
|
|
102
|
+
}
|
|
103
|
+
if (!value?.text || !value?.url) {
|
|
104
|
+
return `<${value?.url ?? value?.text}> `;
|
|
105
|
+
}
|
|
106
|
+
return `[🔗${value?.text}](${value?.url}) `;
|
|
107
|
+
},
|
|
100
108
|
'MD.image': (value, options) => `\n\n`,
|
|
101
109
|
'MD.mention': (value, options) => {
|
|
102
110
|
const { belong } = options || {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alemonjs/qq-bot",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.11",
|
|
4
4
|
"description": "阿柠檬qq-bot平台连接",
|
|
5
5
|
"author": "lemonade",
|
|
6
6
|
"license": "MIT",
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"type": "git",
|
|
75
75
|
"url": "https://github.com/lemonade-lab/alemonjs.git"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "e50477125586204c6e56a8ecfe3391136f5fe74b"
|
|
78
78
|
}
|