Properly answer callbacks

This commit is contained in:
Sijmen 2017-11-10 18:58:50 +01:00
parent 4e321ca0f7
commit e78619025f
1 changed files with 4 additions and 2 deletions

6
app.py
View File

@ -254,6 +254,8 @@ async def cmd_actie(message):
async def callback_status(query, _, args): async def callback_status(query, _, args):
await query.answer()
token = USER_TOKENS.get(query.from_user.id) token = USER_TOKENS.get(query.from_user.id)
if not token: if not token:
msg = messages.stranger_message(message.from_user.first_name) msg = messages.stranger_message(message.from_user.first_name)
@ -279,10 +281,11 @@ async def callback_status(query, _, args):
await query.message.edit(msg, parse_mode='HTML', await query.message.edit(msg, parse_mode='HTML',
reply_markup=json.dumps(reply_markup), reply_markup=json.dumps(reply_markup),
disable_web_page_preview=True) disable_web_page_preview=True)
await query.answer()
async def callback_tasks(query, _, args): async def callback_tasks(query, _, args):
await query.answer()
token = USER_TOKENS.get(query.from_user.id) token = USER_TOKENS.get(query.from_user.id)
if not token: if not token:
msg = messages.stranger_message(message.from_user.first_name) msg = messages.stranger_message(message.from_user.first_name)
@ -291,7 +294,6 @@ async def callback_tasks(query, _, args):
group_id = VIA_GROUPS.get(query.message.chat.id) group_id = VIA_GROUPS.get(query.message.chat.id)
if not group_id: if not group_id:
await query.answer()
return return
user_id = int(args[0]) user_id = int(args[0])