I’m getting an invalid PeerId when trying to send messages to a group with a bot, but it’s telling me that the PeerID is invalid.
The group has the bot added and all permissions guaranteed, in addition to the PeerID being revised in several ways.
from os import getenv
from dotenv import load_dotenv
from pyrogram import Client
from asyncio import run
dotenv_path = 'C:\Users\zez\Documents\projects\FXAqulia\robot\botenv.env'
load_dotenv(dotenv_path=dotenv_path)
app = Client(
'FX_Aquila_bot',
api_id=getenv('TELEGRAM_API_ID'),
api_hash=getenv('TELEGRAM_API_HASH'),
bot_token=getenv('TELEGRAM_BOT_TOKEN'),
)
async def main():
await app.start()
chatid = -1002195442977
await app.send_message(chatid, 'teste')
await app.stop()
run(main())
ValueError: Peer id invalid: -1002195442977