feat: add 402 code message

This commit is contained in:
Shigma 2022-10-08 00:24:33 +08:00
parent 9fa3f43806
commit 98d395ccb7
No known key found for this signature in database
GPG Key ID: 21C89B0B92907E14
3 changed files with 5 additions and 2 deletions

View File

@ -1,7 +1,7 @@
{
"name": "koishi-plugin-novelai",
"description": "Generate images by NovelAI",
"version": "1.3.2",
"version": "1.4.1",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"files": [

View File

@ -157,6 +157,8 @@ export function apply(ctx: Context, config: Config) {
return session.text('.rate-limited')
} else if (err.response?.status === 401) {
return session.text('.invalid-token')
} else if (err.response?.status === 402) {
return session.text('.unauthorized')
}
}
logger.error(err)

View File

@ -21,4 +21,5 @@ commands:
unknown-error: 发生未知错误。
nickname: AI 画师
rate-limited: 访问频率过高,请稍后再试。
invalid-token: 无效的授权令牌,请联系管理员。
invalid-token: 令牌无效或已过期,请联系管理员。
unauthorized: 令牌未授权,可能需要续费,请联系管理员。