def __activate(self, unused, entry, user, password, id): if entry.get_text() == str(self.__status['code']): from database import DataBase database = DataBase() database.add_user(user, password, id) if self.__set_default: database.default_user(user) self.destroy() return False entry.modify_base(gtk.STATE_NORMAL, gtk.gdk.color_parse('#FF8092')) if not self.__status['status']: entry.set_text('Re Send Code') elif entry.get_text() != str(self.__status['code']): entry.set_text('Incorrect Code') return False
def sign_up(): login = request.args.get('login') password = request.args.get('password') db = DataBase() # print(login, password) return jsonify([{"ticket": str(db.add_user(login, password))}])
def _start(update: Update, context: CallbackContext): user: User = update.message.from_user base = DataBase() result = base.get_user(f"{user.id}") if not result: base.add_user(f"{user.id}", user.first_name, user.last_name or "", user.username or "") else: _stop_dialog(update, context) base.close() keyboard = [["Начать диалог 🚀"]] markup = ReplyKeyboardMarkup(keyboard, resize_keyboard=True, one_time_keyboard=True) update.message.reply_text("Начните поиск собеседника", reply_markup=markup) return ConversationHandler.END