1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00
This commit is contained in:
Steffo 2019-03-05 10:28:21 +01:00
parent a9b26008d3
commit 6e813e20c9

View file

@ -220,7 +220,7 @@ def cmd_balurage(bot: telegram.Bot, update: telegram.Update, session: db.Session
def parse_diario(session: db.Session, text: str): def parse_diario(session: db.Session, text: str):
match = re.match(r'"?(.*)"? (?:—|-{1,2}) ?@?([A-Za-z0-9_]+)$', text) match = re.match(r'"?(.*)"? (?:—|-{1,2}) ?@?([A-Za-z0-9_]+)$', text)
if match is None: if match is None:
return None return None, text
text_string = match.group(1) text_string = match.group(1)
author_string = match.group(2).lower() author_string = match.group(2).lower()
royal = session.query(db.Royal).filter(db.func.lower(db.Royal.username) == author_string).first() royal = session.query(db.Royal).filter(db.func.lower(db.Royal.username) == author_string).first()