ruffed
This commit is contained in:
@@ -9,10 +9,30 @@ logger = logging.getLogger(__name__)
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
|
||||
|
||||
positive_reactions = ["👍", "❤", "🔥", "🥰", "👏", "🎉", "🙏", "👌", "🕊", "😍", "❤🔥", "🍓", "🍾", "💋", "😇", "🤝", "🤗", "💘", "😘"]
|
||||
positive_reactions = [
|
||||
"👍",
|
||||
"❤",
|
||||
"🔥",
|
||||
"🥰",
|
||||
"👏",
|
||||
"🎉",
|
||||
"🙏",
|
||||
"👌",
|
||||
"🕊",
|
||||
"😍",
|
||||
"❤🔥",
|
||||
"🍓",
|
||||
"🍾",
|
||||
"💋",
|
||||
"😇",
|
||||
"🤝",
|
||||
"🤗",
|
||||
"💘",
|
||||
"😘",
|
||||
]
|
||||
announced_message = {
|
||||
"ru": "Запрос на вступление опубликован в чате, как только вас узнают и отреагируют - она будет принята",
|
||||
"en": "The join request is posted in the chat, once you are recognized and someone reacted to - it will be accepted"
|
||||
"en": "The join request is posted in the chat, once you are recognized and someone reacted to - it will be accepted",
|
||||
}
|
||||
|
||||
|
||||
@@ -22,12 +42,14 @@ async def handle_join_request(join_request):
|
||||
|
||||
lang = user.get("language_code", "ru")
|
||||
# показываем для FEEDBACK_CHAT
|
||||
await telegram_api("sendMessage", chat_id=FEEDBACK_CHAT_ID, text="новая заявка от " + mention(user))
|
||||
await telegram_api(
|
||||
"sendMessage", chat_id=FEEDBACK_CHAT_ID, text="новая заявка от " + mention(user)
|
||||
)
|
||||
# показываем анонс с заявкой
|
||||
await show_announce(join_request)
|
||||
|
||||
# сообщаем пользователю, что опубликовали анонс его заявки
|
||||
await telegram_api("sendMessage", chat_id=user['id'], text=announced_message[lang])
|
||||
await telegram_api("sendMessage", chat_id=user["id"], text=announced_message[lang])
|
||||
|
||||
|
||||
async def handle_reaction_on_request(update):
|
||||
@@ -39,5 +61,7 @@ async def handle_reaction_on_request(update):
|
||||
new_reaction = reaction.get("new_reaction")
|
||||
if new_reaction.get("emoji") in positive_reactions:
|
||||
# за пользователя поручились
|
||||
r = await telegram_api("approveChatJoinRequest", chat_id=chat_id, user_id=from_id)
|
||||
r = await telegram_api(
|
||||
"approveChatJoinRequest", chat_id=chat_id, user_id=from_id
|
||||
)
|
||||
logger.debug(r)
|
||||
|
Reference in New Issue
Block a user