-
Notifications
You must be signed in to change notification settings - Fork 5
/
auto_profile.py
100 lines (70 loc) · 2.44 KB
/
auto_profile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import asyncio
import time
from telethon.errors import FloodWaitError
from telethon.tl import functions
from ULTRA.utils import edit_or_reply, admin_cmd
from ULTRA import ALIVE_NAME, CMD_HELP, BIO_MSG
DEFAULTUSERBIO = str(BIO_MSG) if BIO_MSG else "ʟɛɢɛռɖaʀʏ ᴀғ ɦɛʟʟɮօt"
DEL_TIME_OUT = 60
DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "Hell User"
@bot.on(admin_cmd(pattern="autoname")) # pylint:disable=E0602
async def _(event):
hell = await edit_or_reply(event, "`Starting AutoName Please Wait`")
if event.fwd_from:
return
while True:
HB = time.strftime("%d-%m-%y")
HE = time.strftime("%H:%M")
name = f"🕒{HE} ⚡{DEFAULTUSER}⚡ 📅{HB}"
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)
await hell.edit(f"Auto Name has been started my Master")
@bot.on(admin_cmd(pattern="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:%S")
bio = f"📅 {DMY} | {DEFAULTUSERBIO} | ⌚️ {HM}"
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)
CMD_HELP.update(
{
"auto_profile": "**Auto_Profile**\
\n\n**Syntax : **`.autobio`\
\n**Usage :** Change your bio with time\
\n\n**Syntax : **`.autoname`\
\n**Usage :** Change your Name With Time"
}
)