From 92fa80313f7e988c33a2ae99e6e7815594bd3219 Mon Sep 17 00:00:00 2001 From: marttoygoy5 <84065793+marttoygoy5@users.noreply.github.com> Date: Wed, 12 May 2021 14:00:17 +0300 Subject: [PATCH] Added getNumberFrom_tzid added notice alert of what is the number and getNumberFrom_tzid --- onlinesimru/GetNumbers.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/onlinesimru/GetNumbers.py b/onlinesimru/GetNumbers.py index c5c5824..2f81406 100644 --- a/onlinesimru/GetNumbers.py +++ b/onlinesimru/GetNumbers.py @@ -90,15 +90,30 @@ def service(self): def serviceNumber(self, service: str): return self._get(f"/getServiceNumber", {"service": service})["number"] + + def getNumberFrom_tzid(self, tzid: int): + response = self.stateOne(tzid, 1, False) + print(f"[!] The phone-number is: [[{response['number']}]], country code is [[{response['country']}]].") + + numberJson_ = { + 'phoneNumber': response['number'], + 'Country_Code': response['country'], + } + return numberJson_ - def wait_code( - self, tzid: int, timeout=10, callback=None, not_end=False, full_message=False - ): + def wait_code(self, tzid: int, timeout=10, callback=None, not_end=False, full_message=False): + __last_code: str = "" _response_type: int = 1 if full_message: _response_type = 0 counter = 0 + + + response = self.stateOne(tzid, 1, False) + print(f"[!] Attention! Reminder the phone-number is: [[{response['number']}]], country code is [[{response['country']}]].") + + while True: time.sleep(timeout) counter += 1