Use the 𝕏 instead of X

This commit is contained in:
Nexus 2024-04-02 15:49:34 +01:00
parent ff6f324ddf
commit b60d39c74a
Signed by: nex
GPG key ID: 0FA334385D0B689F

View file

@ -197,21 +197,19 @@ class Events(commands.Cog):
elif "boris" in words and (file := assets / "boris.jpg").exists(): elif "boris" in words and (file := assets / "boris.jpg").exists():
await message.reply(file=discord.File(file), delete_after=60) await message.reply(file=discord.File(file), delete_after=60)
elif "twitter" in words or "vxtwitter" in words: elif "twitter" in words or "vxtwitter" in words:
new_words = [] new_content = re.sub(
for word in words: r"(^|\W+)twitter",
if word.lower() == "twitter": lambda m: f'~~{m.group()}~~ \U0001D54F',
new_words.append("~~%s~~ **X**" % word) message.content,
else: flags=re.IGNORECASE
new_words.append(word) )
new_content = " ".join(new_words)
if len(new_content) > 2000: if len(new_content) > 2000:
new_words = [] new_content = re.sub(
for word in words: r"(^|\W+)twitter",
if word.lower() == "twitter": '\U0001D54F',
new_words.append("**X**") message.content,
else: flags=re.IGNORECASE
new_words.append(word) )
new_content = " ".join(new_words)
new_content = new_content.replace("vxtwitter", "fixupx") new_content = new_content.replace("vxtwitter", "fixupx")
await message.reply(new_content, delete_after=300) await message.reply(new_content, delete_after=300)