From adc8c83102261f51e581a3a7784abeb547e8954a Mon Sep 17 00:00:00 2001 From: profitroll Date: Mon, 23 Jan 2023 11:15:26 +0100 Subject: [PATCH] Closes #13 --- locale/en.disabled | 3 --- locale/uk.json | 3 --- modules/callbacks/sub.py | 17 ----------------- modules/handlers/confirmation.py | 3 --- 4 files changed, 26 deletions(-) diff --git a/locale/en.disabled b/locale/en.disabled index a93f3b5..3f4a79d 100644 --- a/locale/en.disabled +++ b/locale/en.disabled @@ -31,7 +31,6 @@ "approved_joined": "Congratulations! Your application has been reviewed and confirmed as correct. Thank you for your time and have a nice day!", "read_rules": "Please read these rules before clicking the button and joining the chat.", "rejected.": "Oh dear! Your application has been reviewed but not confirmed as eligible to join the community. Better luck next time!\n\nYou can try to reapply with the /reapply command.", - "rejected_aggressive": "Oh dear! Your application has been reviewed, but not confirmed as eligible to join the community.", "rejected_russian": "Russian warship, go fuck yourself!", "approved_by": "✅ **Application approved**\nAdmin **{0}** has reviewed and approved application `{1}`.", "rejected_by": "❌ **Form rejected**\nAdmin **{0}** has reviewed and rejected form `{1}`.", @@ -122,7 +121,6 @@ "button": { "sub_yes": "✅ Accept", "sub_no": "❌ Reject", - "sub_aggressive": "🤡 Reject (Toxic)", "sub_russian": "🇷🇺 Reject (Russian)", "accepted": "✅ Accepted", "declined": "❌ Rejected", @@ -145,7 +143,6 @@ "callback": { "sub_accepted": "✅ Application {0} has been approved", "sub_rejected": "❌ Application {0} rejected", - "sub_aggressive": "🤡 Application {0} rejected", "sub_russian": "🇷🇺 Application {0} rejected", "sus_allowed": "✅ Access {0} allowed", "sus_rejected": "❌ Access {0} denied", diff --git a/locale/uk.json b/locale/uk.json index 1221ec1..eea358a 100644 --- a/locale/uk.json +++ b/locale/uk.json @@ -48,7 +48,6 @@ "approved_joined": "Вітаємо! Твою анкету переглянули та підтвердили її правильність. Дякуємо за витрачений на заповнення час та гарного дня!", "read_rules": "Будь ласка, прочитай ці правила перш ніж натискати на кнопку та приєднуватись до чату.", "rejected": "Ой лишенько! Твою анкету переглянули, однак не підтвердили право на вступ до спільноти. Better luck next time!\n\nТи можеш спробувати повторно заповнити анкету командою /reapply", - "rejected_aggressive": "Ой лишенько! Твою анкету переглянули, однак не підтвердили право на вступ до спільноти.", "rejected_russian": "русский военньій корабль, иди нахуй!", "approved_by": "✅ **Анкету схвалено**\nАдмін **{0}** переглянув та схвалив анкету `{1}`.", "rejected_by": "❌ **Анкету відхилено**\nАдмін **{0}** переглянув та відхилив анкету `{1}`.", @@ -206,7 +205,6 @@ "button": { "sub_yes": "✅ Прийняти", "sub_no": "❌ Відхилити", - "sub_aggressive": "🤡 Відхилити (Токс)", "sub_russian": "🇷🇺 Відхилити (Русак)", "sponsor_yes": "✅ Прийняти", "sponsor_no": "❌ Відхилити", @@ -237,7 +235,6 @@ "callback": { "sub_accepted": "✅ Анкету {0} схвалено", "sub_rejected": "❌ Анкету {0} відхилено", - "sub_aggressive": "🤡 Анкету {0} відхилено", "sub_russian": "🇷🇺 Анкету {0} відхилено", "sus_allowed": "✅ Доступ {0} дозволено", "sus_rejected": "❌ Доступ {0} заборонено", diff --git a/modules/callbacks/sub.py b/modules/callbacks/sub.py index eb76d06..f806f50 100644 --- a/modules/callbacks/sub.py +++ b/modules/callbacks/sub.py @@ -68,23 +68,6 @@ async def callback_query_reject(app: Client, clb: CallbackQuery): await clb.message.edit(text=clb.message.text, reply_markup=InlineKeyboardMarkup(edited_markup)) await clb.answer(text=locale("sub_rejected", "callback", locale=clb.from_user).format(holo_user.id), show_alert=True) -@app.on_callback_query(filters.regex("sub_aggressive_[\s\S]*")) -async def callback_query_reject_aggressive(app: Client, clb: CallbackQuery): - - fullclb = clb.data.split("_") - holo_user = HoloUser(int(fullclb[2])) - - await app.send_message(configGet("admin", "groups"), locale("rejected_by_agr", "message").format(clb.from_user.first_name, holo_user.id), disable_notification=True) - await app.send_message(holo_user.id, locale("rejected_aggressive", "message", locale=holo_user)) - logWrite(f"User {holo_user.id} got rejected by {clb.from_user.id} due to being aggressive") - - col_tmp.update_one({"user": {"$eq": holo_user.id}, "type": {"$eq": "application"}}, {"$set": {"state": "rejected", "sent": False}}) - - edited_markup = [[InlineKeyboardButton(text=str(locale("declined", "button")), callback_data="nothing")]] - - await clb.message.edit(text=clb.message.text, reply_markup=InlineKeyboardMarkup(edited_markup)) - await clb.answer(text=locale("sub_aggressive", "callback", locale=clb.from_user).format(holo_user.id), show_alert=True) - @app.on_callback_query(filters.regex("sub_russian_[\s\S]*")) async def callback_query_reject_russian(app: Client, clb: CallbackQuery): diff --git a/modules/handlers/confirmation.py b/modules/handlers/confirmation.py index 364a276..9dc8a79 100644 --- a/modules/handlers/confirmation.py +++ b/modules/handlers/confirmation.py @@ -83,9 +83,6 @@ async def confirm_yes(app: Client, msg: Message, kind: Literal["application", "s [ InlineKeyboardButton(text=str(locale("sub_no", "button")), callback_data=f"sub_no_{holo_user.id}") ], - [ - InlineKeyboardButton(text=str(locale("sub_aggressive", "button")), callback_data=f"sub_aggressive_{holo_user.id}") - ], [ InlineKeyboardButton(text=str(locale("sub_russian", "button")), callback_data=f"sub_russian_{holo_user.id}") ]