-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuserstatus.py
More file actions
57 lines (50 loc) · 1.84 KB
/
userstatus.py
File metadata and controls
57 lines (50 loc) · 1.84 KB
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
# Module by DeCoded
# EW: https://endway.su/@decoded
# TG: https://t.me/whynothacked
# Канал с модулями: https://t.me/DeBot_userbot
from telethon import events
from telethon.tl.functions.account import UpdateProfileRequest
from userbot import client
info = {'category': 'chat', 'pattern': '.afk|.work', 'description': 'Плашка AFK в нике|Плашка WORK в нике'}
@client.on(events.NewMessage(outgoing=True, pattern='.afk'))
async def afk(event):
if event.fwd_from:
return
me = await event.client.get_me()
first_name = me.first_name
second_name = me.last_name
if '[AFK] ' not in first_name:
first_name = f'[AFK] {first_name}'
await client(UpdateProfileRequest(
first_name=first_name,
last_name=second_name
))
await event.edit('🛑 AFK статус активен')
else:
first_name = first_name.replace('[AFK] ', '')
await client(UpdateProfileRequest(
first_name=first_name,
last_name=second_name
))
await event.edit('🛑 AFK статус выключен')
@client.on(events.NewMessage(outgoing=True, pattern='.work'))
async def afk(event):
if event.fwd_from:
return
me = await event.client.get_me()
first_name = me.first_name
second_name = me.last_name
if '[WORK] ' not in first_name:
first_name = f'[WORK] {first_name}'
await client(UpdateProfileRequest(
first_name=first_name,
last_name=second_name
))
await event.edit('🟢 WORK статус активен')
else:
first_name = first_name.replace('[WORK] ', '')
await client(UpdateProfileRequest(
first_name=first_name,
last_name=second_name
))
await event.edit('🟢 WORK статус выключен')