From 616b3cf3ab83052352d8497eb2f203ccc966ac09 Mon Sep 17 00:00:00 2001 From: Fabio De Simone Date: Mon, 28 Jan 2019 22:55:41 +0100 Subject: [PATCH] implemented anonyous check on /cerca --- telegrambot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telegrambot.py b/telegrambot.py index de173b76..e8ebb910 100644 --- a/telegrambot.py +++ b/telegrambot.py @@ -302,7 +302,7 @@ def cmd_search(bot: Bot, update: Update): entries = session.query(db.Diario).filter(db.Diario.text.ilike('%'+text+'%')).all() messageText = "Ecco i risultati della ricerca:\n" for entry in entries[:5]: - messageText+=f"[#{entry.id}](https://ryg.steffo.eu/diario#entry-{entry.id}) di {entry.author}\n{entry.text}\n\n" + messageText+=f"[#{entry.id}](https://ryg.steffo.eu/diario#entry-{entry.id}) di {entry.author if entry.author is not None else 'Anonimo'}\n{entry.text}\n\n" if len(entries)>5: messageText += "ci sono altre entrate del diario che corrispondono alla ricerca:\n" for entry in entries[5:]: