SilveryStar/Adachi-BOT

部分用户使用抽卡命令时,powershell报错,bot关闭。暂时没发现用户之间关联性

Closed this issue · 3 comments

系统版本

Windows 10 专业版 21H1

Node.js 版本

v13.13.0

应用版本

2.2.5-bugfix2

启动方式

Forever

复述操作

正常使用抽卡命令,某些用户使用就会导致powershell有报错,并且关闭bot。
这些用户使用其他命令如uid和抽签命令时,暂时没发现会导致bot报错关闭
而且这些用户没发现有什么相似之处
一个QQ名为༺黑ོ࿆黑ོ࿆黑ོ࿆༻,一个QQ名为浮春之乡-
屏幕截图 2021-12-23 015932
屏幕截图 2021-12-23 020023

配置文件

commands.yml

silvery-star.wish:
  type: order
  auth: 1
  scope: 3
  headers:
    - ck
    - 十连
    - 抽卡
  enable: true


setting.ts  55行起

const wish: OrderConfig = {
	type: "order",
	cmdKey: "silvery-star.wish",
	desc: [ "祈愿抽卡", "(次数填写1~99,不填默认1|保底)" ],
	headers: [ "wish", "w" ],
	regexps: [ "(\\d{1,2}|保底)?" ],
	main: "achieves/wish",
	detail: "抽卡次数可以填写 1~99,表示十连抽的次数,默认为 1\n" +
			"使用 until 的时候会一直抽到 UP 武器或角色"
};


wish.ts  322行起

public async get( userID: number, choice: string, param: string ): Promise<WishTotalSet | null> {
		const method = this.getWishMethod( choice );
		if ( method ) {
			const wish: Wish = new Wish( ...method, userID );
			switch ( true ) {
				case param.length === 0:
					return await wish.getAnyTimes( 10 );
				case /^\d+$/.test( param ):
					return await wish.getAnyTimes( parseInt( param ) * 10 );
				case param === "保底":
					const check = await this.getCheckFn( method, userID );
					return await wish.getUntil( check );
			}
		}
		return null;
	}

错误报告


powershell报错
C:\Green\Adachi-BOT\Adachi-BOT-master\node_modules\redis-parser\lib\parser.js:179
    return new ReplyError(string)
           ^
ReplyError: ERR hash value is not an integer
    at parseError (C:\Green\Adachi-BOT\Adachi-BOT-master\node_modules\redis-parser\lib\parser.js:179:12)
    at parseType (C:\Green\Adachi-BOT\Adachi-BOT-master\node_modules\redis-parser\lib\parser.js:302:14)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! adachi-bot@2.2.5-bugfix2 start: `ts-node -r tsconfig-paths/register app.ts --files`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the adachi-bot@2.2.5-bugfix2 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Yang\AppData\Roaming\npm-cache\_logs\2021-12-22T17_45_05_602Z-debug.log

debug log文件内容如下
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'start'
1 verbose cli ]
2 info using npm@6.14.4
3 info using node@v13.13.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle adachi-bot@2.2.5-bugfix2~prestart: adachi-bot@2.2.5-bugfix2
6 info lifecycle adachi-bot@2.2.5-bugfix2~start: adachi-bot@2.2.5-bugfix2
7 verbose lifecycle adachi-bot@2.2.5-bugfix2~start: unsafe-perm in lifecycle true
8 verbose lifecycle adachi-bot@2.2.5-bugfix2~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Green\Adachi-BOT\Adachi-BOT-master\node_modules\.bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\nodejs\;C:\Users\Yang\AppData\Local\Microsoft\WindowsApps;C:\Users\Yang\AppData\Roaming\npm;C:\Users\Yang\AppData\Local\Programs\Microsoft VS Code\bin
9 verbose lifecycle adachi-bot@2.2.5-bugfix2~start: CWD: C:\Green\Adachi-BOT\Adachi-BOT-master
10 silly lifecycle adachi-bot@2.2.5-bugfix2~start: Args: [ '/d /s /c', 'ts-node -r tsconfig-paths/register app.ts --files' ]
11 silly lifecycle adachi-bot@2.2.5-bugfix2~start: Returned: code: 1  signal: null
12 info lifecycle adachi-bot@2.2.5-bugfix2~start: Failed to exec start script
13 verbose stack Error: adachi-bot@2.2.5-bugfix2 start: `ts-node -r tsconfig-paths/register app.ts --files`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:315:20)
13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:315:20)
13 verbose stack     at maybeClose (internal/child_process.js:1026:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid adachi-bot@2.2.5-bugfix2
15 verbose cwd C:\Green\Adachi-BOT\Adachi-BOT-master
16 verbose Windows_NT 10.0.19043
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v13.13.0
19 verbose npm  v6.14.4
20 error code ELIFECYCLE
21 error errno 1
22 error adachi-bot@2.2.5-bugfix2 start: `ts-node -r tsconfig-paths/register app.ts --files`
22 error Exit status 1
23 error Failed at the adachi-bot@2.2.5-bugfix2 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

尝试过重新部署2.2.5-bugfix2版本,也是不行

如果这些人只是不能用 wish 的话,更新到 bugfix3 应该是正常的……

更新bugfix4版本后问题解决