def startChat(self, *participants): new_chat = Chat(self) new_chat.add_participants(*participants) if new_chat.participants: new_chat.printChat() else: print("Участники не добавлены")
def startChat(self, *participants): rows = self.getContacts() contacts = [] for row in rows: contacts.append(row[0]) new_chat = Chat(self) new_chat.add_participants(contacts) return new_chat.id
def startChat(self, *participants): new_chat = Chat(self) new_chat.add_participants(*participants) if new_chat.add_participants(*participants): all_participants = [x for x in participants] all_participants.append(self) while True: new_chat.printChat() curr_participant = 0 curr_participant = int( input("Введите номер участника: {} для {}\n".format( [x for x in range(len(all_participants))], [x.name for x in all_participants]))) new_message = input( "Введите сообщение от имени {} или X для выхода из чата\n". format(all_participants[curr_participant].name)) if new_message != 'X': new_chat.addMessage(all_participants[curr_participant], new_message) else: break else: print("Участники не добавлены")
def startChat(self, *participants): contacts = [x for x in participants] new_chat = Chat(self) new_chat.save() new_chat.add_participants(contacts) return new_chat.id