Hi i am receiving an error starting a bot with nothing on it yet
I am using Pyrogram (2.0.97) and Python (3.9.6)
I didn't developed more code for this bot yet, but i want to use this library (pyrogram) and not other library, because of this decorators that has on this library
Here is the simple code
from pyrogram import Client, filters
from pyrogram.types import Message
from pyrogram.types import (
InlineKeyboardButton, InlineKeyboardMarkup, ReplyKeyboardMarkup
)
TELEGRAM_API_ID = "22284blablabla"
TELEGRAM_API_HASH = "186a3759fc29f394bad2700cc29ecblablabla"
TELEGRAM_BOT_TOKEN = "blablablablabla"
app = Client(
'SegBot',
api_id=TELEGRAM_API_ID,
api_hash=TELEGRAM_API_HASH,
bot_token=TELEGRAM_BOT_TOKEN
)
@app.on_message(filters.private)
async def hello(client, message):
await message.reply("Hello from Pyrogram!")
print('running!!!')
app.run()
And the error is:
running!!!
Traceback (most recent call last):
File "G:\Drives compartilhados\SEG FIS\API\TELEGRAM BOT TEST\bot_test.py", line 151, in <module>
app.run()
File "C:\Users\roberto.lins\AppData\Roaming\Python\Python39\site-packages\pyrogram\methods\utilities\run.py", line 84, in run
self.start()
return loop.run_until_complete(coroutine)
File "C:\Program Files\Python39\lib\asyncio\base_events.py", line 642, in run_until_complete
return future.result()
File "C:\Users\roberto.lins\AppData\Roaming\Python\Python39\site-packages\pyrogram\methods\utilities\start.py", line 58, in start
is_authorized = await self.connect()
File "C:\Users\roberto.lins\AppData\Roaming\Python\Python39\site-packages\pyrogram\methods\auth\connect.py", line 40, in connect
await self.load_session()
File "C:\Users\roberto.lins\AppData\Roaming\Python\Python39\site-packages\pyrogram\client.py", line 586, in load_session
await Auth(
File "C:\Users\roberto.lins\AppData\Roaming\Python\Python39\site-packages\pyrogram\session\auth.py", line 254, in create
raise e
File "C:\Users\roberto.lins\AppData\Roaming\Python\Python39\site-packages\pyrogram\session\auth.py", line 89, in create
res_pq = await self.invoke(raw.functions.ReqPqMulti(nonce=nonce))
File "C:\Users\roberto.lins\AppData\Roaming\Python\Python39\site-packages\pyrogram\session\auth.py", line 67, in invoke
return self.unpack(response)
File "C:\Users\roberto.lins\AppData\Roaming\Python\Python39\site-packages\pyrogram\session\auth.py", line 60, in unpack
return TLObject.read(b)
File "C:\Users\roberto.lins\AppData\Roaming\Python\Python39\site-packages\pyrogram\raw\core\tl_object.py", line 33, in read
return cast(TLObject, objects[int.from_bytes(b.read(4), "little")]).read(b, *args)
KeyError: 0
Any help, please?