Fixed questions source for inline
This commit is contained in:
parent
9105a0266c
commit
fd858afcfd
@ -33,19 +33,22 @@ async def inline_answer(client, inline_query):
|
||||
|
||||
results = []
|
||||
|
||||
applications = jsonLoad(f"{configGet('data', 'locations')}{sep}applications.json")
|
||||
|
||||
for match in list_of_users:
|
||||
|
||||
try:
|
||||
user_data = jsonLoad(f"{configGet('data', 'locations')}{sep}users{sep}{match.user.id}.json")
|
||||
application_content = []
|
||||
i = 1
|
||||
for question in configGet("application", file=str(match.user.id)):
|
||||
for question in applications[str(match.user.id)]["application"]:
|
||||
if i == 2:
|
||||
age = relativedelta(datetime.now(), datetime.strptime(configGet('application', file=str(match.user.id))['2'], '%d.%m.%Y'))
|
||||
application_content.append(f"{locale('question'+str(i), 'message', 'question_titles')} {configGet('application', file=str(match.user.id))['2']} ({age.years} р.)")
|
||||
age = relativedelta(datetime.now(), datetime.strptime(applications[str(match.user.id)]['application']['2'], '%d.%m.%Y'))
|
||||
application_content.append(f"{locale('question'+str(i), 'message', 'question_titles')} {applications[str(match.user.id)]['application']['2']} ({age.years} р.)")
|
||||
else:
|
||||
application_content.append(f"{locale('question'+str(i), 'message', 'question_titles')} {configGet('application', file=str(match.user.id))[question]}")
|
||||
application_content.append(f"{locale('question'+str(i), 'message', 'question_titles')} {applications[str(match.user.id)]['application'][question]}")
|
||||
i += 1
|
||||
except KeyError:
|
||||
continue
|
||||
except FileNotFoundError:
|
||||
continue
|
||||
except TypeError:
|
||||
|
Reference in New Issue
Block a user