fixed stuck in memory function. implemented random memory
This commit is contained in:
		| @@ -30,7 +30,6 @@ class MemoryHandler(BaseHandler): | ||||
|  | ||||
|         search_string = " ".join(context.args) | ||||
|  | ||||
|  | ||||
|         if search_string == '~photo': | ||||
|             matching_models = self.models.JournalEntry.select().where(self.models.JournalEntry.media_path != "").order_by(self.models.JournalEntry.date) | ||||
|         else: # searching for text | ||||
| @@ -40,7 +39,12 @@ class MemoryHandler(BaseHandler): | ||||
|                 ) | ||||
|             ).order_by(self.models.JournalEntry.date) | ||||
|  | ||||
|          | ||||
|  | ||||
|         # exit if no memory matches the string | ||||
|         if len(matching_models) == 0: | ||||
|             await update.message.reply_text(f"There is no matching memory yet.") | ||||
|             return ConversationHandler.END | ||||
|  | ||||
|         options = [[InlineKeyboardButton(m.date_pretty, callback_data=i)] for i,m in enumerate(matching_models)] | ||||
|  | ||||
|         keyboard = InlineKeyboardMarkup(options) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Lia Schöneweiß
					Lia Schöneweiß