Merge branch 'main' of https://github.com/GeneralBots/BotServer
This commit is contained in:
commit
025cf0c988
3 changed files with 18 additions and 1 deletions
|
@ -11,7 +11,8 @@
|
|||
"João Ferreira <joao.parana@gmail.com>",
|
||||
"Jorge Ramos <jramos@pobox.com>",
|
||||
"PH <ph.an@outlook.com>",
|
||||
"Dário Vieira <dario.junior3@gmail.com>"
|
||||
"Dário Vieira <dario.junior3@gmail.com>",
|
||||
"Alan Perdomo <alanperdomo@hotmail.com>"
|
||||
],
|
||||
"engines": {
|
||||
"node": "=19.7.0"
|
||||
|
@ -140,6 +141,7 @@
|
|||
"puppeteer-extra": "3.3.4",
|
||||
"puppeteer-extra-plugin-stealth": "2.11.1",
|
||||
"qrcode": "1.5.1",
|
||||
"qr-scanner": "^1.4.2",
|
||||
"qrcode-terminal": "0.12.0",
|
||||
"readline": "1.3.0",
|
||||
"reflect-metadata": "0.1.13",
|
||||
|
|
|
@ -59,6 +59,7 @@ import qrcode from 'qrcode';
|
|||
import { json } from 'body-parser';
|
||||
import { WebAutomationServices } from './WebAutomationServices.js';
|
||||
import urljoin from 'url-join';
|
||||
import QrScanner from 'qr-scanner';
|
||||
|
||||
/**
|
||||
* Default check interval for user replay
|
||||
|
@ -1001,6 +1002,13 @@ export class DialogKeywords {
|
|||
}
|
||||
|
||||
result = phoneNumber;
|
||||
} else if (kind === 'qr-scanner'){
|
||||
//https://github.com/GeneralBots/BotServer/issues/171
|
||||
GBLog.info(`BASIC (${min.botId}): Upload done for ${answer.filename}.`);
|
||||
const handle = WebAutomationServices.cyrb53(this.min.botId + answer.filename);
|
||||
GBServer.globals.files[handle] = answer;
|
||||
QrScanner.scanImage(GBServer.globals.files[handle]).then(result => console.log(result)).catch(error => console.log(error || 'no QR code found.'));
|
||||
|
||||
} else if (kind === 'zipcode') {
|
||||
const extractEntity = (text: string) => {
|
||||
text = text.replace(/\-/gi, '');
|
||||
|
|
|
@ -247,6 +247,13 @@ export class KeywordsExpressions {
|
|||
}
|
||||
];
|
||||
|
||||
keywords[i++] = [
|
||||
/^\s*hear (\w+) as\s*qrcode/gim,
|
||||
($0, $1) => {
|
||||
return `${$1} = await dk.getHear({pid: pid, kind:"qrcode")}`;
|
||||
}
|
||||
];
|
||||
|
||||
keywords[i++] = [
|
||||
/^\s*hear (\w+) as\s*language/gim,
|
||||
($0, $1) => {
|
||||
|
|
Loading…
Add table
Reference in a new issue