-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCopyUser.py
106 lines (97 loc) · 4.14 KB
/
CopyUser.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
101
102
103
104
105
106
# .------.------.------.------.------.------.------.------.------.------.
# |D.--. |4.--. |N.--. |1.--. |3.--. |L.--. |3.--. |K.--. |0.--. |0.--. |
# | :/\: | :/\: | :(): | :/\: | :(): | :/\: | :(): | :/\: | :/\: | :/\: |
# | (__) | :\/: | ()() | (__) | ()() | (__) | ()() | :\/: | :\/: | :\/: |
# | '--'D| '--'4| '--'N| '--'1| '--'3| '--'L| '--'3| '--'K| '--'0| '--'0|
# `------`------`------`------`------`------`------`------`------`------'
#
# Copyright 2023 t.me/D4n13l3k00
# Licensed under the Creative Commons CC BY-NC-ND 4.0
#
# Full license text can be found at:
# https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode
#
# Human-friendly one:
# https://creativecommons.org/licenses/by-nc-nd/4.0
# meta developer: @D4n13l3k00
from asyncio import sleep
from telethon import functions
from telethon.tl.functions.account import UpdateProfileRequest
from telethon.tl.functions.users import GetFullUserRequest
from .. import loader, utils # type: ignore
@loader.tds
class CuMod(loader.Module):
"""Полное копирование юзера(ава, имя|фамилия, био)"""
strings = {"name": "CopyUser"}
@loader.owner
async def cucmd(self, message):
""".cu <s> <a> <reply/@username>
<s> - Скрытый режим
<a> - Удалить ваши аватарки
Аргументы после юзера не указывайте, не скушает
Примеры:
.cu s @user/reply
.cu a @user/reply
.cu s a @user/reply"""
reply = await message.get_reply_message()
user = None
s = False
a = False
if utils.get_args_raw(message):
args = utils.get_args_raw(message).split(" ")
for i in args:
if i.lower() == "s":
s = True
elif i.lower() in ["а", "a"]:
a = True
else:
try:
user = await message.client.get_entity(i)
break
except Exception:
continue
if user is None and reply is not None:
user = reply.sender
if user is None and reply is None:
if not s:
await message.edit("Кого?")
return
if s:
await message.delete()
if not s:
for i in range(11):
await message.edit(
f"Получаем доступ к аккаунту пользователя [{i*10}%]\n[{(i*'#').ljust(10, '–')}]"
)
await sleep(0.3)
if a:
avs = await message.client.get_profile_photos("me")
if len(avs) > 0:
await message.client(
functions.photos.DeletePhotosRequest(
await message.client.get_profile_photos("me")
)
)
full = await message.client(GetFullUserRequest(user.id))
if not s:
await message.edit("Получаем аватарку... [35%]\n[###–––––––]")
if full.profile_photo:
up = await message.client.upload_file(
await message.client.download_profile_photo(user, bytes)
)
if not s:
await message.edit("Ставим аватарку... [50%]\n[#####–––––]")
await message.client(functions.photos.UploadProfilePhotoRequest(up))
if not s:
await message.edit("Получаем данные... [99%]\n[#########–]")
await message.client(
UpdateProfileRequest(
user.first_name if user.first_name is not None else "",
user.last_name if user.last_name is not None else "",
full.about[:70] if full.about is not None else "",
)
)
if not s:
await message.edit("Аккаунт клонирован! [100%]\n[##########]")
await sleep(5)
await message.edit("Аккаунт клонирован!")