Skip to content

Commit

Permalink
Fixing some users not being able to join upon confirmation (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
why-not-try-calmer authored Apr 17, 2023
1 parent fc72646 commit 676dbb2
Showing 1 changed file with 17 additions and 20 deletions.
37 changes: 17 additions & 20 deletions app/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ async def extractor_closure(answers: list[str]) -> None:

tasks = set()


async def replying_to_bot(update: Update, context: ContextTypes.DEFAULT_TYPE):
# Taking advantage of the fact that even with privacy mode off
# the bot will be handed over all replies
Expand Down Expand Up @@ -285,27 +286,23 @@ async def processing_cbq(update: Update, context: ContextTypes.DEFAULT_TYPE):

# Auto mode
if operation == "self-confirm":
await gather(
context.bot.send_message(
update.callback_query.from_user.id,
f"Thanks, you are welcome to join {chat_url}. {strings['has_joined']['post_join']}",
disable_web_page_preview=True,
),
context.bot.answer_callback_query(update.callback_query.id),
await context.bot.answer_callback_query(update.callback_query.id)
await context.bot.send_message(
update.callback_query.from_user.id,
f"Thanks, you are welcome to join {chat_url}. {strings['has_joined']['post_join']}",
disable_web_page_preview=True,
)
await gather(
context.bot.approve_chat_join_request(
chat_id_str, update.callback_query.from_user.id
),
log(
UserLog(
"has_verified",
update.callback_query.from_user.id,
update.callback_query.from_user.id,
update.callback_query.from_user.username
or update.callback_query.from_user.first_name,
)
),
await context.bot.approve_chat_join_request(
chat_id_str, update.callback_query.from_user.id
)
await log(
UserLog(
"has_verified",
update.callback_query.from_user.id,
update.callback_query.from_user.id,
update.callback_query.from_user.username
or update.callback_query.from_user.first_name,
)
)
return

Expand Down

0 comments on commit 676dbb2

Please sign in to comment.