Create CheckNumber.ts

Create CheckNumber to get oficial number with 9 and without 9 for brasillian.
This commit is contained in:
Filipe Borelli
2021-12-09 17:05:34 -03:00
committed by GitHub
parent cb15482c80
commit 613e89b64e

View File

@@ -0,0 +1,13 @@
import GetDefaultWhatsApp from "../../helpers/GetDefaultWhatsApp";
import { getWbot } from "../../libs/wbot";
const CheckContactNumber = async (number: string): Promise<void> => {
const defaultWhatsapp = await GetDefaultWhatsApp();
const wbot = getWbot(defaultWhatsapp.id);
const validNumber : any = await wbot.getNumberId(`${number}@c.us`);
return validNumber.user
};
export default CheckContactNumber;