Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
elizaveta-andreeva committed Nov 2, 2023
1 parent a89e169 commit 846d988
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
16 changes: 4 additions & 12 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,7 @@ def start(update: Update, context: CallbackContext) -> str:

dialog(
update,
text=_('Привет! Я бот, который поможет тебе отрефлексировать твое настроение'),
reply_markup=menu_kyeboard()
)

dialog(
update,
text=_('В какое время тебе удобно подводить итоги дня?'),
reply_markup=daily_schedule_keyboard()
text=_('Здравствуйте! Я бот-психолог. Как можно обращаться к вам?')
)


Expand All @@ -101,7 +94,6 @@ def button(update: Update, context: CallbackContext) -> str:

user = init_user(update.effective_user)
set_last_usage(user)

if query.data.startswith('s_'):
handle_schedule(update, query)
elif query.data.startswith('f_'):
Expand All @@ -120,7 +112,7 @@ def button(update: Update, context: CallbackContext) -> str:
handle_questions(update, user, query)
return ''


def handle_schedule(update, query):
# User entered schedule
text = _('Ты выбрал ') + VALUES[query.data] + _(' в качестве времени для рассылки. Спасибо!')
Expand All @@ -138,7 +130,7 @@ def handle_focus(update, context, query):
push_user_focus(update.effective_user, query.data, update.effective_message.date)
return engine_callback(update, context)


def handle_ready(update, context, query):
if query.data == 'r_yes':
return engine_callback(update, context)
Expand All @@ -148,7 +140,7 @@ def handle_ready(update, context, query):
set_user_ready_flag(update.effective_user, True)
return ''


def handle_pronoun(update, user, query):
if query.data == 'p_u':
push_user_pronoun(user, False)
Expand Down
4 changes: 2 additions & 2 deletions db.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ def push_user_mode(user, mode):
db_user.preferences.append({"voice mode": mode})
db_user.save()


def change_user_mode(user):
db_user = init_user(user)
for preference in db_user.preferences:
Expand Down Expand Up @@ -375,7 +375,7 @@ def push_user_pronoun(user, pronoun):
db_user.preferences.append({"pronoun": pronoun})
db_user.save()


def get_user_audio(user):
progress = list(SurveyProgress.objects.values().all())
file_storage = gridfs.GridFSBucket(_get_db())
Expand Down

0 comments on commit 846d988

Please sign in to comment.