diff --git a/token_bot/controller/alerts.py b/token_bot/controller/alerts.py index 0a5dc1e..f032351 100644 --- a/token_bot/controller/alerts.py +++ b/token_bot/controller/alerts.py @@ -4,10 +4,8 @@ from typing import List import aiodynamo.client import aiohttp -from token_bot.persistant_database import Alert, User, AlertType +from token_bot.persistant_database import Alert, User from token_bot.persistant_database import database as pdb -from token_bot.token_database.flavor import Flavor -from token_bot.token_database.region import Region class AlertsController: diff --git a/token_bot/controller/users.py b/token_bot/controller/users.py index f086094..35733e2 100644 --- a/token_bot/controller/users.py +++ b/token_bot/controller/users.py @@ -4,9 +4,8 @@ from typing import List import aiodynamo.client import aiohttp -from token_bot.persistant_database.user_schema import User from token_bot.persistant_database import database as pdb, Alert -from token_bot.controller.alerts import AlertsController as AlertS, AlertsController +from token_bot.persistant_database.user_schema import User class UsersController: diff --git a/token_bot/core.py b/token_bot/core.py index 024633f..62b0c39 100644 --- a/token_bot/core.py +++ b/token_bot/core.py @@ -1,15 +1,10 @@ -import json -import os - import aiohttp -from interactions import Extension, Permissions, SlashContext, OptionType, slash_option -from interactions import check, is_owner, slash_command, slash_default_member_permission, listen -from interactions.api.events import Startup, MessageCreate -from interactions import Task, IntervalTrigger +from interactions import Extension +from interactions import slash_command, listen +from interactions.api.events import Startup - -from token_bot.token_database import database as tdb from token_bot.token_database import database as pdb +from token_bot.token_database import database as tdb VERSION = "0.1.0" diff --git a/token_bot/history_manager/history.py b/token_bot/history_manager/history.py index 845681f..36d9a05 100644 --- a/token_bot/history_manager/history.py +++ b/token_bot/history_manager/history.py @@ -1,5 +1,5 @@ import datetime -from typing import LiteralString, Set, List, Tuple +from typing import List, Tuple from token_bot.history_manager.update_trigger import UpdateTrigger from token_bot.persistant_database import AlertType, Alert diff --git a/token_bot/history_manager/history_manager.py b/token_bot/history_manager/history_manager.py index dfd3fd4..7607555 100644 --- a/token_bot/history_manager/history_manager.py +++ b/token_bot/history_manager/history_manager.py @@ -1,12 +1,12 @@ import datetime -from typing import Set, List, Dict, LiteralString, Tuple +from typing import List, Dict, Tuple from token_bot.history_manager.history import History from token_bot.persistant_database import Alert +from token_bot.token_database import database as tdb from token_bot.token_database.flavor import Flavor from token_bot.token_database.region import Region -from token_bot.token_database import database as tdb class HistoryManager: HIGH_FIDELITY_PERIOD = '72h' diff --git a/token_bot/persistant_database/database.py b/token_bot/persistant_database/database.py index f3632b0..f516d19 100644 --- a/token_bot/persistant_database/database.py +++ b/token_bot/persistant_database/database.py @@ -1,13 +1,9 @@ import os import aiohttp - from aiodynamo.client import Client -from aiodynamo.client import Table from aiodynamo.credentials import Credentials -from aiodynamo.http.httpx import HTTPX from aiodynamo.http.aiohttp import AIOHTTP -from httpx import AsyncClient class Database: diff --git a/token_bot/persistant_database/user_schema.py b/token_bot/persistant_database/user_schema.py index 89098fb..70b51b5 100644 --- a/token_bot/persistant_database/user_schema.py +++ b/token_bot/persistant_database/user_schema.py @@ -1,12 +1,11 @@ -from typing import List, Tuple, Dict +from typing import List, Dict from aiodynamo.client import Table from aiodynamo.errors import ItemNotFound - -from token_bot.token_database.flavor import Flavor -from token_bot.token_database.region import Region import token_bot.persistant_database as pdb +from token_bot.token_database.region import Region + class User: def __init__(self, user_id: int, region: Region = None, subscribed_alerts: List['pdb.Alert'] = None) -> None: diff --git a/token_bot/token_bot.py b/token_bot/token_bot.py index 5ef425b..ca684c5 100644 --- a/token_bot/token_bot.py +++ b/token_bot/token_bot.py @@ -1,7 +1,6 @@ -import os import logging +import os -import aiohttp from dotenv import load_dotenv from interactions import Client, Intents diff --git a/token_bot/token_database/database.py b/token_bot/token_database/database.py index 87a9116..98efbf1 100644 --- a/token_bot/token_database/database.py +++ b/token_bot/token_database/database.py @@ -1,9 +1,9 @@ from typing import Dict, List -from token_bot.token_database.flavor import Flavor -from token_bot.token_database.exceptions import * -import aiohttp -import json +import aiohttp + +from token_bot.token_database.exceptions import * +from token_bot.token_database.flavor import Flavor from token_bot.token_database.region import Region diff --git a/token_bot/tracker.py b/token_bot/tracker.py index 0f7ee94..47c8f3e 100644 --- a/token_bot/tracker.py +++ b/token_bot/tracker.py @@ -1,37 +1,29 @@ import copy -import json import logging -import os -from enum import Enum -from typing import Any, Type, Dict, List +from typing import Type, Dict, List import aiohttp -from interactions import Extension, Permissions, SlashContext, OptionType, slash_option, component_callback, \ +from interactions import Extension, SlashContext, component_callback, \ ComponentContext, StringSelectMenu, Message -from interactions import check, is_owner, slash_command, slash_default_member_permission, listen -from interactions.api.events import Startup, MessageCreate -from interactions.api.events import Component from interactions import Task, IntervalTrigger +from interactions import slash_command, listen +from interactions.api.events import Component +from interactions.api.events import Startup +from token_bot.controller.alerts import AlertsController +from token_bot.controller.users import UsersController from token_bot.history_manager.history_manager import HistoryManager -from token_bot.persistant_database import database as pdb -from token_bot.token_database import database as tdb - -from token_bot.token_database.flavor import Flavor -from token_bot.token_database.region import Region - -from token_bot.persistant_database.user_schema import User +from token_bot.persistant_database.alert_category import AlertCategory from token_bot.persistant_database.alert_schema import Alert from token_bot.persistant_database.alert_type import AlertType -from token_bot.persistant_database.alert_category import AlertCategory - -from token_bot.controller.users import UsersController -from token_bot.controller.alerts import AlertsController +from token_bot.persistant_database.user_schema import User +from token_bot.token_database import database as tdb +from token_bot.token_database.flavor import Flavor +from token_bot.token_database.region import Region from token_bot.ui.action_row.tracker import ALERT_TYPE_ROW - -from token_bot.ui.select_menus.region_menu import REGION_MENU -from token_bot.ui.select_menus.flavor_menu import FLAVOR_MENU from token_bot.ui.select_menus.alert_menu import HIGH_ALERT_MENU, LOW_ALERT_MENU +from token_bot.ui.select_menus.flavor_menu import FLAVOR_MENU +from token_bot.ui.select_menus.region_menu import REGION_MENU class Tracker(Extension): diff --git a/token_bot/ui/action_row/tracker.py b/token_bot/ui/action_row/tracker.py index f45ab51..f404785 100644 --- a/token_bot/ui/action_row/tracker.py +++ b/token_bot/ui/action_row/tracker.py @@ -1,7 +1,6 @@ from interactions import ActionRow -from token_bot.ui.buttons.tracker.alert_category import HIGH_ALERT_BUTTON, LOW_ALERT_BUTTON, CUSTOM_ALERT_BUTTON - +from token_bot.ui.buttons.tracker.alert_category import HIGH_ALERT_BUTTON, LOW_ALERT_BUTTON ALERT_TYPE_ROW: list[ActionRow] = [ ActionRow(