koishi-plugin-bind-bot 2.2.2 → 2.2.3
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.
|
@@ -618,8 +618,8 @@ class GroupRequestReviewHandler extends base_handler_1.BaseHandler {
|
|
|
618
618
|
// 创建新绑定(不使用临时MC用户名)
|
|
619
619
|
bind = await this.repos.mcidbind.create({
|
|
620
620
|
qqId: qq,
|
|
621
|
-
mcUsername:
|
|
622
|
-
mcUuid:
|
|
621
|
+
mcUsername: null,
|
|
622
|
+
mcUuid: null,
|
|
623
623
|
buidUid: zminfoUser.uid,
|
|
624
624
|
buidUsername: finalUsername,
|
|
625
625
|
guardLevel: zminfoUser.guard_level || 0,
|
package/lib/index.js
CHANGED
|
@@ -578,11 +578,11 @@ function apply(ctx, config) {
|
|
|
578
578
|
},
|
|
579
579
|
mcUsername: {
|
|
580
580
|
type: 'string',
|
|
581
|
-
initial:
|
|
581
|
+
initial: null
|
|
582
582
|
},
|
|
583
583
|
mcUuid: {
|
|
584
584
|
type: 'string',
|
|
585
|
-
initial:
|
|
585
|
+
initial: null
|
|
586
586
|
},
|
|
587
587
|
lastModified: {
|
|
588
588
|
type: 'timestamp',
|
|
@@ -741,8 +741,8 @@ function apply(ctx, config) {
|
|
|
741
741
|
}
|
|
742
742
|
// 清理临时用户名(无论hasMcBind字段是否存在)
|
|
743
743
|
if (!hasValidMc && mcUsername && mcUsername.startsWith('_temp_')) {
|
|
744
|
-
updateData.mcUsername =
|
|
745
|
-
updateData.mcUuid =
|
|
744
|
+
updateData.mcUsername = null;
|
|
745
|
+
updateData.mcUuid = null;
|
|
746
746
|
updateData.whitelist = [];
|
|
747
747
|
needUpdate = true;
|
|
748
748
|
logger.info(`[数据清理] 清理QQ(${qqId})的临时用户名: ${mcUsername}`);
|
|
@@ -146,8 +146,8 @@ class DatabaseService {
|
|
|
146
146
|
if (bind_status_1.BindStatus.hasValidBuidBind(bind)) {
|
|
147
147
|
// 如果有B站绑定,只清空MC字段,保留记录
|
|
148
148
|
await this.mcidbindRepo.update(normalizedQQId, {
|
|
149
|
-
mcUsername:
|
|
150
|
-
mcUuid:
|
|
149
|
+
mcUsername: null,
|
|
150
|
+
mcUuid: null,
|
|
151
151
|
hasMcBind: false,
|
|
152
152
|
whitelist: [],
|
|
153
153
|
lastModified: new Date()
|
|
@@ -295,8 +295,8 @@ class DatabaseService {
|
|
|
295
295
|
// 创建新绑定记录(不使用临时用户名)
|
|
296
296
|
const newBind = {
|
|
297
297
|
qqId: normalizedQQId,
|
|
298
|
-
mcUsername:
|
|
299
|
-
mcUuid:
|
|
298
|
+
mcUsername: null,
|
|
299
|
+
mcUuid: null,
|
|
300
300
|
isAdmin: false,
|
|
301
301
|
whitelist: [],
|
|
302
302
|
tags: [],
|
package/lib/types/database.d.ts
CHANGED
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
export interface MCIDBIND {
|
|
39
39
|
/** 纯QQ号 (作为主键, 不包含 'qq:' 前缀) */
|
|
40
40
|
qqId: string;
|
|
41
|
-
/** MC用户名 (
|
|
42
|
-
mcUsername: string;
|
|
43
|
-
/** MC UUID (格式: 带连字符的标准UUID) */
|
|
44
|
-
mcUuid: string;
|
|
41
|
+
/** MC用户名 (具有唯一性约束, NULL表示未绑定) */
|
|
42
|
+
mcUsername: string | null;
|
|
43
|
+
/** MC UUID (格式: 带连字符的标准UUID, NULL表示未绑定) */
|
|
44
|
+
mcUuid: string | null;
|
|
45
45
|
/** MC用户名上次检查时间 (用于改名检测缓存) */
|
|
46
46
|
usernameLastChecked?: Date;
|
|
47
47
|
/** 用户名检查失败次数 (连续失败计数, 失败≥3次延长冷却期至72小时) */
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
26
|
export interface UpdateMcBindData {
|
|
27
|
-
/** MC用户名 */
|
|
28
|
-
mcUsername?: string;
|
|
29
|
-
/** MC UUID */
|
|
30
|
-
mcUuid?: string;
|
|
27
|
+
/** MC用户名 (NULL表示未绑定) */
|
|
28
|
+
mcUsername?: string | null;
|
|
29
|
+
/** MC UUID (NULL表示未绑定) */
|
|
30
|
+
mcUuid?: string | null;
|
|
31
31
|
/** 上次修改时间 */
|
|
32
32
|
lastModified?: Date;
|
|
33
33
|
/** 是否为管理员 */
|
|
@@ -134,8 +134,8 @@ export interface UpdateBuidInfoData {
|
|
|
134
134
|
*/
|
|
135
135
|
export interface CreateBindData {
|
|
136
136
|
qqId: string;
|
|
137
|
-
mcUsername: string;
|
|
138
|
-
mcUuid: string;
|
|
137
|
+
mcUsername: string | null;
|
|
138
|
+
mcUuid: string | null;
|
|
139
139
|
isAdmin: boolean;
|
|
140
140
|
whitelist: string[];
|
|
141
141
|
tags: string[];
|