Telethon
Telethon copied to clipboard
no module markdown_it
Checklist
- [x] The error is in the library's code, and not in my own.
- [ ] I have searched for this issue before posting it and there isn't a duplicate.
- [x] I ran
pip install -U https://github.com/LonamiWebs/Telethon/archive/master.zipand triggered the bug in the latest version.
Code that causes the issue
from telethon import TelegramClient
...
Traceback
Traceback (most recent call last):
File "reac.py", line 12, in <module>
from telethon import TelegramClient,sync,events
File "/home/hideyoshi/.local/lib/python3.8/site-packages/telethon/__init__.py", line 4, in <module>
from ._misc import utils as _ # depends on helpers and _tl
File "/home/hideyoshi/.local/lib/python3.8/site-packages/telethon/_misc/utils.py", line 23, in <module>
from . import markdown, html
File "/home/hideyoshi/.local/lib/python3.8/site-packages/telethon/_misc/markdown.py", line 8, in <module>
import markdown_it
ModuleNotFoundError: No module named 'markdown_it'
install the requirements.txt
But I'm having this error after trying to sign in:
Traceback (most recent call last): File "/mnt/shampoo/dev/telegram-autoschedule/test.py", line 13, in <module> 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 "/mnt/shampoo/dev/telegram-autoschedule/test.py", line 10, in main await client.start() File "/home/hector/.local/lib/python3.9/site-packages/telethon/_client/auth.py", line 25, in __aenter__ await self.start_fn() File "/home/hector/.local/lib/python3.9/site-packages/telethon/_client/auth.py", line 143, in _start me = await self.sign_in(phone, code=value) TypeError: sign_in() takes 1 positional argument but 2 positional arguments (and 1 keyword-only argument) were given
requirements.txt
But I'm having this error after trying to sign in:
Traceback (most recent call last): File "/mnt/shampoo/dev/telegram-autoschedule/test.py", line 13, in <module> 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 "/mnt/shampoo/dev/telegram-autoschedule/test.py", line 10, in main await client.start() File "/home/hector/.local/lib/python3.9/site-packages/telethon/_client/auth.py", line 25, in __aenter__ await self.start_fn() File "/home/hector/.local/lib/python3.9/site-packages/telethon/_client/auth.py", line 143, in _start me = await self.sign_in(phone, code=value) TypeError: sign_in() takes 1 positional argument but 2 positional arguments (and 1 keyword-only argument) were given
please add your code
import asyncio
from telethon import TelegramClient
api_id = 12345
api_hash = ''
async def main():
client = TelegramClient('name', api_id, api_hash)
await client.start()
print((await client.get_me()).stringify())
asyncio.run(main())
import asyncio from telethon import TelegramClient api_id = 12345 api_hash = '' async def main(): client = TelegramClient('name', api_id, api_hash) #await client.send_message('kirtoharchikose','test',send_as='libretubsucks') await client.start() print((await client.get_me()).stringify()) asyncio.run(main())
Check if session is active or no , you can remove old session manually and try to add new
client = TelegramClient(phone, api_id, api_hash)
client.connect()
if not client.is_user_authorized():
client.send_code_request(phone)
code = input('enter code: ')
try:
print("TRY TO SIGN IN")
client.sign_in(phone, code)
except Exception as e:
print("TRY TO SIGN UP")
client.sign_up(code, first_name='ahp', last_name='Banana')
Try this code , don't forget to add await statement ,check is it ok?
async def main():
client = TelegramClient('trt', api_id, api_hash)
await client.connect()
if not await client.is_user_authorized():
await client.send_code_request('+989129750798')
code = input('enter code: ')
try:
print("TRY TO SIGN IN")
client.sign_in(+989129750798, code)
except Exception as e:
print("TRY TO SIGN UP")
await client.sign_up(code, first_name='ahp', last_name='Banana')
asyncio.run(main())
Should it look like this? this is not doing anything
async def main(): client = TelegramClient('trt', api_id, api_hash) await client.connect() if not await client.is_user_authorized(): await client.send_code_request('+989129750798') code = input('enter code: ') try: print("TRY TO SIGN IN") client.sign_in(+989129750798, code) except Exception as e: print("TRY TO SIGN UP") await client.sign_up(code, first_name='ahp', last_name='Banana') asyncio.run(main())Should it look like this? this is not doing anything
Try this
async def main():
client = TelegramClient('+989129750798' api_id, api_hash)
await client.connect()
if not await client.is_user_authorized():
await client.send_code_request('+989129750798')
code = input('enter code: ')
try:
print("TRY TO SIGN IN")
client.sign_in('+989129750798', code)
except Exception as e:
print("TRY TO SIGN UP")
await client.sign_up(code, first_name='ahp', last_name='Banana')
asyncio.run(main())
[proxychains] config file found: /etc/proxychains4.conf
[proxychains] preloading /usr/lib/x86_64-linux-gnu/libproxychains.so.4
[proxychains] DLL init: proxychains-ng 4.14
[proxychains] Strict chain ... 127.0.0.1:1089 ... 149.154.167.51:443 ... OK
ok
[proxychains] Strict chain ... 127.0.0.1:1089 ... 149.154.167.91:443 ... OK
not ok
enter code: 63529
TRY TO SIGN IN
TRY TO SIGN UP
Traceback (most recent call last):
File "/mnt/shampoo/dev/telegram-autoschedule/test.py", line 19, in main
client.sign_in(phone, code)
TypeError: sign_in() takes 1 positional argument but 3 were given
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/mnt/shampoo/dev/telegram-autoschedule/test.py", line 23, in <module>
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 "/mnt/shampoo/dev/telegram-autoschedule/test.py", line 22, in main
await client.sign_up(code, first_name='ahp', last_name='Banana')
TypeError: sign_up() got multiple values for argument 'first_name'
seems like the same error?
[proxychains] config file found: /etc/proxychains4.conf [proxychains] preloading /usr/lib/x86_64-linux-gnu/libproxychains.so.4 [proxychains] DLL init: proxychains-ng 4.14 [proxychains] Strict chain ... 127.0.0.1:1089 ... 149.154.167.51:443 ... OK ok [proxychains] Strict chain ... 127.0.0.1:1089 ... 149.154.167.91:443 ... OK not ok enter code: 63529 TRY TO SIGN IN TRY TO SIGN UP Traceback (most recent call last): File "/mnt/shampoo/dev/telegram-autoschedule/test.py", line 19, in main client.sign_in(phone, code) TypeError: sign_in() takes 1 positional argument but 3 were given During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/mnt/shampoo/dev/telegram-autoschedule/test.py", line 23, in <module> 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 "/mnt/shampoo/dev/telegram-autoschedule/test.py", line 22, in main await client.sign_up(code, first_name='ahp', last_name='Banana') TypeError: sign_up() got multiple values for argument 'first_name'seems like the same error?
why are you using development version ? use stable version !
It worked you should not use phone in sign_in only use code=code
It worked you should not use phone in sign_in only use code=code
Oh very good , can you scrap members from groups on development version ? I really need that and I think it doesn't work !
But it won't even sends a message
Fatal error handling updates (this is a bug in Telethon, please report it)
Traceback (most recent call last):
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 "/mnt/shampoo/dev/telegram-autoschedule/test.py", line 23, in main
await client.send_message('me', 'Hello! Talking to you from Telethon')
File "/home/hector/.local/lib/python3.9/site-packages/telethon/_client/messages.py", line 524, in send_message
return self._get_response_message(request, result, entity)
File "/home/hector/.local/lib/python3.9/site-packages/telethon/_client/messageparse.py", line 76, in _get_response_message
entities = {utils.get_peer_id(x): x
File "/home/hector/.local/lib/python3.9/site-packages/telethon/_client/messageparse.py", line 76, in <dictcomp>
entities = {utils.get_peer_id(x): x
File "/home/hector/.local/lib/python3.9/site-packages/telethon/_misc/utils.py", line 969, in get_peer_id
if not isisintance(pid, int):
NameError: name 'isisintance' is not defined
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/hector/.local/lib/python3.9/site-packages/telethon/_client/updates.py", line 204, in _update_loop
updates_to_dispatch.extend(_preprocess_updates(self, processed, users, chats))
File "/home/hector/.local/lib/python3.9/site-packages/telethon/_client/updates.py", line 211, in _preprocess_updates
entities = Entities(self, users, chats)
File "/home/hector/.local/lib/python3.9/site-packages/telethon/_client/updates.py", line 218, in __init__
self._entities = {e.id: e for e in itertools.chain(
File "/home/hector/.local/lib/python3.9/site-packages/telethon/_client/updates.py", line 218, in <dictcomp>
self._entities = {e.id: e for e in itertools.chain(
File "/home/hector/.local/lib/python3.9/site-packages/telethon/_client/updates.py", line 219, in <genexpr>
(User(client, u) for u in users),
NameError: name 'User' is not defined
Traceback (most recent call last):
File "/mnt/shampoo/dev/telegram-autoschedule/test.py", line 24, in <module>
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 "/mnt/shampoo/dev/telegram-autoschedule/test.py", line 23, in main
await client.send_message('me', 'Hello! Talking to you from Telethon')
File "/home/hector/.local/lib/python3.9/site-packages/telethon/_client/messages.py", line 524, in send_message
return self._get_response_message(request, result, entity)
File "/home/hector/.local/lib/python3.9/site-packages/telethon/_client/messageparse.py", line 76, in _get_response_message
entities = {utils.get_peer_id(x): x
File "/home/hector/.local/lib/python3.9/site-packages/telethon/_client/messageparse.py", line 76, in <dictcomp>
entities = {utils.get_peer_id(x): x
File "/home/hector/.local/lib/python3.9/site-packages/telethon/_misc/utils.py", line 969, in get_peer_id
if not isisintance(pid, int):
NameError: name 'isisintance' is not defined
i have upgraded into masterzip and removed aggresive true and also in devlupment virstion but i am getting errors now i am getting this error sir
from telethon.tl.functions.messages import GetDialogsRequest
ModuleNotFoundError: No module named 'telethon.tl'
i have upgraded into masterzip and removed aggresive true and also in devlupment virstion but i am getting errors now i am getting this error sir
from telethon.tl.functions.messages import GetDialogsRequestModuleNotFoundError: No module named 'telethon.tl'
Lots of things has been changed on V2 , read this article before migration https://github.com/LonamiWebs/Telethon/blob/master/readthedocs/misc/v2-migration-guide.rst
i have uninstall the telethon and reinstall it now it giving this error i have upgraded into masterzip and removed aggresive true and also in devlupment virstion
participants = results[i] TypeError: 'ChannelParticipants' object is not subscriptable
i have uninstall the telethon and reinstall it now it giving this error i have upgraded into masterzip and removed aggresive true and also in devlupment virstion
participants = results[i] TypeError: 'ChannelParticipants' object is not subscriptable
add your whole code , you are wrong !
i have uninstall the telethon and reinstall it now it giving this error i have upgraded into masterzip and removed aggresive true and also in devlupment virstion participants = results[i] TypeError: 'ChannelParticipants' object is not subscriptable
add your whole code , you are wrong !
seee sir i have send the code sir .... its working good with small groups like 3000 or 4000 but not in big one sir
i have uninstall the telethon and reinstall it now it giving this error i have upgraded into masterzip and removed aggresive true and also in devlupment virstion participants = results[i] TypeError: 'ChannelParticipants' object is not subscriptable
add your whole code , you are wrong !
seee sir i have send the code sir .... its working good with small groups like 3000 or 4000 but not in big one sir
I'm working on scrapping may be there be some bug ! by the way if you are sure you are scrapping members from a group , I will check this and of there were a bug I will notice
this and of t
yeah i am scrapping members please sir can you help me to fix sir
this and of t
yeah i am scrapping members please sir can you help me to fix sir sure, I will send my code when I checked it
this and of t
yeah i am scrapping members please sir can you help me to fix sir sure, I will send my code when I checked it
hey sir have you fixed the code sir please can you share the code
hey sir have you fixed the code sir please can you share the code @MrDeveloper2022 MrDeveloper2022
Please stay on topic. This issue tracks the lack of the markdown-it dependency in setup.py and nothing else.
mr lonami but that error also not solved ! you always give a other template to see for the error but there you locked the chat and the error still not solved there
Closing since this is regarding v2 which is not ready for public use yet.