chore: suppress type check

This commit is contained in:
Wesley F. Young 2024-08-26 09:09:15 +08:00
parent 7b87b0919b
commit 542c5beb1b

View File

@ -1,6 +1,6 @@
import { OB11MessageData } from '../types';
const pattern = /\[CQ:(\w+)((,\w+=[^,\]]*)*)\]/;
const pattern = /\[CQ:(\w+)((,\w+=[^,\]]*)*)]/;
function unescape(source: string) {
return String(source)
@ -49,14 +49,14 @@ export function encodeCQCode(data: OB11MessageData) {
const CQCodeEscapeText = (text: string) => {
return text.replace(/&/g, '&')
.replace(/\[/g, '[')
.replace(/\]/g, ']');
.replace(/]/g, ']');
};
const CQCodeEscape = (text: string) => {
return text.replace(/&/g, '&')
.replace(/\[/g, '[')
.replace(/\]/g, ']')
.replace(/]/g, ']')
.replace(/,/g, ',');
};
@ -66,7 +66,10 @@ export function encodeCQCode(data: OB11MessageData) {
let result = '[CQ:' + data.type;
for (const name in data.data) {
const value = data.data[name];
const value =
// eslint-disable-next-line
// @ts-ignore
data.data[name];
if (value === undefined) {
continue;
}
@ -79,4 +82,4 @@ export function encodeCQCode(data: OB11MessageData) {
}
result += ']';
return result;
}
}