UNPKG

wechaty-puppet-wechat4u

Version:
35 lines 1.07 kB
// tslint:disable:no-reference /// <reference path="./types.d.ts" /> import { log, } from 'wechaty-puppet'; import { FileBox, } from 'file-box'; import promiseRetry from 'promise-retry'; import { packageJson } from './package-json.js'; const VERSION = packageJson.version || '0.0.0'; const NAME = packageJson.name || 'NONAME'; export function qrCodeForChatie() { const CHATIE_OFFICIAL_ACCOUNT_QRCODE = 'http://weixin.qq.com/r/qymXj7DEO_1ErfTs93y5'; return FileBox.fromQRCode(CHATIE_OFFICIAL_ACCOUNT_QRCODE); } export async function retry(retryableFn) { /** * 60 seconds: (to be confirmed) * factor: 3 * minTimeout: 10 * maxTimeout: 20 * 1000 * retries: 9 */ const factor = 3; const minTimeout = 10; const maxTimeout = 20 * 1000; const retries = 9; // const unref = true const retryOptions = { factor, maxTimeout, minTimeout, retries, }; return promiseRetry(retryOptions, retryableFn); } export { VERSION, NAME, log, }; //# sourceMappingURL=config.js.map