⌚️

⌚️


# For @UniBorg

# (c) Shrimadhav U K

"""Auto Profile Updation Commands

.autoname

.autobio"""

import asyncio

import time

from telethon.tl import functions

from telethon.errors import FloodWaitError

from uniborg.util import admin_cmd





DEL_TIME_OUT = 300





@borg.on(admin_cmd("autobio")) # pylint:disable=E0602

async def _(event):

if event.fwd_from:

return

while True:

DMY = time.strftime("%d.%m.%Y")

HM = time.strftime("%H:%M")

bio = f"{HM}🌿Solo Traveler🌱📅{DMY}"

logger.info(bio)

try:

await borg(functions.account.UpdateProfileRequest( # pylint:disable=E0602

about=bio

))

except FloodWaitError as ex:

logger.warning(str(e))

await asyncio.sleep(ex.seconds)

# else:

# logger.info(r.stringify())

# await borg.send_message( # pylint:disable=E0602

# Config.PRIVATE_GROUP_BOT_API_ID, # pylint:disable=E0602

# "Successfully Changed Profile Bio"

# )

await asyncio.sleep(DEL_TIME_OUT)





@borg.on(admin_cmd("autoname")) # pylint:disable=E0602

async def _(event):

if event.fwd_from:

return

while True:

DM = time.strftime("%d.%m.%y")

HM = time.strftime("%H:%M")

name = f"{HM}🌿Solo Traveler🌱📅{DMY}"

logger.info(name)

try:

await borg(functions.account.UpdateProfileRequest( # pylint:disable=E0602

first_name=name

))

except FloodWaitError as ex:

logger.warning(str(e))

await asyncio.sleep(ex.seconds)

# else:

# logger.info(r.stringify())

# await borg.send_message( # pylint:disable=E0602

# Config.PRIVATE_GROUP_BOT_API_ID, # pylint:disable=E0602

# "Successfully Changed Profile Name"

# )

await asyncio.sleep(DEL_TIME_OUT)

Report Page