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
|
return
|
||||||
try:
|
try:
|
||||||
text = update.message.text.split(" ", 1)[1]
|
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 = session.query(db.Telegram).filter_by(telegram_id=update.message.from_user.id).one_or_none()
|
||||||
saver = author
|
author = None
|
||||||
except IndexError:
|
except IndexError:
|
||||||
if update.message.reply_to_message is None:
|
if update.message.reply_to_message is None:
|
||||||
reply(bot, update, strings.DIARIO.ERRORS.INVALID_SYNTAX)
|
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
|
return
|
||||||
diario = db.Diario(timestamp=datetime.datetime.now(),
|
diario = db.Diario(timestamp=datetime.datetime.now(),
|
||||||
saver=saver,
|
saver=saver,
|
||||||
|
author=author,
|
||||||
text=text)
|
text=text)
|
||||||
session.add(diario)
|
session.add(diario)
|
||||||
session.commit()
|
session.commit()
|
||||||
|
|
Loading…
Reference in a new issue