Skip to content

Commit

Permalink
first pass at implementing neptunfej
Browse files Browse the repository at this point in the history
  • Loading branch information
Gilgames32 committed Sep 7, 2024
1 parent ff0f500 commit ddb381f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions cogs/captioncog.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from util.msgutil import devcheck, errorembed, errorrespond

from caption.src.pipeline import caption
import neptunfej

class CaptionCog(commands.Cog):
def __init__(self, bot: commands.Bot) -> None:
Expand Down Expand Up @@ -32,6 +33,21 @@ async def captioning(self, interaction: discord.Interaction, link: str = None, t
await interaction.followup.send(text, file=discord.File(out))
except Exception as e:
await interaction.followup.send(embed=errorembed(str(e)))

# neptunfej
@app_commands.allowed_installs(guilds=True, users=True)
@app_commands.allowed_contexts(guilds=True, dms=True, private_channels=True)
@app_commands.command(name="neptun", description="/pa")
async def neptun(self, interaction: discord.Interaction, text: str = "forgot the caption") -> None:
if not await devcheck(interaction):
return

await interaction.response.defer()
try:
out = neptunfej.generate(text, 2, (10, 10))
await interaction.followup.send(text, file=discord.File(out))
except Exception as e:
await interaction.followup.send(embed=errorembed(str(e)))



Expand Down

0 comments on commit ddb381f

Please sign in to comment.