Skip to content

Commit

Permalink
added a translate command
Browse files Browse the repository at this point in the history
  • Loading branch information
aaj2005 committed Apr 1, 2024
1 parent 4d30f63 commit e024662
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 24 deletions.
1 change: 0 additions & 1 deletion apollo.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"cogs.commands.date",
"cogs.commands.event_sync",
"cogs.commands.flip",
"cogs.commands.joeltech",
"cogs.commands.karma_admin",
"cogs.commands.karma_blacklist",
"cogs.commands.karma",
Expand Down
22 changes: 0 additions & 22 deletions cogs/commands/joeltech.py

This file was deleted.

13 changes: 12 additions & 1 deletion cogs/commands/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import markovify
from deep_translator import GoogleTranslator
from discord.ext import commands
from discord.ext.commands import Bot, Context
from discord.ext.commands import Bot, Context, clean_content


class Misc(commands.Cog):
Expand Down Expand Up @@ -143,6 +143,17 @@ async def chat(self, ctx: Context, message: str = None, gpt4: bool = False):
async def gpt4(self, ctx: Context, message: str):
await self.chat(ctx, message, True)

@commands.hybrid_command()
async def translate(
self, ctx: Context, source: str, target: str, message: clean_content
):
translated = GoogleTranslator(source=source, target=target).translate(message)
await ctx.send(translated)

@commands.hybrid_command()
async def joeltech(self, ctx: Context):
await ctx.send("<:joel_tech:1217584610029076480>")


async def setup(bot: Bot):
await bot.add_cog(Misc(bot))

0 comments on commit e024662

Please sign in to comment.