From de984c2b78829ffeda1c2cbe60e7ab9bf7577efb Mon Sep 17 00:00:00 2001 From: profitroll Date: Thu, 9 Mar 2023 16:31:39 +0100 Subject: [PATCH] Removed useless shit --- modules/callbacks/nothing.py | 4 ---- modules/callbacks/reapply.py | 4 ---- modules/callbacks/rules.py | 4 ---- modules/callbacks/spoiler.py | 8 -------- modules/callbacks/sponsorship.py | 1 - modules/callbacks/sub.py | 4 ---- modules/callbacks/sus.py | 4 ---- modules/commands/application.py | 4 ---- modules/commands/applications.py | 4 ---- modules/commands/cancel.py | 4 ---- modules/commands/identify.py | 4 ---- modules/commands/issue.py | 8 +------- modules/commands/label.py | 4 ---- modules/commands/message.py | 4 ---- modules/commands/nearby.py | 4 ---- modules/commands/reapply.py | 4 ---- modules/commands/reboot.py | 4 ---- modules/commands/resetcommands.py | 4 ---- modules/commands/rules.py | 4 ---- modules/commands/spoiler.py | 4 ---- modules/commands/sponsorship.py | 4 ---- modules/commands/start.py | 4 ---- modules/commands/warn.py | 4 ---- modules/commands/warnings.py | 4 ---- modules/handlers/confirmation.py | 5 +---- modules/handlers/contact.py | 4 ---- modules/handlers/everything.py | 4 ---- modules/handlers/group_join.py | 4 ---- modules/handlers/welcome.py | 4 ---- 29 files changed, 2 insertions(+), 120 deletions(-) diff --git a/modules/callbacks/nothing.py b/modules/callbacks/nothing.py index 1550f55..b893acf 100644 --- a/modules/callbacks/nothing.py +++ b/modules/callbacks/nothing.py @@ -5,10 +5,6 @@ from pyrogram.client import Client from modules.utils import locale -# Callback empty =============================================================================================================== @app.on_callback_query(filters.regex("nothing")) async def callback_query_nothing(app: Client, clb: CallbackQuery): await clb.answer(text=locale("nothing", "callback", locale=clb.from_user)) - - -# ============================================================================================================================== diff --git a/modules/callbacks/reapply.py b/modules/callbacks/reapply.py index 82798f5..9d41dd3 100644 --- a/modules/callbacks/reapply.py +++ b/modules/callbacks/reapply.py @@ -15,7 +15,6 @@ from modules.handlers.welcome import welcome_pass from modules.database import col_tmp, col_applications -# Callbacks reapply ============================================================================================================ @app.on_callback_query(filters.regex("reapply_yes_[\s\S]*")) async def callback_reapply_query_accept(app: Client, clb: CallbackQuery): fullclb = clb.data.split("_") @@ -285,6 +284,3 @@ async def callback_query_reapply_stop(app: Client, clb: CallbackQuery): locale("reapply_restarted", "message", locale=holo_user), reply_markup=ReplyKeyboardRemove(), ) - - -# ============================================================================================================================== diff --git a/modules/callbacks/rules.py b/modules/callbacks/rules.py index ce33eca..8a05668 100644 --- a/modules/callbacks/rules.py +++ b/modules/callbacks/rules.py @@ -7,7 +7,6 @@ from modules.utils import locale, logWrite from modules.commands.rules import DefaultRulesMarkup -# Callback rule ================================================================================================================ @app.on_callback_query(filters.regex("rule_[\s\S]*")) async def callback_query_rule(app: Client, clb: CallbackQuery): fullclb = clb.data.split("_") @@ -100,6 +99,3 @@ async def callback_query_rules_additional(app: Client, clb: CallbackQuery): pass await clb.answer(text=locale("rules_additional", "callback", locale=clb.from_user)) - - -# ============================================================================================================================== diff --git a/modules/callbacks/spoiler.py b/modules/callbacks/spoiler.py index 5a48755..fd79e08 100644 --- a/modules/callbacks/spoiler.py +++ b/modules/callbacks/spoiler.py @@ -9,7 +9,6 @@ from bson.objectid import ObjectId from modules.utils import configGet, jsonLoad, locale -# Callback sid ================================================================================================================= @app.on_callback_query(filters.regex("sid_[\s\S]*")) async def callback_query_sid(app: Client, clb: CallbackQuery): await clb.answer( @@ -17,10 +16,6 @@ async def callback_query_sid(app: Client, clb: CallbackQuery): ) -# ============================================================================================================================== - - -# Callback shc ================================================================================================================= @app.on_callback_query(filters.regex("shc_[\s\S]*")) async def callback_query_shc(app: Client, clb: CallbackQuery): if clb.from_user.id not in jsonLoad( @@ -80,6 +75,3 @@ async def callback_query_shc(app: Client, clb: CallbackQuery): await clb.answer( locale("spoiler_sent", "callback", locale=clb.from_user), show_alert=True ) - - -# ============================================================================================================================== diff --git a/modules/callbacks/sponsorship.py b/modules/callbacks/sponsorship.py index 05732e0..016be60 100644 --- a/modules/callbacks/sponsorship.py +++ b/modules/callbacks/sponsorship.py @@ -14,7 +14,6 @@ from modules.utils import configGet, locale, logWrite, should_quote from modules.database import col_tmp, col_sponsorships -# Callbacks sponsorship ======================================================================================================== @app.on_callback_query(filters.regex("sponsor_apply_[\s\S]*")) async def callback_query_sponsor_apply(app: Client, clb: CallbackQuery): fullclb = clb.data.split("_") diff --git a/modules/callbacks/sub.py b/modules/callbacks/sub.py index ef6954c..970a722 100644 --- a/modules/callbacks/sub.py +++ b/modules/callbacks/sub.py @@ -9,7 +9,6 @@ from modules.database import col_tmp, col_applications from modules.commands.rules import DefaultRulesMarkup -# Callbacks application ======================================================================================================== @app.on_callback_query(filters.regex("sub_yes_[\s\S]*")) async def callback_query_accept(app: Client, clb: CallbackQuery): fullclb = clb.data.split("_") @@ -188,6 +187,3 @@ async def callback_query_reject_russian(app: Client, clb: CallbackQuery): ), show_alert=True, ) - - -# ============================================================================================================================== diff --git a/modules/callbacks/sus.py b/modules/callbacks/sus.py index 4c51471..4085021 100644 --- a/modules/callbacks/sus.py +++ b/modules/callbacks/sus.py @@ -12,7 +12,6 @@ from modules.utils import configGet, locale, logWrite from modules.database import col_tmp -# Callbacks sus users ========================================================================================================== @app.on_callback_query(filters.regex("sus_allow_[\s\S]*")) async def callback_query_sus_allow(app: Client, clb: CallbackQuery): fullclb = clb.data.split("_") @@ -99,6 +98,3 @@ async def callback_query_sus_reject(app: Client, clb: CallbackQuery): {"user": {"$eq": holo_user.id}, "type": {"$eq": "application"}}, {"$set": {"state": "rejected", "sent": False}}, ) - - -# ============================================================================================================================== diff --git a/modules/commands/application.py b/modules/commands/application.py index f68f5e6..6e79fdd 100644 --- a/modules/commands/application.py +++ b/modules/commands/application.py @@ -13,7 +13,6 @@ from modules.database import col_applications from modules import custom_filters -# Application command ========================================================================================================== @app.on_message( custom_filters.enabled_applications & ~filters.scheduled @@ -98,6 +97,3 @@ async def cmd_application(app: Client, msg: Message): locale("application_invalid_syntax", "message", locale=msg.from_user), quote=should_quote(msg), ) - - -# ============================================================================================================================== diff --git a/modules/commands/applications.py b/modules/commands/applications.py index bdb4a6d..7e2edbf 100644 --- a/modules/commands/applications.py +++ b/modules/commands/applications.py @@ -11,7 +11,6 @@ from modules.database import col_applications from modules import custom_filters -# Applications command ========================================================================================================= @app.on_message( custom_filters.enabled_applications & ~filters.scheduled @@ -38,6 +37,3 @@ async def cmd_applications(app: Client, msg: Message): quote=should_quote(msg), ) remove(f"tmp{sep}{filename}.json") - - -# ============================================================================================================================== diff --git a/modules/commands/cancel.py b/modules/commands/cancel.py index 7d32276..c5e9b02 100644 --- a/modules/commands/cancel.py +++ b/modules/commands/cancel.py @@ -7,7 +7,6 @@ from modules.database import col_tmp, col_spoilers, col_applications from modules import custom_filters -# Cancel command =============================================================================================================== @app.on_message( (custom_filters.enabled_applications | custom_filters.enabled_sponsorships) & ~filters.scheduled @@ -30,6 +29,3 @@ async def command_cancel(app: Client, msg: Message): reply_markup=ReplyKeyboardRemove(), ) logWrite(f"Cancelling all ongoing tmp operations for {msg.from_user.id}") - - -# ============================================================================================================================== diff --git a/modules/commands/identify.py b/modules/commands/identify.py index 167177a..86322e8 100644 --- a/modules/commands/identify.py +++ b/modules/commands/identify.py @@ -19,7 +19,6 @@ from modules.utils import ( from modules import custom_filters -# Identify command ============================================================================================================= @app.on_message( (custom_filters.enabled_applications | custom_filters.enabled_sponsorships) & ~filters.scheduled @@ -104,6 +103,3 @@ async def cmd_identify(app: Client, msg: Message): await msg.reply_text(output, quote=should_quote(msg)) logWrite(f"User {msg.from_user.id} identified user {holo_user.id}") - - -# ============================================================================================================================== diff --git a/modules/commands/issue.py b/modules/commands/issue.py index 70610f6..2ada581 100644 --- a/modules/commands/issue.py +++ b/modules/commands/issue.py @@ -1,14 +1,11 @@ -from typing import Union from app import app from pyrogram import filters -from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton, User, Message +from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton, Message from pyrogram.client import Client from modules.utils import configGet, locale from modules import custom_filters -from classes.holo_user import HoloUser -# Issue command ================================================================================================================ @app.on_message( custom_filters.enabled_general & ~filters.scheduled @@ -31,6 +28,3 @@ async def cmd_issue(app: Client, msg: Message): ] ), ) - - -# ============================================================================================================================== diff --git a/modules/commands/label.py b/modules/commands/label.py index b9eaf70..451e409 100644 --- a/modules/commands/label.py +++ b/modules/commands/label.py @@ -8,7 +8,6 @@ from classes.holo_user import HoloUser from modules import custom_filters -# Label command ================================================================================================================ @app.on_message( custom_filters.enabled_applications & ~filters.scheduled @@ -53,6 +52,3 @@ async def cmd_label(app: Client, msg: Message): else: await msg.reply_text(f"User not found") - - -# ============================================================================================================================== diff --git a/modules/commands/message.py b/modules/commands/message.py index cca0490..f9fc877 100644 --- a/modules/commands/message.py +++ b/modules/commands/message.py @@ -8,7 +8,6 @@ from modules.utils import logWrite, locale, should_quote, find_user from modules import custom_filters -# Message command ============================================================================================================== @app.on_message( custom_filters.enabled_general & ~filters.scheduled @@ -71,6 +70,3 @@ async def cmd_message(app: Client, msg: Message): quote=should_quote(msg), ) logWrite(f"Admin {msg.from_user.id} tried to send message but 'ValueError'") - - -# ============================================================================================================================== diff --git a/modules/commands/nearby.py b/modules/commands/nearby.py index 563d809..a7d748b 100644 --- a/modules/commands/nearby.py +++ b/modules/commands/nearby.py @@ -12,7 +12,6 @@ from modules.database import col_applications, col_users from classes.errors.geo import PlaceNotFoundError -# Nearby command =============================================================================================================== @app.on_message( custom_filters.enabled_applications & ~filters.scheduled @@ -116,6 +115,3 @@ async def cmd_nearby(app: Client, msg: Message): await msg.reply_text( locale("nearby_empty", "message", locale=holo_user), quote=should_quote(msg) ) - - -# ============================================================================================================================== diff --git a/modules/commands/reapply.py b/modules/commands/reapply.py index 2ba8468..31014d7 100644 --- a/modules/commands/reapply.py +++ b/modules/commands/reapply.py @@ -10,7 +10,6 @@ from modules.database import col_tmp, col_applications from modules import custom_filters -# Reapply command ============================================================================================================== @app.on_message( custom_filters.enabled_applications & ~filters.scheduled @@ -168,6 +167,3 @@ async def cmd_reapply(app: Client, msg: Message): ] ), ) - - -# ============================================================================================================================== diff --git a/modules/commands/reboot.py b/modules/commands/reboot.py index fedb312..a0d1f34 100644 --- a/modules/commands/reboot.py +++ b/modules/commands/reboot.py @@ -12,7 +12,6 @@ from modules import custom_filters pid = getpid() -# Reboot command =============================================================================================================== @app.on_message( custom_filters.enabled_general & ~filters.scheduled @@ -33,6 +32,3 @@ async def cmd_kill(app: Client, msg: Message): path.join(configGet("cache", "locations"), "shutdown_time"), ) exit() - - -# ============================================================================================================================== diff --git a/modules/commands/resetcommands.py b/modules/commands/resetcommands.py index b5a962d..b2fd468 100644 --- a/modules/commands/resetcommands.py +++ b/modules/commands/resetcommands.py @@ -10,7 +10,6 @@ from modules import custom_filters pid = getpid() -# Reset commands command ======================================================================================================= @app.on_message( custom_filters.enabled_general & ~filters.scheduled @@ -110,6 +109,3 @@ async def cmd_resetcommands(app: Client, msg: Message): ), debug=True, ) - - -# ============================================================================================================================== diff --git a/modules/commands/rules.py b/modules/commands/rules.py index a7fe6fd..50879cd 100644 --- a/modules/commands/rules.py +++ b/modules/commands/rules.py @@ -42,7 +42,6 @@ class DefaultRulesMarkup(list): ) -# Rules command ============================================================================================================= @app.on_message( custom_filters.enabled_general & ~filters.scheduled @@ -56,6 +55,3 @@ async def cmd_rules(app: Client, msg: Message): disable_web_page_preview=True, reply_markup=DefaultRulesMarkup(msg.from_user).keyboard, ) - - -# ============================================================================================================================== diff --git a/modules/commands/spoiler.py b/modules/commands/spoiler.py index 24d40ee..4c9eb10 100644 --- a/modules/commands/spoiler.py +++ b/modules/commands/spoiler.py @@ -10,7 +10,6 @@ from modules.database import col_spoilers, col_applications from modules import custom_filters -# Spoiler command ============================================================================================================== @app.on_message( custom_filters.enabled_spoilers & ~filters.scheduled @@ -63,6 +62,3 @@ async def cmd_spoiler(app: Client, msg: Message): await msg.reply_text( locale("spoiler_unfinished", "message", locale=msg.from_user) ) - - -# ============================================================================================================================== diff --git a/modules/commands/sponsorship.py b/modules/commands/sponsorship.py index 3856c39..3b3dd67 100644 --- a/modules/commands/sponsorship.py +++ b/modules/commands/sponsorship.py @@ -8,7 +8,6 @@ from modules.utils import locale, should_quote from modules.database import col_applications -# Sponsorship command ========================================================================================================== @app.on_message( custom_filters.enabled_sponsorships & ~filters.scheduled @@ -45,6 +44,3 @@ async def cmd_sponsorship(app: Client, msg: Message): ) # else: # await msg.reply_text(locale("sponsorship_application_empty", "message")) - - -# ============================================================================================================================== diff --git a/modules/commands/start.py b/modules/commands/start.py index 6e9ea9d..73699d6 100644 --- a/modules/commands/start.py +++ b/modules/commands/start.py @@ -9,7 +9,6 @@ from bson.objectid import ObjectId from bson.errors import InvalidId -# Start command ================================================================================================================ @app.on_message( custom_filters.enabled_applications & ~filters.scheduled @@ -69,6 +68,3 @@ async def cmd_start(app: Client, msg: Message): await msg.reply_text(spoiler["text"]) except InvalidId: await msg.reply_text(f"Got an invalid ID {msg.command[1]}") - - -# ============================================================================================================================== diff --git a/modules/commands/warn.py b/modules/commands/warn.py index 0c61908..a0b3761 100644 --- a/modules/commands/warn.py +++ b/modules/commands/warn.py @@ -8,7 +8,6 @@ from modules.database import col_warnings from modules import custom_filters -# Warn command ================================================================================================================= @app.on_message( custom_filters.enabled_warnings & ~filters.scheduled @@ -42,6 +41,3 @@ async def cmd_warn(app: Client, msg: Message): message, ) ) - - -# ============================================================================================================================== diff --git a/modules/commands/warnings.py b/modules/commands/warnings.py index 24d357c..0f12ba2 100644 --- a/modules/commands/warnings.py +++ b/modules/commands/warnings.py @@ -8,7 +8,6 @@ from modules.database import col_users, col_warnings from modules import custom_filters -# Warnings command ============================================================================================================= @app.on_message( custom_filters.enabled_warnings & ~filters.scheduled @@ -72,6 +71,3 @@ async def cmd_warnings(app: Client, msg: Message): ), quote=should_quote(msg), ) - - -# ============================================================================================================================== diff --git a/modules/handlers/confirmation.py b/modules/handlers/confirmation.py index 8448123..10f4001 100644 --- a/modules/handlers/confirmation.py +++ b/modules/handlers/confirmation.py @@ -18,7 +18,7 @@ from modules.handlers.welcome import welcome_pass from modules.database import col_tmp, col_applications from modules import custom_filters -# Confirmation ================================================================================================================= + confirmation_1 = [] for pattern in all_locales("confirm", "keyboard"): confirmation_1.append(pattern[0][0]) @@ -286,6 +286,3 @@ async def confirm_no( f"User {msg.from_user.id} restarted the sponsorship application due to typo in it" ) return - - -# ============================================================================================================================== diff --git a/modules/handlers/contact.py b/modules/handlers/contact.py index 8cb5d5c..6ab6f8b 100644 --- a/modules/handlers/contact.py +++ b/modules/handlers/contact.py @@ -10,7 +10,6 @@ from classes.holo_user import HoloUser from modules import custom_filters -# Contact getting ============================================================================================================== @app.on_message( custom_filters.enabled_applications & ~filters.scheduled @@ -82,6 +81,3 @@ async def get_contact(app: Client, msg: Message): await msg.reply_text( locale("contact_not_member", "message", locale=holo_user.locale) ) - - -# ============================================================================================================================== diff --git a/modules/handlers/everything.py b/modules/handlers/everything.py index 65c9f03..2ed37a4 100644 --- a/modules/handlers/everything.py +++ b/modules/handlers/everything.py @@ -41,7 +41,6 @@ async def message_context(msg: Message) -> tuple: return 0, 0 -# Any other input ============================================================================================================== @app.on_message( ~filters.scheduled & (filters.private | filters.chat(configGet("admin", "groups"))) @@ -400,6 +399,3 @@ async def message_in_group(app: Client, msg: Message): logWrite( f"Removed application requested by {msg.from_user.id} in destination group" ) - - -# ============================================================================================================================== diff --git a/modules/handlers/group_join.py b/modules/handlers/group_join.py index 70647eb..62741b3 100644 --- a/modules/handlers/group_join.py +++ b/modules/handlers/group_join.py @@ -15,7 +15,6 @@ from classes.holo_user import HoloUser from dateutil.relativedelta import relativedelta -# Filter users on join ========================================================================================================= @app.on_chat_member_updated( custom_filters.enabled_invites_check, group=configGet("users", "groups") ) @@ -150,6 +149,3 @@ async def filter_join(app: Client, member: ChatMemberUpdated): can_send_polls=False, ), ) - - -# ============================================================================================================================== diff --git a/modules/handlers/welcome.py b/modules/handlers/welcome.py index 38347d0..d6000ae 100644 --- a/modules/handlers/welcome.py +++ b/modules/handlers/welcome.py @@ -6,7 +6,6 @@ from classes.holo_user import HoloUser from modules.utils import all_locales, locale, logWrite from modules import custom_filters -# Welcome check ================================================================================================================ welcome_1 = [] for pattern in all_locales("welcome", "keyboard"): welcome_1.append(pattern[0][0]) @@ -72,6 +71,3 @@ async def welcome_reject(app: Client, msg: Message): locale("return", "keyboard", locale=msg.from_user), resize_keyboard=True ), ) - - -# ==============================================================================================================================