Skip to content

Commit

Permalink
april fools stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Mole1424 committed Apr 1, 2024
1 parent 7aba37c commit b204539
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 21 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,5 @@ tmp/
*.log
*.sqlite3

/resources/rooms/images
/resources/rooms/images
general.txt
30 changes: 10 additions & 20 deletions cogs/commands/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,29 +129,19 @@ async def babbage(self, ctx: Context):
"Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?"
)

# April Fools' Day 2024
@commands.hybrid_command()
async def chat(self, ctx: Context, message: str = None, gpt4: bool = False):
message = self.model.make_sentence()
translated = (
GoogleTranslator(source="en", target="fr").translate(message)
if gpt4
else message
)
await ctx.send(translated)
async def markov(self, ctx: Context):
"""Generate a sentence using a markov chain model"""
await ctx.send(self.model.make_sentence())

@commands.hybrid_command()
async def gpt4(self, ctx: Context, message: str):
await self.chat(ctx, message, True)

translateHelp = """
translate_help = """
Translate a message from one language (source) to another (target)
To reply translate, ignore the message parameter
"""
To reply translate, ignore the message parameter """

@commands.hybrid_command(
help=translateHelp, brief="translate text from one language to another"
help=translate_help, brief="translate text from one language to another"
)
async def translate(
self,
Expand All @@ -161,9 +151,9 @@ async def translate(
*,
message: str = "<Empty Message>",
):
repliedMessage = ctx.message.reference
if repliedMessage is not None:
message = await ctx.channel.fetch_message(repliedMessage.message_id)
replied_message = ctx.message.reference
if replied_message is not None:
message = await ctx.channel.fetch_message(replied_message.message_id)
message = message.content
translated = GoogleTranslator(source=source, target=target).translate(message)
await ctx.send(translated)
Expand Down

0 comments on commit b204539

Please sign in to comment.