Skip to content

Commit

Permalink
Merge pull request #50 from milselarch/feat/prompt_dm_votes
Browse files Browse the repository at this point in the history
fix: use VOTE_VIA_DM CallbackCommand in Vote via Direct Chat button
  • Loading branch information
milselarch authored Nov 29, 2024
2 parents 9201782 + 66c17ee commit aefc9cf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion base_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ def build_group_vote_markup(
markup_rows.append([
cls.spawn_inline_keyboard_button(
text='Vote via Direct Chat',
command=CallbackCommands.REGISTER_OR_SUBMIT,
command=CallbackCommands.VOTE_VIA_DM,
callback_data=dict(poll_id=poll_id)
)
])
Expand Down
5 changes: 4 additions & 1 deletion handlers/inline_keyboard_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,7 @@ async def handle_queries(
poll_locks_manager=_poll_locks_manager
))
else:
# TODO: this shouldn't happen
return await query.answer(BaseAPI.reg_status_to_msg(
register_status, poll_id
))
Expand Down Expand Up @@ -737,8 +738,10 @@ async def send_dm(text, markup: Optional[ReplyMarkup] = None):
resp = f"{resp_header} - start the bot to cast your vote"
return await query.answer(resp)

coroutine = query.answer(resp_header)
resp = f"{resp_header} - poll info has been sent via DM"
coroutine = query.answer(resp)
coroutines.append(coroutine)

poll_message = BaseAPI.generate_poll_message(
poll_info=poll_info, bot_username=bot_username,
add_instructions=False
Expand Down
2 changes: 1 addition & 1 deletion helpers/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from helpers.commands import Command

__VERSION__ = '1.3.4'
__VERSION__ = '1.3.5'

READ_SUBSCRIPTION_TIER_FAILED = "Unexpected error reading subscription tier"
POLL_OPTIONS_LIMIT_REACHED_TEXT = textwrap.dedent(f"""
Expand Down

0 comments on commit aefc9cf

Please sign in to comment.