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';
|
import { OB11MessageData } from '../types';
|
||||||
|
|
||||||
const pattern = /\[CQ:(\w+)((,\w+=[^,\]]*)*)\]/;
|
const pattern = /\[CQ:(\w+)((,\w+=[^,\]]*)*)]/;
|
||||||
|
|
||||||
function unescape(source: string) {
|
function unescape(source: string) {
|
||||||
return String(source)
|
return String(source)
|
||||||
@ -49,14 +49,14 @@ export function encodeCQCode(data: OB11MessageData) {
|
|||||||
const CQCodeEscapeText = (text: string) => {
|
const CQCodeEscapeText = (text: string) => {
|
||||||
return text.replace(/&/g, '&')
|
return text.replace(/&/g, '&')
|
||||||
.replace(/\[/g, '[')
|
.replace(/\[/g, '[')
|
||||||
.replace(/\]/g, ']');
|
.replace(/]/g, ']');
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const CQCodeEscape = (text: string) => {
|
const CQCodeEscape = (text: string) => {
|
||||||
return text.replace(/&/g, '&')
|
return text.replace(/&/g, '&')
|
||||||
.replace(/\[/g, '[')
|
.replace(/\[/g, '[')
|
||||||
.replace(/\]/g, ']')
|
.replace(/]/g, ']')
|
||||||
.replace(/,/g, ',');
|
.replace(/,/g, ',');
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -66,7 +66,10 @@ export function encodeCQCode(data: OB11MessageData) {
|
|||||||
|
|
||||||
let result = '[CQ:' + data.type;
|
let result = '[CQ:' + data.type;
|
||||||
for (const name in data.data) {
|
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) {
|
if (value === undefined) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user