From 3773814a61ee60347d33ff5ea2c352fe741a0ebc Mon Sep 17 00:00:00 2001 From: Untone Date: Mon, 11 Sep 2023 23:21:55 +0300 Subject: [PATCH] fixim4 --- api/webhook.py | 14 +++++++------- bot/api.py | 2 +- bot/handlers/callback_unlink.py | 8 ++++---- bot/handlers/callback_vouch.py | 4 ++-- bot/handlers/command_ask.py | 6 +++--- bot/handlers/command_graph.py | 6 +++--- bot/handlers/command_my.py | 6 +++--- bot/handlers/handle_default.py | 6 +++--- bot/handlers/handle_feedback.py | 10 +++++----- bot/handlers/handle_join_request.py | 6 +++--- bot/handlers/handle_members_change.py | 8 ++++---- bot/handlers/handle_startup.py | 8 ++++---- bot/handlers/routing.py | 14 +++++++------- bot/handlers/send_button.py | 6 +++--- bot/storage/__init__.py | 4 ++-- 15 files changed, 54 insertions(+), 54 deletions(-) diff --git a/api/webhook.py b/api/webhook.py index 852efa0..4518084 100644 --- a/api/webhook.py +++ b/api/webhook.py @@ -1,10 +1,10 @@ -from bot.handlers.routing import handle_routing -from bot.handlers.callback_vouch import handle_button -from bot.handlers.callback_unlink import handle_unlink -from bot.handlers.handle_startup import handle_startup -from bot.handlers.handle_join_request import handle_join_request -from bot.api import register_webhook, send_message -from bot.config import FEEDBACK_CHAT_ID +from handlers.routing import handle_routing +from handlers.callback_vouch import handle_button +from handlers.callback_unlink import handle_unlink +from handlers.handle_startup import handle_startup +from handlers.handle_join_request import handle_join_request +from api import register_webhook, send_message +from config import FEEDBACK_CHAT_ID from sanic.app import Sanic app = Sanic(name="welcomecenter") diff --git a/bot/api.py b/bot/api.py index 8b65fb1..13ddabc 100644 --- a/bot/api.py +++ b/bot/api.py @@ -1,6 +1,6 @@ import aiohttp import json -from bot.config import BOT_TOKEN, WEBHOOK +from config import BOT_TOKEN, WEBHOOK import logging # Create a logger instance diff --git a/bot/handlers/callback_unlink.py b/bot/handlers/callback_unlink.py index ba589e5..236a0f2 100644 --- a/bot/handlers/callback_unlink.py +++ b/bot/handlers/callback_unlink.py @@ -1,7 +1,7 @@ -from bot.api import send_message, delete_message, kick_member -from bot.handlers.command_my import handle_command_my -from bot.utils.mention import userdata_extract -from bot.storage import Profile +from api import send_message, delete_message, kick_member +from handlers.command_my import handle_command_my +from utils.mention import userdata_extract +from storage import Profile # remove link of callback sender diff --git a/bot/handlers/callback_vouch.py b/bot/handlers/callback_vouch.py index 8f4f803..b5ae6fb 100644 --- a/bot/handlers/callback_vouch.py +++ b/bot/handlers/callback_vouch.py @@ -1,4 +1,4 @@ -from bot.api import ( +from api import ( send_message, forward_message, delete_message, @@ -6,7 +6,7 @@ from bot.api import ( edit_replymarkup, get_chat, ) -from bot.storage import Profile, storage +from storage import Profile, storage async def update_button(chat_id, member_id, text="❤️"): diff --git a/bot/handlers/command_ask.py b/bot/handlers/command_ask.py index 55434ec..b98b1ee 100644 --- a/bot/handlers/command_ask.py +++ b/bot/handlers/command_ask.py @@ -1,6 +1,6 @@ -from bot.storage import Profile -from bot.handlers.send_button import show_request_msg -from bot.api import get_member +from storage import Profile +from handlers.send_button import show_request_msg +from api import get_member def handle_command_ask(msg): diff --git a/bot/handlers/command_graph.py b/bot/handlers/command_graph.py index 4fd96d4..49c30a1 100644 --- a/bot/handlers/command_graph.py +++ b/bot/handlers/command_graph.py @@ -1,6 +1,6 @@ -from bot.utils.graph import generate_chart -from bot.api import send_document -from bot.storage import storage, scan +from utils.graph import generate_chart +from api import send_document +from storage import storage, scan import json diff --git a/bot/handlers/command_my.py b/bot/handlers/command_my.py index 2379d90..1ce13e9 100644 --- a/bot/handlers/command_my.py +++ b/bot/handlers/command_my.py @@ -1,6 +1,6 @@ -from bot.storage import Profile, scan -from bot.api import get_member, send_message, get_chat_administrators -from bot.utils.mention import userdata_extract +from storage import Profile, scan +from api import get_member, send_message, get_chat_administrators +from utils.mention import userdata_extract async def construct_unlink_buttons(actor): diff --git a/bot/handlers/handle_default.py b/bot/handlers/handle_default.py index d8b6939..26c29a0 100644 --- a/bot/handlers/handle_default.py +++ b/bot/handlers/handle_default.py @@ -1,6 +1,6 @@ -from bot.api import send_message, delete_message, get_chat_administrators -from bot.storage import Profile, storage -from bot.handlers.send_button import show_request_msg +from api import send_message, delete_message, get_chat_administrators +from storage import Profile, storage +from handlers.send_button import show_request_msg async def handle_default(msg): diff --git a/bot/handlers/handle_feedback.py b/bot/handlers/handle_feedback.py index ee51a73..4cd813e 100644 --- a/bot/handlers/handle_feedback.py +++ b/bot/handlers/handle_feedback.py @@ -1,15 +1,15 @@ import json -from bot.api import ( +from api import ( send_message, forward_message, delete_message, get_chat_administrators, ) -from bot.handlers.send_button import show_request_msg -from bot.utils.mention import userdata_extract -from bot.storage import storage, Profile -from bot.config import FEEDBACK_CHAT_ID +from handlers.send_button import show_request_msg +from utils.mention import userdata_extract +from storage import storage, Profile +from config import FEEDBACK_CHAT_ID async def handle_feedback(msg, state): diff --git a/bot/handlers/handle_join_request.py b/bot/handlers/handle_join_request.py index 74b243f..4083c64 100644 --- a/bot/handlers/handle_join_request.py +++ b/bot/handlers/handle_join_request.py @@ -1,6 +1,6 @@ -from bot.api import approve_chat_join_request, delete_message -from bot.handlers.send_button import show_request_msg -from bot.storage import Profile, storage +from api import approve_chat_join_request, delete_message +from handlers.send_button import show_request_msg +from storage import Profile, storage async def handle_join_request(msg): diff --git a/bot/handlers/handle_members_change.py b/bot/handlers/handle_members_change.py index a16878b..b7ebe5d 100644 --- a/bot/handlers/handle_members_change.py +++ b/bot/handlers/handle_members_change.py @@ -1,7 +1,7 @@ -from bot.handlers.send_button import show_request_msg -from bot.api import delete_message -from bot.storage import Profile, storage -from bot.config import FEEDBACK_CHAT_ID +from handlers.send_button import show_request_msg +from api import delete_message +from storage import Profile, storage +from config import FEEDBACK_CHAT_ID async def handle_join(msg): diff --git a/bot/handlers/handle_startup.py b/bot/handlers/handle_startup.py index 3081af7..283cdb1 100644 --- a/bot/handlers/handle_startup.py +++ b/bot/handlers/handle_startup.py @@ -1,7 +1,7 @@ -from bot.storage import scan, Profile -from bot.api import approve_chat_join_request, kick_member -from bot.handlers.callback_vouch import update_button -from bot.utils.mention import userdata_extract +from storage import scan, Profile +from api import approve_chat_join_request, kick_member +from handlers.callback_vouch import update_button +from utils.mention import userdata_extract # устанавливает соответствие данных diff --git a/bot/handlers/routing.py b/bot/handlers/routing.py index dfd68f3..281ad7a 100644 --- a/bot/handlers/routing.py +++ b/bot/handlers/routing.py @@ -1,10 +1,10 @@ -from bot.handlers.handle_feedback import handle_feedback, handle_answer -from bot.handlers.handle_members_change import handle_join, handle_left -from bot.handlers.handle_default import handle_default -from bot.handlers.command_my import handle_command_my -from bot.handlers.command_graph import handle_command_graph -from bot.handlers.command_ask import handle_command_ask -from bot.config import FEEDBACK_CHAT_ID +from handlers.handle_feedback import handle_feedback, handle_answer +from handlers.handle_members_change import handle_join, handle_left +from handlers.handle_default import handle_default +from handlers.command_my import handle_command_my +from handlers.command_graph import handle_command_graph +from handlers.command_ask import handle_command_ask +from config import FEEDBACK_CHAT_ID async def handle_routing(msg, state): diff --git a/bot/handlers/send_button.py b/bot/handlers/send_button.py index 43901ce..68bcd31 100644 --- a/bot/handlers/send_button.py +++ b/bot/handlers/send_button.py @@ -1,6 +1,6 @@ -from bot.api import send_message, send_photo, get_userphotos -from bot.utils.mention import mention, userdata_extract -from bot.storage import storage +from api import send_message, send_photo, get_userphotos +from utils.mention import mention, userdata_extract +from storage import storage async def show_request_msg(msg): diff --git a/bot/storage/__init__.py b/bot/storage/__init__.py index 27311be..61142b6 100644 --- a/bot/storage/__init__.py +++ b/bot/storage/__init__.py @@ -1,6 +1,6 @@ from redis import Redis -from bot.storage.profile import Profile as ProfileObj -from bot.config import REDIS_URL +from storage.profile import Profile as ProfileObj +from config import REDIS_URL import json