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 = []
|
results = []
|
||||||
|
|
||||||
|
applications = jsonLoad(f"{configGet('data', 'locations')}{sep}applications.json")
|
||||||
|
|
||||||
for match in list_of_users:
|
for match in list_of_users:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
user_data = jsonLoad(f"{configGet('data', 'locations')}{sep}users{sep}{match.user.id}.json")
|
|
||||||
application_content = []
|
application_content = []
|
||||||
i = 1
|
i = 1
|
||||||
for question in configGet("application", file=str(match.user.id)):
|
for question in applications[str(match.user.id)]["application"]:
|
||||||
if i == 2:
|
if i == 2:
|
||||||
age = relativedelta(datetime.now(), datetime.strptime(configGet('application', file=str(match.user.id))['2'], '%d.%m.%Y'))
|
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')} {configGet('application', file=str(match.user.id))['2']} ({age.years} р.)")
|
application_content.append(f"{locale('question'+str(i), 'message', 'question_titles')} {applications[str(match.user.id)]['application']['2']} ({age.years} р.)")
|
||||||
else:
|
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
|
i += 1
|
||||||
|
except KeyError:
|
||||||
|
continue
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
continue
|
continue
|
||||||
except TypeError:
|
except TypeError:
|
||||||
|
Reference in New Issue
Block a user