mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-20 04:39:20 +00:00
Merge pull request #320 from filipeborelli/patch-1
Create CheckNumber.ts
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