-
Notifications
You must be signed in to change notification settings - Fork 0
/
dqlshell.py
43 lines (34 loc) · 1.05 KB
/
dqlshell.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
import os
import ctypes
from dql.parse import parse
from dql.errors import ParseError
import sys
ctypes.windll.kernel32.SetConsoleTitleW("DQL Shell")
__version__ = 0.1
os.system("cls")
token = input("Enter token: ")
os.system("cls")
print(f"DQL ({__version__})")
print("Type 'HELP' for help.")
print("\n")
while True:
try:
cmd = input("dql > ")
parsed = parse(cmd)
if cmd.upper() == "HELP":
print("You are using dql, the command-line interface for using the Discord API.")
else:
parsed = parse(cmd)
pass
except (KeyboardInterrupt, ParseError, Exception) as err:
if isinstance(err, KeyboardInterrupt):
ans = input("\nAre you sure you want to quit? (Y/n) ")
if ans.lower() == "y":
os.system("cls")
sys.exit(0)
else:
pass
elif isinstance(err, ParseError):
print(f"Parser ERROR: {err}")
else:
print(f"Unknown ERROR: {err}")