X
X
xxx2018-10-27 22:38:48
Python
xxx, 2018-10-27 22:38:48

Async or am I missing something?

There are 2 functions:

```
def get_sms():
  time.sleep(100)
  return token

def start(token=None):
  return result

start(*args ,token=get_sms())
```

The start function sends a message to the number and, after receiving the code, activates the user. (As I understand it, it only works with a coroutine that returns sms)
In the get_sms function, I wait for a message with a code and return it to start for full activation.
For some reason I can't do it synchronously as described above. As I understand it, until the start function is completely completed, SMS will not be sent to me.
How to do this through asyncio and is it necessary?
This is me using telethon if anything, there is such
# client.start(phone=phone, force_sms=True, code_callback=receive_sms, first_name='Вася', last_name='Пупкин')

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question