diff --git a/packages/koishi-utils/src/cqCode.ts b/packages/koishi-utils/src/cqCode.ts index 0910d5ed1a..6f9704448d 100644 --- a/packages/koishi-utils/src/cqCode.ts +++ b/packages/koishi-utils/src/cqCode.ts @@ -1,4 +1,4 @@ -type CQCodeData = Record +type CQCodeData = Record interface CQCode { type: string @@ -25,7 +25,7 @@ namespace CQCode { .replace(/&/g, '&') } - export function stringify (type: string, data: CQCodeData) { + export function stringify (type: string, data: CQCodeData = {}) { if (type === 'text') return '' + data.text let output = '[CQ:' + type for (const key in data) {