@@ -110,8 +110,65 @@ def PrGrpChat(Grpname):
110110 turn += 1
111111
112112 def NPuGrp ():
113- import GlobalChatGUI
114- GlobalChatGUI .main (str (name ))
113+ ngn = StringVar ()
114+ ngd = StringVar ()
115+ ngo = StringVar ()
116+ sb1 .destroy ()
117+ sl1 .destroy ()
118+ sl2 .destroy ()
119+ sl3 .destroy ()
120+ sl4 .destroy ()
121+ def submit ():
122+ GName = ngn .get ()
123+ Desc = ngd .get ()
124+ # username=userid.get()
125+ Origin = ngo .get ()
126+ myquery = {"Gname" : GName }
127+ mycol = mydb ["PublicChatGroups" ]
128+ mydoc = mycol .find (myquery )
129+ for x in mydoc :
130+ res = not bool (x )
131+ while not res :
132+ print ("Group with Same Name Already Exists" )
133+ NPuGrp ()
134+ mydict = {"GName" : GName ,
135+ "Desc" : Desc ,
136+ "Origin" : Origin ,
137+ "Owner" : name ,
138+ "Admins" : {
139+ "username" : [name ]
140+ },
141+ "Members" : {
142+ "username" : [{
143+ "username" : name ,
144+ }
145+ ]
146+ },
147+ "Chats" : [
148+ {
149+ "username" : name ,
150+ "Message" : "Booyahh! Welcome To My Own Public Group"
151+ }
152+ ]
153+ }
154+ temp = mycol .insert_one (mydict )
155+ from ChatBoxGUI import PublicChatGUI
156+ PublicChatGUI .main (GName , name )
157+ submit = Button (root1 ,command = submit , text = ' CreateGroup' , bg = color ["nero" ], fg = color ["orange" ], font = ('Malgun Gothic Semilight' , 25 , "bold" ), width = 500 , height = 100 , bd = 5 , image = login , compound = LEFT , anchor = "nw" )
158+ name_of_group = Entry (root1 , font = ('Malgun Gothic Semilight' , 25 , "bold" ), bd = 5 , textvariable = ngn )
159+ desc_of_group = Entry (root1 , font = ('Malgun Gothic Semilight' , 25 , "bold" ), bd = 5 , textvariable = ngd )
160+ origin_of_group = Entry (root1 , font = ('Malgun Gothic Semilight' , 25 , "bold" ), bd = 5 , textvariable = ngo )
161+ name_of_group1 = Label (root1 , text = 'Group Name' , width = 18 , height = 1 , font = ('Malgun Gothic Semilight' , 25 , "bold" ), bd = 5 )
162+ desc_of_group1 = Label (root1 , text = 'Description Of Group' , width = 18 , height = 1 , font = ('Malgun Gothic Semilight' , 25 , "bold" ), bd = 5 )
163+ origin_of_group1 = Label (root1 , text = 'Origin Of Group' , width = 18 , height = 1 , font = ('Malgun Gothic Semilight' , 25 , "bold" ), bd = 5 )
164+ canvas1 .create_window (300 , 585 , anchor = "nw" , window = submit )
165+ canvas1 .create_window (700 , 210 , anchor = "nw" , window = name_of_group )
166+ canvas1 .create_window (700 , 335 , anchor = "nw" , window = desc_of_group )
167+ canvas1 .create_window (100 , 210 , anchor = "nw" , window = name_of_group1 )
168+ canvas1 .create_window (700 , 460 , anchor = "nw" , window = origin_of_group )
169+ canvas1 .create_window (100 , 460 , anchor = "nw" , window = origin_of_group1 )
170+ canvas1 .create_window (100 , 335 , anchor = "nw" , window = desc_of_group1 )
171+
115172 def NPriGrp ():
116173 import GlobalChatGUI
117174 GlobalChatGUI .main (str (name ))
0 commit comments