Update imports for new file structure.
This commit is contained in:
@@ -8,9 +8,9 @@ from fastapi import FastAPI
|
||||
from git import Repo
|
||||
from nextcord.ext import commands
|
||||
|
||||
from classes.gitea_webhook import GiteaWebhook
|
||||
from DakinySettings import settings
|
||||
from utils import REPO_DIR, edit_clan_council_info, update_clan_messages
|
||||
from dakiny_bot.classes.gitea_webhook import GiteaWebhook
|
||||
from dakiny_bot.DakinySettings import settings
|
||||
from dakiny_bot.utils import REPO_DIR, edit_clan_council_info, update_clan_messages
|
||||
|
||||
if TYPE_CHECKING:
|
||||
import nextcord
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
|
||||
from nextcord.ext import commands
|
||||
|
||||
from cogs.commands.record import RecordCog
|
||||
from cogs.commands.refresh import RefreshCog
|
||||
from cogs.commands.remove import RemoveCog
|
||||
from cogs.commands.request import RequestCog
|
||||
from cogs.commands.set import SetCog
|
||||
from cogs.commands.settings import SettingsCog
|
||||
from cogs.commands.test import TestCog
|
||||
from cogs.commands.time import TimeCog
|
||||
from cogs.commands.view import ViewCog
|
||||
from dakiny_bot.cogs.commands.record import RecordCog
|
||||
from dakiny_bot.cogs.commands.refresh import RefreshCog
|
||||
from dakiny_bot.cogs.commands.remove import RemoveCog
|
||||
from dakiny_bot.cogs.commands.request import RequestCog
|
||||
from dakiny_bot.cogs.commands.set import SetCog
|
||||
from dakiny_bot.cogs.commands.settings import SettingsCog
|
||||
from dakiny_bot.cogs.commands.test import TestCog
|
||||
from dakiny_bot.cogs.commands.time import TimeCog
|
||||
from dakiny_bot.cogs.commands.view import ViewCog
|
||||
|
||||
|
||||
# This function will be called when this extension is loaded.
|
||||
|
||||
@@ -4,8 +4,8 @@ import nextcord
|
||||
from discord import TextInputStyle
|
||||
from nextcord.ext import commands
|
||||
|
||||
from DakinySettings import settings
|
||||
from utils import GUILDS, MAX_DISCORD_MESSAGE_LENGTH, PointType, record_points
|
||||
from dakiny_bot.DakinySettings import settings
|
||||
from dakiny_bot.utils import GUILDS, MAX_DISCORD_MESSAGE_LENGTH, PointType, record_points
|
||||
|
||||
|
||||
class RecordCog(commands.Cog, name="Record Commands"):
|
||||
|
||||
@@ -6,7 +6,7 @@ from pathlib import Path
|
||||
import nextcord
|
||||
from nextcord.ext import commands
|
||||
|
||||
from utils import MESSAGES_DIR, edit_clan_council_info, update_clan_messages
|
||||
from dakiny_bot.utils import MESSAGES_DIR, edit_clan_council_info, update_clan_messages
|
||||
|
||||
|
||||
class RefreshCog(commands.Cog, name="Refresh Commands"):
|
||||
|
||||
@@ -5,7 +5,7 @@ from nextcord.ext import commands
|
||||
from sqlalchemy import delete, select
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from database_setup.sql_data_classes import Presences, engine
|
||||
from dakiny_bot.database.sql_data_classes import Presences, engine
|
||||
|
||||
|
||||
class RemoveCog(commands.Cog, name="Remove Commands"):
|
||||
@@ -54,14 +54,14 @@ class RemoveCog(commands.Cog, name="Remove Commands"):
|
||||
"""
|
||||
with Session(engine) as session:
|
||||
stmt = select(Presences)
|
||||
presences_dict: dict[str,str] = {pres.Presence: str(pres.Id) for pres in session.scalars(stmt)}
|
||||
presences_dict: dict[str, str] = {pres.Presence: str(pres.Id) for pres in session.scalars(stmt)}
|
||||
|
||||
# if empty compare string
|
||||
if not presence_str:
|
||||
await interaction.response.send_autocomplete(dict(list(presences_dict.items())[:25]))
|
||||
return
|
||||
|
||||
autofilled_presences: dict[str,str] = {
|
||||
autofilled_presences: dict[str, str] = {
|
||||
pres: pres_id for pres, pres_id in presences_dict.items() if presence_str.lower() in pres.lower()
|
||||
}
|
||||
await interaction.response.send_autocomplete(autofilled_presences[:25])
|
||||
|
||||
@@ -4,8 +4,8 @@ import nextcord
|
||||
from nextcord.ext import commands
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from DakinySettings import settings
|
||||
from database_setup.sql_data_classes import Presences, engine
|
||||
from dakiny_bot.DakinySettings import settings
|
||||
from dakiny_bot.database.sql_data_classes import Presences, engine
|
||||
|
||||
|
||||
class RequestCog(commands.Cog, name="Request Commands"):
|
||||
|
||||
@@ -8,8 +8,8 @@ from sqlalchemy import delete, select
|
||||
from sqlalchemy.exc import IntegrityError
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from database_setup.sql_data_classes import UserBirthday, engine
|
||||
from main import birthday_list
|
||||
from dakiny_bot.app import birthday_list
|
||||
from dakiny_bot.database.sql_data_classes import UserBirthday, engine
|
||||
|
||||
|
||||
class SetCog(commands.Cog, name="Set Commands"):
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
import nextcord
|
||||
from nextcord.ext import commands
|
||||
|
||||
from DakinySettings import settings
|
||||
from utils import GUILDS
|
||||
from dakiny_bot.DakinySettings import settings
|
||||
from dakiny_bot.utils import GUILDS
|
||||
|
||||
|
||||
class SettingsCog(commands.Cog, name="Settings Commands"):
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
import nextcord
|
||||
from nextcord.ext import application_checks, commands
|
||||
|
||||
from classes.election import Election
|
||||
from DakinySettings import settings
|
||||
from utils import GUILDS, get_active_election_cycle, get_quarter_name
|
||||
from dakiny_bot.classes.election import Election
|
||||
from dakiny_bot.DakinySettings import settings
|
||||
from dakiny_bot.utils import GUILDS, get_active_election_cycle, get_quarter_name
|
||||
|
||||
ME = 206602713511886849
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ from datetime import MAXYEAR, MINYEAR, UTC, datetime
|
||||
import nextcord
|
||||
from nextcord.ext import commands
|
||||
|
||||
from utils import GUILDS
|
||||
from dakiny_bot.utils import GUILDS
|
||||
|
||||
|
||||
class TimeCog(commands.Cog, name="Time Commands"):
|
||||
|
||||
@@ -6,13 +6,13 @@ from nextcord.ext import commands
|
||||
from sqlalchemy import select
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from database_setup.sql_data_classes import (
|
||||
from dakiny_bot.database.sql_data_classes import (
|
||||
Points,
|
||||
Presences,
|
||||
Votes,
|
||||
engine,
|
||||
)
|
||||
from utils import GUILDS, MAX_DISCORD_MESSAGE_LENGTH, PointType, VoteType
|
||||
from dakiny_bot.utils import GUILDS, MAX_DISCORD_MESSAGE_LENGTH, PointType, VoteType
|
||||
|
||||
|
||||
class ViewCog(commands.Cog, name="View Commands"):
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
from nextcord.ext import commands
|
||||
|
||||
from cogs.loops.bot_presence import BotPresence
|
||||
from cogs.loops.daily_loop import DailyLoop
|
||||
from dakiny_bot.cogs.loops.bot_presence import BotPresence
|
||||
from dakiny_bot.cogs.loops.daily_loop import DailyLoop
|
||||
|
||||
|
||||
def setup(bot: commands.Bot) -> None:
|
||||
|
||||
@@ -5,7 +5,7 @@ from nextcord.ext import commands, tasks
|
||||
from sqlalchemy import func, select
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from database_setup.sql_data_classes import Presences, engine
|
||||
from dakiny_bot.database.sql_data_classes import Presences, engine
|
||||
|
||||
|
||||
class BotPresence(commands.Cog, name="Bot Presence"):
|
||||
|
||||
@@ -9,11 +9,11 @@ from pytz import timezone
|
||||
from sqlalchemy import select
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from classes.election import Election
|
||||
from DakinySettings import settings
|
||||
from database_setup.sql_data_classes import UserBirthday, engine
|
||||
from main import birthday_list
|
||||
from utils import get_active_election_cycle
|
||||
from dakiny_bot.app import birthday_list
|
||||
from dakiny_bot.classes.election import Election
|
||||
from dakiny_bot.DakinySettings import settings
|
||||
from dakiny_bot.database.sql_data_classes import UserBirthday, engine
|
||||
from dakiny_bot.utils import get_active_election_cycle
|
||||
|
||||
if TYPE_CHECKING:
|
||||
import nextcord
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import nextcord
|
||||
from nextcord.ext import commands
|
||||
|
||||
from main import birthday_list
|
||||
from dakiny_bot.app import birthday_list
|
||||
|
||||
|
||||
class SubmissionListener(commands.Cog, name="Message Listener"):
|
||||
|
||||
Reference in New Issue
Block a user