-
Notifications
You must be signed in to change notification settings - Fork 1
/
sender.pyw
55 lines (49 loc) · 1.63 KB
/
sender.pyw
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
from tkinter import CENTER,Text,Button,messagebox
import modules as md
import tkinter as tk
import json,sys
try:
if sys.argv[1] != "e4oyBHK7YPBj7Tvj":
sys.exit()
except:
sys.exit()
# Conf & styling
root = tk.Tk()
root.geometry('840x230')
root.configure(bg="black")
root.title('28P - Chat :: Your Msg Input')
root.resizable(width=False, height=False)
heading = tk.Label(root, text="28P - Chat",bg="black",fg="white")
heading.config(font=("Courier", 22))
heading.config(anchor=CENTER)
heading.pack()
msgL = tk.Label(root, text="Enter Your Message",bg="black",fg="white")
msgL.config(font=("Courier", 14),anchor=CENTER)
msgL.pack()
msg = Text(root, height=5, width=66,font=("Courier", 14))
msg.pack()
def sendT():
try:config = json.loads(md.ConfigFile().GetConfig())
except:config = md.ConfigFile().GetConfig()
msgContent = msg.get(1.0,'end')
if config['peerHost'] == "":
messagebox.showinfo("Error",
"""
there's no messages from peer to save him host,\n
And you also did not set peer host .\n
so please set peer host use : \n
run.py --peer-host \n
example :\n
run --peer-host "facebookcorewwwi"\n
set it without http:// & .onion\n""")
md._all().SendMsg(msgContent)
openMsgFile = open('msg.json','r')
msgFile = json.loads(openMsgFile.read())
openMsgFile.close()
msgFile['me'] = msgContent
setOld = open('msg.json','w')
setOld.write(json.dumps(msgFile))
setOld.close()
send = Button (root,activebackground='green',bg="purple",height=5, width=10,anchor=CENTER,text="Send",fg="white",command=lambda:sendT())
send.pack(pady=8)
root.mainloop()