title: can't loop through chats and get premissions in telethon
body: <p>I'm trying to get my group/channel permissions with the help of telethon but it gives an error whenever I run the <code>get_permissions</code> function inside a for-loop. This is the code:</p>
  <pre class="lang-py prettyprint-override"><code>client = TelegramClient(phone, apiId, apiHash)
  client.connect()
  
  
  if not client.is_user_authorized():
      client.send_code_request(phone)
      client.sign_in(phone, input(&quot;Enter the verification code:&quot;))
  
  
  chats = []
  last_date = None
  chunk_size = 200
  groups = []
  channels = []
  
  result = client(GetDialogsRequest(
      offset_date=last_date,
      offset_id=0,
      offset_peer=InputPeerEmpty(),
      limit=chunk_size,
      hash=0
  ))
  chats.extend(result.chats)
  
  me = client.get_me()
  
  for chat in chats:
      permissions = client.get_permissions(chat, client.get_me())
      if permissions.is_admin():
          client.get_participants(chat)
      else:
          print(&quot;you don't have access to this channel/group&quot;)
  </code></pre>
  <p>and this is the error that it's giving me:</p>
  <pre class="lang-py prettyprint-override"><code>Request caused struct.error: required argument is not an integer: GetFullChatRequest(chat_id=InputPeerChat(chat_id=701294847))
  Traceback (most recent call last):
    File &quot;/Users/artin/Documents/coding/work/Cryptal/cryptal-aggregator/src/sample.py&quot;, line 45, in &lt;module&gt;
      permissions = client.get_permissions(chat, client.get_me())
    File &quot;/opt/homebrew/lib/python3.10/site-packages/telethon/sync.py&quot;, line 39, in syncified
      return loop.run_until_complete(coro)
    File &quot;/opt/homebrew/Cellar/python@3.10/3.10.5/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py&quot;, line 646, in run_until_complete
      return future.result()
    File &quot;/opt/homebrew/lib/python3.10/site-packages/telethon/client/chats.py&quot;, line 1278, in get_permissions
      chat = await self(functions.messages.GetFullChatRequest(
    File &quot;/opt/homebrew/lib/python3.10/site-packages/telethon/client/users.py&quot;, line 30, in __call__
      return await self._call(self._sender, request, ordered=ordered)
    File &quot;/opt/homebrew/lib/python3.10/site-packages/telethon/client/users.py&quot;, line 63, in _call
      future = sender.send(request, ordered=ordered)
    File &quot;/opt/homebrew/lib/python3.10/site-packages/telethon/network/mtprotosender.py&quot;, line 176, in send
      state = RequestState(request)
    File &quot;/opt/homebrew/lib/python3.10/site-packages/telethon/network/requeststate.py&quot;, line 17, in __init__
      self.data = bytes(request)
    File &quot;/opt/homebrew/lib/python3.10/site-packages/telethon/tl/tlobject.py&quot;, line 194, in __bytes__
      return self._bytes()
    File &quot;/opt/homebrew/lib/python3.10/site-packages/telethon/tl/functions/messages.py&quot;, line 2065, in _bytes
      struct.pack('&lt;q', self.chat_id),
  struct.error: required argument is not an integer
  </code></pre>