-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcli.py
65 lines (58 loc) · 1.95 KB
/
cli.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
from pyfiglet import Figlet
f = Figlet(font='slant')
from PyInquirer import style_from_dict, Token, prompt, Separator
from PyInquirer import Validator, ValidationError
print(f.renderText('Whatsapp -\nspammer'))
print('''
********************************************************
* *
* Author: TH3-MA3STRO *
* Instagtam: @th3_MA3STRO *
* GitHub: https://www.github.com/TH3-MA3STRO *
* Platform: Windows *
* *
********************************************************
''')
class NumberValidator(Validator):
def validate(self, document):
try:
int(document.text)
except ValueError:
raise ValidationError(
message='Please enter a number',
cursor_position=len(document.text)) # Move cursor to end
def styler():
style = style_from_dict({
Token.Separator: '#cc5454',
Token.QuestionMark: '#673ab7 bold',
Token.Selected: '#cc5454', # default
Token.Pointer: '#673ab7 bold',
Token.Instruction: '', # default
Token.Answer: '#f44336 bold',
Token.Question: '',
})
return style
def que1():
questions = [
{
'type': 'list',
'message': 'Select the type of chat:',
'name': 'tch',
'choices': [
{
'name': 'Group'
},
{
'name': 'Contact'
}
]
},
{
'type': 'input',
'message': 'Enter the Numer of messages you wish to spam:',
'name': 'num',
'validate': NumberValidator
}
]
answers = prompt(questions, style=styler())
return answers