Fixed the error with french_str, credited SPPayne

This commit is contained in:
TheScriptPony 2021-01-09 16:32:46 -05:00
parent 7caa3222ed
commit 8aecf2ca03
2 changed files with 8 additions and 1 deletions

View file

@ -1,6 +1,7 @@
{ {
"author": [ "author": [
"TheScriptPony" "TheScriptPony",
"SPPayne"
], ],
"description": "Meakes things memey.", "description": "Meakes things memey.",
"install_msg": "( ͡° ͜ʖ ͡°)", "install_msg": "( ͡° ͜ʖ ͡°)",

View file

@ -78,6 +78,7 @@ class Memeify(commands.Cog):
return bif.replace("b", "🅱️") return bif.replace("b", "🅱️")
# ------------ frenchify ------------ # ------------ frenchify ------------
# Based heavily on SSPayne's fake french accent translator
@commands.command() @commands.command()
async def frenchify(self, ctx, *, content: str = None): async def frenchify(self, ctx, *, content: str = None):
"""Writes a message with a french accent""" """Writes a message with a french accent"""
@ -92,6 +93,8 @@ class Memeify(commands.Cog):
if cmd: if cmd:
french_cmd_fix = french.split(" ") french_cmd_fix = french.split(" ")
french_str = " ".join(french_cmd_fix[1:]) french_str = " ".join(french_cmd_fix[1:])
else:
french_str = french
emoji_match = re.finditer(custom_emoji, french_str) emoji_match = re.finditer(custom_emoji, french_str)
for i in emoji_match: for i in emoji_match:
@ -106,6 +109,9 @@ class Memeify(commands.Cog):
return "".join(final) return "".join(final)
# translated from SPPayne's fake french accent translator,
# as well as __compare_format() and __make_funny_es()
# https://github.com/SPPayne/fake_french_accent_translator
def __french(self, text): def __french(self, text):
text = text.replace("age", "aje") text = text.replace("age", "aje")
text = text.replace("ale", "aile") text = text.replace("ale", "aile")