-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathdata.py
57 lines (41 loc) · 1.31 KB
/
data.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
import pyfiglet
print("\n")
banner = pyfiglet.figlet_format("WELCOME")
print(banner)
def change():
r=open("data.txt",'r')
d=eval(r.readline())
r.close()
token=d['token']
print("++++++++++++++++++++++++++++")
i = input("\nEnter new token (or enter 0 if you dont wanna change previous token): ")
if(i!='0'):
token=i
tag = input("\nEnter group chat tag with @ or Enter id: ")
msg =input("\nEnter a message you want to get added in the end of the Tech News (like your channel name or link, if you don't want then just put a space): ")
d["token"]=token
d["tag"]=tag
d["msg"]=msg
f=open("data.txt",'w')
f.write(str(d))
print("\nToken and chat link/tag and msg saved !")
print("++++++++++++++++++++++++++++")
f.close()
def display():
r=open("data.txt",'r')
print("\n××××××××××××××××××××××××××××")
print("Current Token and chat link/tag and message:-")
print(r.readline())
print("××××××××××××××××××××××××××××")
r.close()
while(True):
print("\n--------x-------------------x-----")
ch=input("1 to change token & chat tag/id & message\n2 to read current token & chat tag/id & message\n0 for exit\nEnter Choice: ")
if(ch=="1"):
change()
elif(ch=="2"):
display()
elif(ch=="0"):
break
else:
print("\nIncorrect Choice!! Enter again -\n")