Skip to content
This repository has been archived by the owner on Mar 13, 2023. It is now read-only.

Commit

Permalink
Hotfix (#13)
Browse files Browse the repository at this point in the history
* direction fix

* direction fix
  • Loading branch information
mixx3 authored Nov 7, 2022
1 parent 7937840 commit fafa873
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion bot/event_scenarios/registry/event_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,20 @@ def on_year_ans(vk: VkApiMethod, event: Event) -> None:
)


def on_discard_direction(vk: VkApiMethod, event: Event):
kb = VkKeyboard(one_time=False, inline=True)

for i in range(len(directions)):
kb.add_button(directions[i].name)
if i + 1 < len(directions):
kb.add_line()
utils.send_message(
vk,
event.user_id,
message=dedent(reactions.Registry.DIRECTION_QUESTION),
keyboard=kb.get_keyboard(),
)

def on_direction_ans(vk: VkApiMethod, event: Event):
db_id = 1
for d in directions:
Expand Down Expand Up @@ -111,7 +125,7 @@ def on_approve(vk: VkApiMethod, event: Event):
redis_db.hdel(event.user_id,
"direction_id"
)
on_year_ans(vk, event)
on_discard_direction(vk, event)


def on_about(vk: VkApiMethod, event: Event):
Expand Down

0 comments on commit fafa873

Please sign in to comment.