fix(onebot): allow clearing the self signature

Accept explicit empty strings from both longNick and long_nick when callers need to clear the bot signature. Missing and non-string values remain rejected before reaching the bridge.

Preserve the QQ-compatible clear representation by omitting the empty profile value, and add action-level and wire-level regression coverage. Live verification confirmed successful clearing and readback on the test bot.

Fixes #247
This commit is contained in:
DrSmoothl committed 2026-07-19 18:12:48 +08:00
1 parent 65e819d96e
commit f3e0c4e45a
3 files changed
+47 -1

No files matched your search

+1 -1
View File
@@ -2050,7 +2050,7 @@ export const actions = [
summary: '设置个性签名(longNick/long_nick,严格 string)',
params: { longNick: f.raw(), long_nick: f.raw() },
run: async (p, ctx) => {
const longNick = p.longNick || p.long_nick;
const longNick = p.longNick !== undefined ? p.longNick : p.long_nick;
if (typeof longNick !== 'string') return failedResponse(RETCODE.BAD_REQUEST, 'invalid longNick');
await ctx.bridge.apis.profile.setSelfLongNick(longNick);
return okResponse({});