feat: new api
This commit is contained in:
1 parent
7a581066c2
commit
80c59de545
7 files changed
+36
-9
No files matched your search
@@ -67,6 +67,14 @@ export function encodeCQCode(data: OB11MessageData) {
|
||||
let result = '[CQ:' + data.type;
|
||||
for (const name in data.data) {
|
||||
const value = data.data[name];
|
||||
try {
|
||||
// Check if the value can be converted to a string
|
||||
value.toString();
|
||||
} catch (error) {
|
||||
// If it can't be converted, skip this name-value pair
|
||||
// console.warn(`Skipping problematic name-value pair. Name: ${name}, Value: ${value}`);
|
||||
continue;
|
||||
}
|
||||
result += `,${name}=${CQCodeEscape(value)}`;
|
||||
}
|
||||
result += ']';
|
||||
|
||||
Reference in new issue
Block a user