diff --git a/bot.py b/bot.py index f51fd6f..5e33873 100644 --- a/bot.py +++ b/bot.py @@ -21,22 +21,20 @@ import psutil import config import strings as S -import economy -import pb_client -import sheets -from dev_member_commands import register_dev_member_commands -from dev_member_runtime import handle_member_join, run_birthday_daily -from economy_admin_commands import register_economy_admin_commands -from economy_extra_commands import register_economy_extra_commands -from economy_fish_commands import register_economy_fish_commands -from economy_games_commands import register_economy_games_commands -from economy_income_commands import register_economy_income_commands -from economy_prestige_commands import register_prestige_commands -from economy_profile_commands import register_economy_profile_commands -from economy_support_commands import register_economy_support_commands -from ops_channel_commands import register_ops_channel_commands -from ops_admin_commands import register_ops_admin_commands -from member_sync import SyncResult +from core import economy, pb_client, sheets +from core.member_sync import SyncResult +from commands.dev_member_commands import register_dev_member_commands +from commands.dev_member_runtime import handle_member_join, run_birthday_daily +from commands.economy_admin_commands import register_economy_admin_commands +from commands.economy_extra_commands import register_economy_extra_commands +from commands.economy_fish_commands import register_economy_fish_commands +from commands.economy_games_commands import register_economy_games_commands +from commands.economy_income_commands import register_economy_income_commands +from commands.economy_prestige_commands import register_prestige_commands +from commands.economy_profile_commands import register_economy_profile_commands +from commands.economy_support_commands import register_economy_support_commands +from commands.ops_channel_commands import register_ops_channel_commands +from commands.ops_admin_commands import register_ops_admin_commands # --------------------------------------------------------------------------- # Logging diff --git a/dev_member_commands.py b/commands/dev_member_commands.py similarity index 99% rename from dev_member_commands.py rename to commands/dev_member_commands.py index 6234286..26bd757 100644 --- a/dev_member_commands.py +++ b/commands/dev_member_commands.py @@ -7,9 +7,9 @@ from typing import Callable import discord from discord import app_commands -import sheets +from core import sheets import strings as S -from member_sync import announce_birthday, sync_member +from core.member_sync import announce_birthday, sync_member class BirthdayPages(discord.ui.View): diff --git a/dev_member_runtime.py b/commands/dev_member_runtime.py similarity index 96% rename from dev_member_runtime.py rename to commands/dev_member_runtime.py index a7cb70c..92550e1 100644 --- a/dev_member_runtime.py +++ b/commands/dev_member_runtime.py @@ -6,8 +6,8 @@ from collections.abc import Callable import discord import config -import sheets -from member_sync import announce_birthday, is_birthday_today, sync_member +from core import sheets +from core.member_sync import announce_birthday, is_birthday_today, sync_member async def run_birthday_daily( diff --git a/economy_admin_commands.py b/commands/economy_admin_commands.py similarity index 99% rename from economy_admin_commands.py rename to commands/economy_admin_commands.py index d2304ba..42d1b09 100644 --- a/economy_admin_commands.py +++ b/commands/economy_admin_commands.py @@ -7,7 +7,7 @@ from collections.abc import Awaitable, Callable import discord from discord import app_commands -import economy +from core import economy import strings as S diff --git a/economy_extra_commands.py b/commands/economy_extra_commands.py similarity index 99% rename from economy_extra_commands.py rename to commands/economy_extra_commands.py index f031e88..538eb92 100644 --- a/economy_extra_commands.py +++ b/commands/economy_extra_commands.py @@ -9,7 +9,7 @@ from collections.abc import Awaitable, Callable, MutableSet import discord from discord import app_commands -import economy +from core import economy import strings as S diff --git a/economy_fish_commands.py b/commands/economy_fish_commands.py similarity index 99% rename from economy_fish_commands.py rename to commands/economy_fish_commands.py index 9f96d4b..9c9c81d 100644 --- a/economy_fish_commands.py +++ b/commands/economy_fish_commands.py @@ -7,7 +7,7 @@ from collections.abc import Awaitable, Callable, MutableSet import discord from discord import app_commands -import economy +from core import economy import strings as S diff --git a/economy_games_commands.py b/commands/economy_games_commands.py similarity index 99% rename from economy_games_commands.py rename to commands/economy_games_commands.py index e970bfa..f1f1a41 100644 --- a/economy_games_commands.py +++ b/commands/economy_games_commands.py @@ -8,7 +8,7 @@ from collections.abc import Awaitable, Callable, MutableSet import discord from discord import app_commands -import economy +from core import economy import strings as S diff --git a/economy_income_commands.py b/commands/economy_income_commands.py similarity index 99% rename from economy_income_commands.py rename to commands/economy_income_commands.py index 10613f8..b4789e2 100644 --- a/economy_income_commands.py +++ b/commands/economy_income_commands.py @@ -7,7 +7,7 @@ from collections.abc import Awaitable, Callable import discord from discord import app_commands -import economy +from core import economy import strings as S diff --git a/economy_prestige_commands.py b/commands/economy_prestige_commands.py similarity index 99% rename from economy_prestige_commands.py rename to commands/economy_prestige_commands.py index d9da335..f90af46 100644 --- a/economy_prestige_commands.py +++ b/commands/economy_prestige_commands.py @@ -6,7 +6,7 @@ from collections.abc import Awaitable, Callable import discord from discord import app_commands -import economy +from core import economy import strings as S diff --git a/economy_profile_commands.py b/commands/economy_profile_commands.py similarity index 99% rename from economy_profile_commands.py rename to commands/economy_profile_commands.py index 1934d49..976f561 100644 --- a/economy_profile_commands.py +++ b/commands/economy_profile_commands.py @@ -7,7 +7,7 @@ from collections.abc import Awaitable, Callable import discord from discord import app_commands -import economy +from core import economy import strings as S diff --git a/economy_support_commands.py b/commands/economy_support_commands.py similarity index 99% rename from economy_support_commands.py rename to commands/economy_support_commands.py index 1a66800..4d4c25d 100644 --- a/economy_support_commands.py +++ b/commands/economy_support_commands.py @@ -5,7 +5,7 @@ from collections.abc import Callable import discord from discord import app_commands -import economy +from core import economy import strings as S diff --git a/ops_admin_commands.py b/commands/ops_admin_commands.py similarity index 100% rename from ops_admin_commands.py rename to commands/ops_admin_commands.py diff --git a/ops_channel_commands.py b/commands/ops_channel_commands.py similarity index 99% rename from ops_channel_commands.py rename to commands/ops_channel_commands.py index 0e30f4d..c4d230d 100644 --- a/ops_channel_commands.py +++ b/commands/ops_channel_commands.py @@ -6,7 +6,7 @@ from collections.abc import Callable import discord from discord import app_commands -import economy +from core import economy import strings as S diff --git a/economy.py b/core/economy.py similarity index 99% rename from economy.py rename to core/economy.py index 09ebc56..b71f9db 100644 --- a/economy.py +++ b/core/economy.py @@ -12,7 +12,7 @@ import random from datetime import date, datetime, timedelta, timezone from typing import TypedDict -import pb_client +from . import pb_client import strings diff --git a/member_sync.py b/core/member_sync.py similarity index 99% rename from member_sync.py rename to core/member_sync.py index 9a7b9ba..21da0a0 100644 --- a/member_sync.py +++ b/core/member_sync.py @@ -9,7 +9,7 @@ from dataclasses import dataclass, field import discord import config -import sheets +from . import sheets log = logging.getLogger(__name__) _PLACEHOLDER = {"-", "x", "n/a", "none", "ei"} diff --git a/pb_client.py b/core/pb_client.py similarity index 100% rename from pb_client.py rename to core/pb_client.py diff --git a/sheets.py b/core/sheets.py similarity index 100% rename from sheets.py rename to core/sheets.py diff --git a/scripts/migrate_to_pb.py b/scripts/migrate_to_pb.py index a63ff9d..381f646 100644 --- a/scripts/migrate_to_pb.py +++ b/scripts/migrate_to_pb.py @@ -23,12 +23,12 @@ from pathlib import Path from dotenv import load_dotenv -# Ensure the project root is on sys.path so pb_client can be imported +# Ensure the project root is on sys.path so core modules can be imported sys.path.insert(0, str(Path(__file__).parent.parent)) load_dotenv() -import pb_client # noqa: E402 (needs dotenv loaded first) +from core import pb_client # noqa: E402 (needs dotenv loaded first) DATA_FILE = Path("data") / "economy.json"