mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-17 19:37:02 +00:00
Create CheckNumber.ts
Create CheckNumber to get oficial number with 9 and without 9 for brasillian.
This commit is contained in:
13
backend/src/services/WbotServices/CheckNumber.ts
Normal file
13
backend/src/services/WbotServices/CheckNumber.ts
Normal 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;
|
||||
Reference in New Issue
Block a user