-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPasswordUtils.py
More file actions
59 lines (46 loc) · 2.35 KB
/
PasswordUtils.py
File metadata and controls
59 lines (46 loc) · 2.35 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
58
59
from hikkatl.types import Message
from .. import loader, utils
import string, random
"""
███ ███ ██ ██ ██████ ██ ██ ██ ██████ ███████ ███████
████ ████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██ ████ ██ ██ ██ ██████ ██ ██ ██ ██ ██ ███████ █████
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██ ██ ██████ ██ ██ ██████ ███████ ██████ ███████ ███████
Module name
📜 Licensed under the GNU AGPLv3
"""
# meta desc: desc
# meta developer: @BruhHikkaModules
@loader.tds
class PasswordUtils(loader.Module):
"""Ваш помощник в безопасных паролях"""
strings = {"name": "PasswordUtils"}
@loader.command(ru_doc=" - [Пароль] - Проверить пароль на безопасность")
async def passwordchecker(self, message: Message):
"""- [Password] - Check the password for security"""
args = utils.get_args_raw(message)
symbols = "!@#$%^&*-+"
balls = 0
has_lower = any(c in args for c in string.ascii_lowercase)
has_upper = any(c in args for c in string.ascii_uppercase)
has_digit = any(c in args for c in string.digits)
has_symbol = any(c in args for c in symbols)
if has_lower:
balls += 1
if has_upper:
balls += 1
if has_digit:
balls += 1
if has_symbol:
balls += 1
await utils.answer(message, f"Balls: {balls}/4")
@loader.command(ru_doc=" - Генерация пароля")
async def passwordgen(self, message):
"""- Gen password"""
symbols = ["!", "@", "#", "$", "%", "^", "&", "*", "-", "+"]
letters = string.ascii_lowercase + string.ascii_uppercase
password = "".join(
random.choice(letters) + random.choice(symbols) for i in range(8)
)
await utils.answer(message, password)