Merge pull request #320 from filipeborelli/patch-1

Create CheckNumber.ts
This commit is contained in:
Cassio Santos
2021-12-11 09:25:58 -03:00
committed by GitHub

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;