diff --git a/Bot/Dockerfile b/Bot/Dockerfile index 06a38bc..d77bbbb 100644 --- a/Bot/Dockerfile +++ b/Bot/Dockerfile @@ -17,10 +17,7 @@ RUN apk --no-cache add python3 py3-pip curl # Install poetry RUN curl -sSL https://install.python-poetry.org | python3 - - -# Install the app RUN /root/.local/bin/poetry install -RUN /root/.local/bin/poetry run python3 /app/lynxie/database.py # Run the app CMD ["/root/.local/bin/poetry", "run", "python3", "/app/lynxie/main.py"] diff --git a/Bot/lynxie/database.py b/Bot/lynxie/database.py deleted file mode 100644 index b41badd..0000000 --- a/Bot/lynxie/database.py +++ /dev/null @@ -1,32 +0,0 @@ -from sqlalchemy import create_engine, Column, Integer, String, DateTime -from sqlalchemy.orm import declarative_base, sessionmaker -from lynxie.config import DATABASE_URI - - -Base = declarative_base() - - -class CommandHistory(Base): - __tablename__ = "command_history" - - id = Column(Integer, primary_key=True) - command = Column(String) - user = Column(Integer) - channel = Column(Integer) - guild = Column(Integer) - timestamp = Column(DateTime) - - -class Database: - def __init__(self): - self.engine = create_engine(DATABASE_URI) - self.session = sessionmaker(bind=self.engine) - self.session = self.session() - - def make_database(self): - Base.metadata.create_all(self.engine) - - -if __name__ == "__main__": - db = Database() - db.make_database() diff --git a/Bot/lynxie/main.py b/Bot/lynxie/main.py index dfe9ce0..b991b76 100644 --- a/Bot/lynxie/main.py +++ b/Bot/lynxie/main.py @@ -8,12 +8,10 @@ from discord.ext import commands from discord.gateway import DiscordWebSocket from lynxie.config import DISCORD_TOKEN, LYNXIE_PREFIX -from lynxie.database import CommandHistory, Database from lynxie.utils import mobile_status, error_message from lynxie.commands import Help, Ping, Hello, Music, Animals, Img, E621 -db = Database() DiscordWebSocket.identify = mobile_status lynxie = commands.Bot( intents=discord.Intents.all(), @@ -32,17 +30,6 @@ async def on_command(ctx): if ctx.author == lynxie.user or ctx.author.bot: return - query = CommandHistory( - command=ctx.command.name, - user=ctx.author.id, - channel=ctx.channel.id, - guild=ctx.guild.id, - timestamp=ctx.message.created_at, - ) - - db.session.add(query) - db.session.commit() - @lynxie.event async def on_command_error(ctx, error):