Add translate command
This commit is contained in:
parent
8445b3b4e3
commit
ba4eaa9689
@ -9,6 +9,27 @@ class ActualUtils(commands.Cog):
|
|||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
self.bot: commands.Bot = 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(
|
@commands.slash_command(
|
||||||
guild_ids=None,
|
guild_ids=None,
|
||||||
name="youtube",
|
name="youtube",
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
beautifulsoup4
|
beautifulsoup4
|
||||||
cmagick
|
cmagick
|
||||||
git+https://github.com/pycord-development/pycord@6a69f6683be41e0c983cd0621eab240e86d37086
|
git+https://github.com/pycord-development/pycord@6a69f6683be41e0c983cd0621eab240e86d37086
|
||||||
|
googletrans==4.0.0rc1
|
||||||
gTTS
|
gTTS
|
||||||
httpx
|
httpx
|
||||||
humanfriendly
|
humanfriendly
|
||||||
|
Loading…
x
Reference in New Issue
Block a user