1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-24 03:54:20 +00:00

a tiny fix

This commit is contained in:
Steffo 2018-10-11 23:46:47 +02:00
parent 69176f60c5
commit ee354d3b45
2 changed files with 9 additions and 1 deletions

View file

@ -572,6 +572,7 @@ class RoyalDiscordBot(discord.Client):
halloween = await loop.run_in_executor(executor, session.query(db.Halloween) halloween = await loop.run_in_executor(executor, session.query(db.Halloween)
.filter_by(royal=enqueuer.royal) .filter_by(royal=enqueuer.royal)
.one_or_none) .one_or_none)
if halloween is not None:
halloween[5] = datetime.datetime.now() halloween[5] = datetime.datetime.now()
# END # END
await loop.run_in_executor(executor, session.commit) await loop.run_in_executor(executor, session.commit)

View file

@ -373,6 +373,13 @@ def ses_identify():
royal = db_session.query(db.Royal).filter_by(id=fl_session.get("user_id")).one_or_none() royal = db_session.query(db.Royal).filter_by(id=fl_session.get("user_id")).one_or_none()
halloween = db_session.query(db.Halloween).filter_by(royal=royal).one_or_none() halloween = db_session.query(db.Halloween).filter_by(royal=royal).one_or_none()
if halloween is None: if halloween is None:
if not fl_g.event_started:
try:
telegram_bot.send_message(config["Telegram"]["main_group"],
f"💀 <b>Che le settimane dello spavento abbiano inizio!</b>",
parse_mode="HTML", disable_web_page_preview=True)
except Exception:
pass
halloween = db.Halloween(royal=royal, first_trigger=datetime.datetime.now()) halloween = db.Halloween(royal=royal, first_trigger=datetime.datetime.now())
db_session.add(halloween) db_session.add(halloween)
db_session.commit() db_session.commit()