pylakey/aiotdlib

'tuple' object has no attribute 'encode'

morteza102030 opened this issue · 1 comments

Traceback (most recent call last):
File "/root/mm.py", line 26, in
asyncio.run(main())
File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
File "/root/mm.py", line 13, in main
client = Client(
File "/usr/local/lib/python3.9/dist-packages/aiotdlib/client.py", line 253, in init
md5_hash.update((self.phone_number or self.bot_token).encode('utf-8'))
AttributeError: 'tuple' object has no attribute 'encode'

What type of phone_number or bot_token argument you passed to Client constructor?

As shown in example both of them must be 'str' instance not a 'tuple':

phone_number usage example: https://github.com/pylakey/aiotdlib#example
bot_token usage example: https://github.com/pylakey/aiotdlib#bot-command-handler