Compare commits

..

3 Commits

Author SHA1 Message Date
linyuchen
d0967785de chore: v3.27.3 2024-07-20 16:58:03 +08:00
linyuchen
eccabb8189 Merge pull request #299 from Natsukage/main
fix: skip problematic name-value pairs in encodeCQCode to prevent undefined errors
2024-07-20 15:25:27 +08:00
夏影
c9374ff515 fix: skip problematic name-value pairs in encodeCQCode to prevent undefined errors
Added logic to skip name-value pairs in encodeCQCode when value cannot be converted to string, preventing errors caused by undefined values. This ensures the function can handle such cases gracefully and continue processing other valid data.
2024-07-20 00:49:34 +08:00
3 changed files with 11 additions and 3 deletions

View File

@@ -1,10 +1,10 @@
{
"manifest_version": 4,
"type": "extension",
"name": "LLOneBot v3.27.2",
"name": "LLOneBot v3.27.3",
"slug": "LLOneBot",
"description": "使你的NTQQ支持OneBot11协议进行QQ机器人开发",
"version": "3.27.2",
"version": "3.27.3",
"icon": "./icon.jpg",
"authors": [
{

View File

@@ -61,6 +61,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 += ']'

View File

@@ -1 +1 @@
export const version = '3.27.2'
export const version = '3.27.3'