mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
chore: suppress type check
This commit is contained in:
parent
7b87b0919b
commit
542c5beb1b
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user