Import source: set_pfp
Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality.
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
|||||||
|
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())
|
||||||
Reference in New Issue
Block a user