mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
Fix /diario not saving strings correctly
This commit is contained in:
parent
51b8deaa9c
commit
6af2698c42
1 changed files with 3 additions and 2 deletions
|
@ -249,8 +249,8 @@ def cmd_diario(bot: telegram.Bot, update: telegram.Update, session: db.Session):
|
|||
return
|
||||
try:
|
||||
text = update.message.text.split(" ", 1)[1]
|
||||
author = session.query(db.Telegram).filter_by(telegram_id=update.message.from_user.id).one_or_none()
|
||||
saver = author
|
||||
saver = session.query(db.Telegram).filter_by(telegram_id=update.message.from_user.id).one_or_none()
|
||||
author = None
|
||||
except IndexError:
|
||||
if update.message.reply_to_message is None:
|
||||
reply(bot, update, strings.DIARIO.ERRORS.INVALID_SYNTAX)
|
||||
|
@ -265,6 +265,7 @@ def cmd_diario(bot: telegram.Bot, update: telegram.Update, session: db.Session):
|
|||
return
|
||||
diario = db.Diario(timestamp=datetime.datetime.now(),
|
||||
saver=saver,
|
||||
author=author,
|
||||
text=text)
|
||||
session.add(diario)
|
||||
session.commit()
|
||||
|
|
Loading…
Reference in a new issue