version-0.2.2

This commit is contained in:
Untone 2024-01-07 14:52:30 +03:00
parent 84a7bc4057
commit ec82174dc9
2 changed files with 13 additions and 2 deletions

View File

@ -1,3 +1,8 @@
## [0.2.2]
- сообщает о новых заявках в FEEDBACK_CHAT
## [0.2.1]
- реорганизация кодовой базы

View File

@ -1,8 +1,10 @@
from bot.api import telegram_api
from bot.announce import show_announce
from bot.config import FEEDBACK_CHAT_ID
import logging
from utils.mention import mention
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO)
@ -12,11 +14,15 @@ announced_message = {
"ru": "Запрос на вступление опубликован в чате, как только вас узнают и отреагируют - она будет принята",
"en": "The join request is posted in the chat, once you are recognized and someone reacted to - it will be accepted"
}
async def handle_join_request(join_request):
logger.info(f"handle join request {join_request}")
user = join_request["from"]
lang = user.get("language_code", "ru")
lang = user.get("language_code", "ru")
# показываем для FEEDBACK_CHAT
await telegram_api("sendMessage", chat_id=FEEDBACK_CHAT_ID, text="новая заявка от " + mention(user))
# показываем анонс с заявкой
await show_announce(join_request)