From 0ea8ab8cf14a3456d2ed2b41829efbe99463015c Mon Sep 17 00:00:00 2001 From: Fluffy-Bean Date: Tue, 12 Sep 2023 12:13:44 +0100 Subject: [PATCH] Run please --- Bot/Dockerfile | 19 ++++++++++++++----- Bot/lynxie/commands/animals.py | 4 ++-- Bot/lynxie/commands/e621.py | 4 ++-- Bot/lynxie/commands/help.py | 2 +- Bot/lynxie/commands/image.py | 4 ++-- Bot/lynxie/commands/music.py | 2 +- Bot/lynxie/main.py | 8 ++++---- Bot/pyproject.toml | 1 - 8 files changed, 26 insertions(+), 18 deletions(-) diff --git a/Bot/Dockerfile b/Bot/Dockerfile index 48fc4d0..024a882 100644 --- a/Bot/Dockerfile +++ b/Bot/Dockerfile @@ -1,18 +1,27 @@ # syntax=docker/dockerfile:1 FROM alpine:3.18.2 -RUN mkdir /app && mkdir /app/data +# Make a directory for the app +RUN mkdir /app +RUN mkdir /app/lynxie WORKDIR /app -COPY ./lynxie /app +# Copy the app files +COPY ./lynxie/ /app/lynxie/ COPY ./poetry.lock /app COPY ./pyproject.toml /app +# Install dependencies RUN apk update RUN apk --no-cache add python3 py3-pip curl +# Install poetry RUN curl -sSL https://install.python-poetry.org | python3 - -RUN /root/.local/bin/poetry install -RUN /root/.local/bin/poetry run python3 database.py +RUN export PATH="/root/.local/bin:$PATH" -CMD ["/root/.local/bin/poetry", "run", "python3", "main.py"] +# Install the app +RUN poetry install +RUN poetry run python3 database.py + +# Run the app +CMD ["poetry", "run", "python3", "main.py"] diff --git a/Bot/lynxie/commands/animals.py b/Bot/lynxie/commands/animals.py index 72329b9..e0120f4 100644 --- a/Bot/lynxie/commands/animals.py +++ b/Bot/lynxie/commands/animals.py @@ -4,8 +4,8 @@ from io import BytesIO import discord from discord.ext import commands -from .config import TINYFOX_ANIMALS -from .utils import error_message +from lynxie.config import TINYFOX_ANIMALS +from lynxie.utils import error_message class Animals(commands.Cog): diff --git a/Bot/lynxie/commands/e621.py b/Bot/lynxie/commands/e621.py index fc50fd9..234e83a 100644 --- a/Bot/lynxie/commands/e621.py +++ b/Bot/lynxie/commands/e621.py @@ -5,8 +5,8 @@ import requests import discord from discord.ext import commands -from .config import E621_API_KEY, E621_USERNAME, E621_BLACKLIST -from .utils import error_message +from lynxie.config import E621_API_KEY, E621_USERNAME, E621_BLACKLIST +from lynxie.utils import error_message _E621_AUTH = f"{E621_USERNAME}:{E621_API_KEY}".encode("utf-8") diff --git a/Bot/lynxie/commands/help.py b/Bot/lynxie/commands/help.py index 32cb6aa..e53bb04 100644 --- a/Bot/lynxie/commands/help.py +++ b/Bot/lynxie/commands/help.py @@ -1,6 +1,6 @@ import discord from discord.ext import commands -from .config import LYNXIE_PREFIX +from lynxie.config import LYNXIE_PREFIX class Help(commands.Cog): diff --git a/Bot/lynxie/commands/image.py b/Bot/lynxie/commands/image.py index 7a90fc6..8e022a5 100644 --- a/Bot/lynxie/commands/image.py +++ b/Bot/lynxie/commands/image.py @@ -7,8 +7,8 @@ from PIL import Image, ImageEnhance import discord from discord.ext import commands -from .config import IMAGE_EXTENSIONS, IMAGE_OVERLAYS -from .utils import error_message +from lynxie.config import IMAGE_EXTENSIONS, IMAGE_OVERLAYS +from lynxie.utils import error_message class Img(commands.Cog): diff --git a/Bot/lynxie/commands/music.py b/Bot/lynxie/commands/music.py index 928a063..352fa90 100644 --- a/Bot/lynxie/commands/music.py +++ b/Bot/lynxie/commands/music.py @@ -1,7 +1,7 @@ import yt_dlp import discord from discord.ext import commands -from .utils import error_message +from lynxie.utils import error_message ffmpeg_options = {"options": "-vn"} diff --git a/Bot/lynxie/main.py b/Bot/lynxie/main.py index 8b05833..e03ff48 100644 --- a/Bot/lynxie/main.py +++ b/Bot/lynxie/main.py @@ -7,10 +7,10 @@ import discord from discord.ext import commands from discord.gateway import DiscordWebSocket -from .config import DISCORD_TOKEN, LYNXIE_PREFIX -from .database import CommandHistory, Database -from .utils import mobile_status, error_message -from .commands import Help, Ping, Hello, Music, Animals, Img, E621 +from config import DISCORD_TOKEN, LYNXIE_PREFIX +from database import CommandHistory, Database +from utils import mobile_status, error_message +from lynxie.commands import Help, Ping, Hello, Music, Animals, Img, E621 db = Database() diff --git a/Bot/pyproject.toml b/Bot/pyproject.toml index a46b122..2ae8de9 100644 --- a/Bot/pyproject.toml +++ b/Bot/pyproject.toml @@ -3,7 +3,6 @@ name = "lynxie" version = "0.1.0" description = "" authors = ["Fluffy "] -readme = ".github/README.md" [tool.poetry.dependencies] python = "^3.11"