mirror of
https://github.com/Paillat-dev/presentator.git
synced 2026-01-01 16:56:20 +00:00
Things
This commit is contained in:
@@ -3,6 +3,7 @@ import openai
|
||||
import discord
|
||||
from discord import Intents
|
||||
from discord.commands import slash_command, option
|
||||
from discord.ext import commands
|
||||
import re
|
||||
import os
|
||||
import asyncio
|
||||
@@ -13,6 +14,7 @@ import requests
|
||||
from dotenv import load_dotenv
|
||||
load_dotenv()
|
||||
use_images = os.getenv("USE_IMAGES")
|
||||
cooldown = os.getenv("COOLDOWN")
|
||||
if use_images != "No": import imagesGeneration
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
imageint = ""
|
||||
@@ -42,6 +44,8 @@ async def get_ln(ctx: discord.AutocompleteContext):
|
||||
@option(name="style", description="The style of the presentation", required=False, autocomplete=get_style)
|
||||
@option(name="language", description="The language of the presentation", required=False, autocomplete=get_ln)
|
||||
@option(name="indications", description="The indications for the presentation", required=False)
|
||||
# a cooldown of duration cooldown seconds
|
||||
@commands.cooldown(1, int(cooldown), commands.BucketType.user)
|
||||
async def present(ctx: discord.ApplicationContext, subject: str, style: str = "default", language: str = "english", indications: str = ""):
|
||||
await ctx.defer()
|
||||
date = datetime.datetime.now()
|
||||
|
||||
12
docker/Dockerfile
Normal file
12
docker/Dockerfile
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
# For more information, please refer to https://aka.ms/vscode-docker-python
|
||||
FROM python:3.10.0
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
RUN git clone https://github.com/Paillat-dev/presentator.git
|
||||
RUN pip install -r /presentator/requirements.txt
|
||||
WORKDIR /presentator
|
||||
RUN wget https://github.com/marp-team/marp-cli/releases/download/v2.3.0/marp-cli-v2.3.0-linux.tar.gz
|
||||
RUN tar -xvf marp-cli-v2.3.0-linux.tar.gz
|
||||
RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /presentator
|
||||
USER appuser
|
||||
CMD ["python", "main.py"]
|
||||
@@ -1,2 +1,3 @@
|
||||
openai
|
||||
py-cord
|
||||
py-cord
|
||||
python-dotenv
|
||||
Reference in New Issue
Block a user