Skip to content

Commit

Permalink
(#636): send messaage after bot unblock
Browse files Browse the repository at this point in the history
  • Loading branch information
ASTimch committed Aug 24, 2024
1 parent 55ad2e9 commit 9603b02
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/bot/handlers/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,21 @@ async def on_chat_member_update(
return None
if my_chat_member.new_chat_member.status == my_chat_member.new_chat_member.BANNED:
await user_service.bot_banned(user)
await procharity_api.send_user_bot_status(user)
return user
if my_chat_member.new_chat_member.status == my_chat_member.new_chat_member.MEMBER:
elif my_chat_member.new_chat_member.status == my_chat_member.new_chat_member.MEMBER:
await user_service.bot_unbanned(user)
await procharity_api.send_user_bot_status(user)
return user
await procharity_api.send_user_bot_status(user)
unblock_text = (
"<b>Вы разблокировали бот ProCharity</b>\n\n"
if user.is_volunteer
else "<b>Ты разблокировал бот ProCharity</b>\n\n"
)
await context.bot.send_message(
chat_id=effective_user.id,
text=unblock_text,
parse_mode=ParseMode.HTML,
disable_web_page_preview=True,
)
return user


def registration_handlers(app: Application):
Expand Down

0 comments on commit 9603b02

Please sign in to comment.