mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
fix: bug
This commit is contained in:
@@ -330,6 +330,7 @@ export class OB11Constructor {
|
|||||||
}
|
}
|
||||||
if (message_data.type !== 'unknown' && message_data.data) {
|
if (message_data.type !== 'unknown' && message_data.data) {
|
||||||
const cqCode = encodeCQCode(message_data);
|
const cqCode = encodeCQCode(message_data);
|
||||||
|
|
||||||
if (messagePostFormat === 'string') {
|
if (messagePostFormat === 'string') {
|
||||||
(resMsg.message as string) += cqCode;
|
(resMsg.message as string) += cqCode;
|
||||||
}
|
}
|
||||||
|
@@ -66,10 +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];
|
let value = data.data[name];
|
||||||
try {
|
try {
|
||||||
// Check if the value can be converted to a string
|
// Check if the value can be converted to a string
|
||||||
value.toString();
|
value = value.toString();
|
||||||
} 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
|
||||||
// console.warn(`Skipping problematic name-value pair. Name: ${name}, Value: ${value}`);
|
// console.warn(`Skipping problematic name-value pair. Name: ${name}, Value: ${value}`);
|
||||||
|
Reference in New Issue
Block a user