mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
opt
This commit is contained in:
parent
3f5ca8ebfa
commit
406e3c7e6b
@ -50,7 +50,6 @@ export function encodeCQCode(data: OB11MessageData) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const CQCodeEscape = (text: string) => {
|
const CQCodeEscape = (text: string) => {
|
||||||
text = text.toString()
|
|
||||||
return text.replace(/\&/g, '&').replace(/\[/g, '[').replace(/\]/g, ']').replace(/,/g, ',')
|
return text.replace(/\&/g, '&').replace(/\[/g, '[').replace(/\]/g, ']').replace(/,/g, ',')
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,7 +64,8 @@ export function encodeCQCode(data: OB11MessageData) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
result += `,${name}=${CQCodeEscape(value)}`
|
const text = value.toString()
|
||||||
|
result += `,${name}=${CQCodeEscape(text)}`
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// If it can't be converted, skip this name-value pair
|
// If it can't be converted, skip this name-value pair
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user