"code": 400,
"message": "Chat not found"
}
Why I cannot send message to myself?
can you show your code?
from pytdbot import Client, utils from pytdbot.types import LogStreamFile, Update async def async_main(): tc = Client( lib_path="./td/install/lib/libtdjson.so", # Path to TDjson shared library td_log=LogStreamFile("tdlib.log"), # Set TDLib log file path td_verbosity=2, # TDLib verbosity level loop=asyncio.get_event_loop(), # asyncio loop to use **config.tdconfig ) ... @tc.on_updateAuthorizationState() async def auth(c: Client, update: Update): # print(f'Authorization state: {update["authorization_state"]}') if update["authorization_state"]["@type"] == "authorizationStateReady": me = await c.getMe() print(f'Ready! My ID is {me["id"]}. Sending welcome message to {config.send_to_user_id}...') result = await c.sendTextMessage(config.send_to_user_id, f'Ready! Current time is {datetime.datetime.now()}, host is {socket.gethostname()}') print(result) print("Starting...") await tc.start(login=False) print("Logging in...") await tc.login() await idle() if __name__ == '__main__': asyncio.run(async_main())
I should say that I am doing IP over Telegram
oh damn, i never heard of that lib, i see it's using tdlib
I've also faced this issue when I was coding my userbot. And it seems that you cannot start a conversation just by normal sendmessage + Id. I didn't solve this back then by the way
well from my knowledge from userbots, you first need to "retrieve" contact somehow
Обсуждают сегодня