0.0.12-fixes
This commit is contained in:
@@ -14,23 +14,33 @@ def construct_unlink_buttons(actor):
|
||||
'text': f'{identity} {username}',
|
||||
'callback_data': 'unlink' + vouch
|
||||
})
|
||||
return { "inline_keyboard": [ buttons, ] }
|
||||
return buttons
|
||||
|
||||
|
||||
def handle_command_my(msg):
|
||||
print(f'handle my command')
|
||||
def handle_command_my(msg, state):
|
||||
print('handle my command')
|
||||
from_id = str(msg['from']['id'])
|
||||
sender = Profile.get(from_id, msg)
|
||||
|
||||
handle_command_owner_my(msg)
|
||||
|
||||
# генерируем кнопки для всех, за кого поручились
|
||||
reply_markup = construct_unlink_buttons(sender)
|
||||
|
||||
if msg['from'].get('language_code', 'ru') == 'ru':
|
||||
body = 'Нажмите кнопки ниже, чтобы удалить ваши связи'
|
||||
buttons = construct_unlink_buttons(sender)
|
||||
reply_markup = { "inline_keyboard": [ buttons, ] }
|
||||
if len(buttons) == 0:
|
||||
if msg['from'].get('language_code', 'ru') == 'ru':
|
||||
body = 'Вас ещё никто не узнал? Напишите, я передам нашему кругу'
|
||||
else:
|
||||
body = 'Nobody recognized you? Speak, I will pass your message to the circle'
|
||||
r = send_message(from_id, body)
|
||||
print(r)
|
||||
chat_id = msg['chat']['id']
|
||||
state.make_talking(from_id, chat_id)
|
||||
else:
|
||||
body = 'Unlink your connections pressing the buttons below'
|
||||
if msg['from'].get('language_code', 'ru') == 'ru':
|
||||
body = 'Нажмите кнопки ниже, чтобы удалить ваши связи'
|
||||
else:
|
||||
body = 'Unlink your connections pressing the buttons below'
|
||||
|
||||
r = send_message(from_id, body, reply_markup=reply_markup)
|
||||
print(r)
|
||||
@@ -47,7 +57,7 @@ def handle_command_owner_my(msg):
|
||||
break
|
||||
if owner_id:
|
||||
owner = Profile.get(owner_id, msg)
|
||||
uids, members = scan()
|
||||
_uids, members = scan()
|
||||
for mdata in members:
|
||||
m = json.loads(mdata.decode('utf-8'))
|
||||
if owner_id in m['parents']:
|
||||
|
Reference in New Issue
Block a user