forked from sass/tipibot
Feature: Clean up the codebase
This commit is contained in:
30
bot.py
30
bot.py
@@ -21,22 +21,20 @@ import psutil
|
|||||||
|
|
||||||
import config
|
import config
|
||||||
import strings as S
|
import strings as S
|
||||||
import economy
|
from core import economy, pb_client, sheets
|
||||||
import pb_client
|
from core.member_sync import SyncResult
|
||||||
import sheets
|
from commands.dev_member_commands import register_dev_member_commands
|
||||||
from dev_member_commands import register_dev_member_commands
|
from commands.dev_member_runtime import handle_member_join, run_birthday_daily
|
||||||
from dev_member_runtime import handle_member_join, run_birthday_daily
|
from commands.economy_admin_commands import register_economy_admin_commands
|
||||||
from economy_admin_commands import register_economy_admin_commands
|
from commands.economy_extra_commands import register_economy_extra_commands
|
||||||
from economy_extra_commands import register_economy_extra_commands
|
from commands.economy_fish_commands import register_economy_fish_commands
|
||||||
from economy_fish_commands import register_economy_fish_commands
|
from commands.economy_games_commands import register_economy_games_commands
|
||||||
from economy_games_commands import register_economy_games_commands
|
from commands.economy_income_commands import register_economy_income_commands
|
||||||
from economy_income_commands import register_economy_income_commands
|
from commands.economy_prestige_commands import register_prestige_commands
|
||||||
from economy_prestige_commands import register_prestige_commands
|
from commands.economy_profile_commands import register_economy_profile_commands
|
||||||
from economy_profile_commands import register_economy_profile_commands
|
from commands.economy_support_commands import register_economy_support_commands
|
||||||
from economy_support_commands import register_economy_support_commands
|
from commands.ops_channel_commands import register_ops_channel_commands
|
||||||
from ops_channel_commands import register_ops_channel_commands
|
from commands.ops_admin_commands import register_ops_admin_commands
|
||||||
from ops_admin_commands import register_ops_admin_commands
|
|
||||||
from member_sync import SyncResult
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Logging
|
# Logging
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ from typing import Callable
|
|||||||
import discord
|
import discord
|
||||||
from discord import app_commands
|
from discord import app_commands
|
||||||
|
|
||||||
import sheets
|
from core import sheets
|
||||||
import strings as S
|
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):
|
class BirthdayPages(discord.ui.View):
|
||||||
@@ -6,8 +6,8 @@ from collections.abc import Callable
|
|||||||
import discord
|
import discord
|
||||||
|
|
||||||
import config
|
import config
|
||||||
import sheets
|
from core import sheets
|
||||||
from member_sync import announce_birthday, is_birthday_today, sync_member
|
from core.member_sync import announce_birthday, is_birthday_today, sync_member
|
||||||
|
|
||||||
|
|
||||||
async def run_birthday_daily(
|
async def run_birthday_daily(
|
||||||
@@ -7,7 +7,7 @@ from collections.abc import Awaitable, Callable
|
|||||||
import discord
|
import discord
|
||||||
from discord import app_commands
|
from discord import app_commands
|
||||||
|
|
||||||
import economy
|
from core import economy
|
||||||
import strings as S
|
import strings as S
|
||||||
|
|
||||||
|
|
||||||
@@ -9,7 +9,7 @@ from collections.abc import Awaitable, Callable, MutableSet
|
|||||||
import discord
|
import discord
|
||||||
from discord import app_commands
|
from discord import app_commands
|
||||||
|
|
||||||
import economy
|
from core import economy
|
||||||
import strings as S
|
import strings as S
|
||||||
|
|
||||||
|
|
||||||
@@ -7,7 +7,7 @@ from collections.abc import Awaitable, Callable, MutableSet
|
|||||||
import discord
|
import discord
|
||||||
from discord import app_commands
|
from discord import app_commands
|
||||||
|
|
||||||
import economy
|
from core import economy
|
||||||
import strings as S
|
import strings as S
|
||||||
|
|
||||||
|
|
||||||
@@ -8,7 +8,7 @@ from collections.abc import Awaitable, Callable, MutableSet
|
|||||||
import discord
|
import discord
|
||||||
from discord import app_commands
|
from discord import app_commands
|
||||||
|
|
||||||
import economy
|
from core import economy
|
||||||
import strings as S
|
import strings as S
|
||||||
|
|
||||||
|
|
||||||
@@ -7,7 +7,7 @@ from collections.abc import Awaitable, Callable
|
|||||||
import discord
|
import discord
|
||||||
from discord import app_commands
|
from discord import app_commands
|
||||||
|
|
||||||
import economy
|
from core import economy
|
||||||
import strings as S
|
import strings as S
|
||||||
|
|
||||||
|
|
||||||
@@ -6,7 +6,7 @@ from collections.abc import Awaitable, Callable
|
|||||||
import discord
|
import discord
|
||||||
from discord import app_commands
|
from discord import app_commands
|
||||||
|
|
||||||
import economy
|
from core import economy
|
||||||
import strings as S
|
import strings as S
|
||||||
|
|
||||||
|
|
||||||
@@ -7,7 +7,7 @@ from collections.abc import Awaitable, Callable
|
|||||||
import discord
|
import discord
|
||||||
from discord import app_commands
|
from discord import app_commands
|
||||||
|
|
||||||
import economy
|
from core import economy
|
||||||
import strings as S
|
import strings as S
|
||||||
|
|
||||||
|
|
||||||
@@ -5,7 +5,7 @@ from collections.abc import Callable
|
|||||||
import discord
|
import discord
|
||||||
from discord import app_commands
|
from discord import app_commands
|
||||||
|
|
||||||
import economy
|
from core import economy
|
||||||
import strings as S
|
import strings as S
|
||||||
|
|
||||||
|
|
||||||
@@ -6,7 +6,7 @@ from collections.abc import Callable
|
|||||||
import discord
|
import discord
|
||||||
from discord import app_commands
|
from discord import app_commands
|
||||||
|
|
||||||
import economy
|
from core import economy
|
||||||
import strings as S
|
import strings as S
|
||||||
|
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@ import random
|
|||||||
from datetime import date, datetime, timedelta, timezone
|
from datetime import date, datetime, timedelta, timezone
|
||||||
from typing import TypedDict
|
from typing import TypedDict
|
||||||
|
|
||||||
import pb_client
|
from . import pb_client
|
||||||
|
|
||||||
import strings
|
import strings
|
||||||
|
|
||||||
@@ -9,7 +9,7 @@ from dataclasses import dataclass, field
|
|||||||
import discord
|
import discord
|
||||||
|
|
||||||
import config
|
import config
|
||||||
import sheets
|
from . import sheets
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
_PLACEHOLDER = {"-", "x", "n/a", "none", "ei"}
|
_PLACEHOLDER = {"-", "x", "n/a", "none", "ei"}
|
||||||
@@ -23,12 +23,12 @@ from pathlib import Path
|
|||||||
|
|
||||||
from dotenv import load_dotenv
|
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))
|
sys.path.insert(0, str(Path(__file__).parent.parent))
|
||||||
|
|
||||||
load_dotenv()
|
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"
|
DATA_FILE = Path("data") / "economy.json"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user