From 4b3b79dc211f9a1a612fa49ef8548381606c4b06 Mon Sep 17 00:00:00 2001 From: Paillat Date: Mon, 6 Feb 2023 10:40:33 +0100 Subject: [PATCH] Update main.py --- main.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index cd6e6a9..870c1c7 100644 --- a/main.py +++ b/main.py @@ -38,14 +38,30 @@ async def get_ln(ctx: discord.AutocompleteContext): """Returns a list of colors that begin with the characters entered so far.""" return [color for color in languages if color.startswith(ctx.value.lower())] +@bot.slash_command(name="private_present", description="Generate a presentation with marp, private command for user 707196665668436019") +#we create a function that takes the subject of the presentation and the style of the presentation as arguments, and that +@option(name="subject", description="The subject of the presentation", required=True) +@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) +#command wprks only in dm and only for user 707196665668436019 +@commands.is_owner() +async def private_present(ctx: discord.ApplicationContext, subject: str, style: str = "default", language: str = "english", indications: str = ""): + await ctx.defer() + await present(ctx, subject, style, language, indications) + + + + @bot.slash_command(name="present", description="Generate a presentation with marp") #we create a function that takes the subject of the presentation and the style of the presentation as arguments, and that @option(name="subject", description="The subject of the presentation", required=True) @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) +# a cooldown of duration cooldown seconds, except if the user is 707196665668436019 + +#@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()