title: aiohttp ConnectionError: Cannot send requests while disconnected
body: <p>I'm using aiohttp as server and telethon client for sending messages.</p>
  
  <p>Running this edited code from telegrammodule.py is working fine:</p>
  
  <pre><code>from telethon import TelegramClient
  import asyncio
  
  api_id = censored
  api_hash = "censored"
  client = TelegramClient('anon', api_id, api_hash)
  
  async def sendMessageToUser(user, message):
          await client.send_message(user, message)
  
  def sendMessage(user, message):
          with client:
                  client.loop.run_until_complete(sendMessageToUser(user, message))
  
  
  sendMessage("censored", "Hello")
  </code></pre>
  
  <p>This is the error I get when I try to call the function <code>sendMessage()</code> from server.py:</p>
  
  <pre><code>======== Running on http://0.0.0.0:5000 ========
  (Press CTRL+C to quit)
  Error handling request
  Traceback (most recent call last):
    File "/usr/local/lib/python3.7/dist-packages/aiohttp/web_protocol.py", line 418, in start
      resp = await task
    File "/usr/local/lib/python3.7/dist-packages/aiohttp/web_app.py", line 458, in _handle
      resp = await handler(request)
    File "server.py", line 9, in send
      response = await sendMessage(user, message)
    File "/home/user/telegram_user_bot/telegrammodule.py", line 13, in sendMessage
      client.loop.run_until_complete(sendMessageToUser(user, message))
    File "/usr/lib/python3.7/asyncio/base_events.py", line 571, in run_until_complete
      self.run_forever()
    File "/usr/lib/python3.7/asyncio/base_events.py", line 526, in run_forever
      raise RuntimeError('This event loop is already running')
  RuntimeError: This event loop is already running
  Task exception was never retrieved
  future: &lt;Task finished coro=&lt;sendMessageToUser() done, defined at /home/user/telegram_user_bot/telegrammodule.py:8&gt; exception=ConnectionError('Cannot send requests while disconnected')&gt;
  Traceback (most recent call last):
    File "/home/user/telegram_user_bot/telegrammodule.py", line 9, in sendMessageToUser
      await client.send_message(user, message)
    File "/usr/local/lib/python3.7/dist-packages/telethon/client/messages.py", line 752, in send_message
      result = await self(request)
    File "/usr/local/lib/python3.7/dist-packages/telethon/client/users.py", line 53, in __call__
      future = self._sender.send(request, ordered=ordered)
    File "/usr/local/lib/python3.7/dist-packages/telethon/network/mtprotosender.py", line 170, in send
      raise ConnectionError('Cannot send requests while disconnected')
  ConnectionError: Cannot send requests while disconnected
  </code></pre>
  
  <p>Here's the code from server.py:</p>
  
  <pre><code>from telegrammodule import sendMessage
  from aiohttp import web
  import asyncio
  
  async def send(request):
          data = await request.post()
          user = data['user']
          message = data['message']
          response = await sendMessage(user, message)
  
  app = web.Application()
  app.router.add_post("/send", send)
  
  if __name__ == "__main__":
          web.run_app(app, port=5000)
  </code></pre>
  
  <p>And here from telegrammodule.py: </p>
  
  <pre><code>from telethon import TelegramClient
  import asyncio
  
  api_id = censored
  api_hash = "censored"
  client = TelegramClient('anon', api_id, api_hash)
  
  async def sendMessageToUser(user, message):
          await client.send_message(user, message)
  
  async def sendMessage(user, message):
          async with client:
                  client.loop.run_until_complete(sendMessageToUser(user, message))
  </code></pre>
  
  <p>I don't know how to solve the problem. How can I fix it?</p>