From f002a16984ba889e7622466978f25e8bbd714104 Mon Sep 17 00:00:00 2001 From: hyperbola Date: Mon, 25 Jul 2022 20:39:36 +0800 Subject: [PATCH] Bump to v1.1.0-alpha.1 --- package.json | 2 +- src/index.ts | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 68ab25e..9c1643e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "shopee-coins-bot", - "version": "1.0.18", + "version": "1.1.0-alpha.1", "description": "A robot that receives shopee coins.", "scripts": { "build": "tsc && ncc -m build src/index.js && rm src/*.js", diff --git a/src/index.ts b/src/index.ts index 309578f..a848e1d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,7 +6,7 @@ import Bot from './tw-shopee-bot' import { isValidPassword } from './util' import * as exitCode from './exit-code' -const version = '1.0.18' +const version = '1.1.0-alpha.1' const majorVersion = version.split('.')[0] program .name(`docker run -it hyperbola/shopee-coins-bot:${majorVersion}`) @@ -72,7 +72,11 @@ async function getPassword(): Promise { try { let pass = await fs.readFile(passPath, 'utf-8') // Get the first line of password file - pass = pass.split('\n')[0] + const passwordLines = pass.split('\n') + if (passwordLines.length > 1) { + logger.warn('Read more than one lines from password file. Only the first line is considered password.') + } + pass = passwordLines[0] logger.debug('Password read from file.') return pass } catch (e: unknown) { @@ -122,6 +126,11 @@ async function main() { logger.warn('I will let you go. Please refer to this issue: https://github.com/wdzeng/shopee-coins-bot/issues/4') } + // Warn if using screenshot in kelly image + if (process.env['IMAGE_VARIANT'] === 'kelly' && screenshot) { + logger.warn('You are using kelly image. You may not see CJK characters in screenshots.') + } + // Run bot. const bot = new Bot(username, password, cookies) let result: number