diff --git a/cogs/imagine_cog.py b/cogs/imagine_cog.py index c1efbf2..cee1db5 100644 --- a/cogs/imagine_cog.py +++ b/cogs/imagine_cog.py @@ -212,23 +212,16 @@ async def cog_load(self): await self.bot.wait_until_ready() self.bot.add_view(ImagineButtonView()) - async def model_autocomplete(self, - interaction: discord.Interaction, - current: str, - ) -> list[app_commands.Choice[str]]: - - return [ - app_commands.Choice(name=choice, value=choice) - for choice in MODELS if current.lower() in choice.lower() - ] - - @app_commands.command(name="pollinate", description="Generate AI Images") - @app_commands.autocomplete(model=model_autocomplete) + @app_commands.choices( + model=[ + app_commands.Choice(name=choice, value=choice) for choice in MODELS + ], + ) @app_commands.guild_only() @app_commands.checks.cooldown(1, 15) - @app_commands.describe(prompt="Imagine a prompt", height="Height of the image", width="Width of the image", negative="The things not to include in the image", cached="Removes the image seed", nologo="Remove the logo", enhance="Disables Prompt enhancing if set to False", private="Only you can see the generated Image if set to True") - async def imagine_command(self, interaction, prompt:str, model: str = "Swizz8", width:int = 1000, height:int = 1000, negative:str|None = None, cached:bool = False, nologo:bool = False, enhance:bool = True, private:bool = False): + @app_commands.describe(prompt="Imagine a prompt", model=f"The AI model to use for generating the image. Default is {MODELS[0]}", height="Height of the image", width="Width of the image", negative="The things not to include in the image", cached="Removes the image seed", nologo="Remove the logo", enhance="Disables Prompt enhancing if set to False", private="Only you can see the generated Image if set to True") + async def imagine_command(self, interaction, prompt:str, model: app_commands.Choice[str] = MODELS[0], width:int = 1000, height:int = 1000, negative:str|None = None, cached:bool = False, nologo:bool = False, enhance:bool = True, private:bool = False): await interaction.response.send_message(embed=discord.Embed(title="Generating Image", description="Please wait while we generate your image", color=discord.Color.blurple()), ephemeral=True) if len(prompt) > 1500: