Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality.
20 lines
595 B
Python
20 lines
595 B
Python
import asyncio, os
|
|
from dotenv import load_dotenv
|
|
from pyrogram import Client
|
|
|
|
load_dotenv()
|
|
app = Client("gdrive_bot", api_id=int(os.getenv("API_ID")),
|
|
api_hash=os.getenv("API_HASH"), bot_token=os.getenv("BOT_TOKEN"))
|
|
|
|
async def main():
|
|
async with app:
|
|
me = await app.get_me()
|
|
print("Bot:", me.username, "| id:", me.id)
|
|
try:
|
|
await app.set_profile_photo(photo="bot_pfp.jpg")
|
|
print("RESULT: set_profile_photo OK")
|
|
except Exception as e:
|
|
print("RESULT: FAILED ->", type(e).__name__, str(e))
|
|
|
|
asyncio.run(main())
|