Add translate command

This commit is contained in:
Luke Robles 2023-12-30 21:06:37 -08:00
parent 8445b3b4e3
commit ba4eaa9689
2 changed files with 22 additions and 0 deletions

View File

@ -9,6 +9,27 @@ class ActualUtils(commands.Cog):
def __init__(self, bot):
self.bot: commands.Bot = bot
@commands.slash_command(
guild_ids=None,
name="translate",
description="Translate a string",
)
@option(
"query",
description="What you're tryna translate",
input_type="str",
requred=True,
)
async def translate(self, ctx, query: str):
from googletrans import Translator
translator = Translator()
result = translator.translate(query, dest="en").text
await ctx.defer()
await ctx.followup.send(result)
@commands.slash_command(
guild_ids=None,
name="youtube",

View File

@ -1,6 +1,7 @@
beautifulsoup4
cmagick
git+https://github.com/pycord-development/pycord@6a69f6683be41e0c983cd0621eab240e86d37086
googletrans==4.0.0rc1
gTTS
httpx
humanfriendly