mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-27 13:34:28 +00:00
implemented anonyous check on /cerca
This commit is contained in:
parent
8cdbb05eaf
commit
616b3cf3ab
1 changed files with 1 additions and 1 deletions
|
@ -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:]:
|
||||
|
|
Loading…
Reference in a new issue