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():
await message.reply(file=discord.File(file), delete_after=60)
elif "twitter" in words or "vxtwitter" in words:
new_words = []
for word in words:
if word.lower() == "twitter":
new_words.append("~~%s~~ **X**" % word)
else:
new_words.append(word)
new_content = " ".join(new_words)
new_content = re.sub(
r"(^|\W+)twitter",
lambda m: f'~~{m.group()}~~ \U0001D54F',
message.content,
flags=re.IGNORECASE
)
if len(new_content) > 2000:
new_words = []
for word in words:
if word.lower() == "twitter":
new_words.append("**X**")
else:
new_words.append(word)
new_content = " ".join(new_words)
new_content = re.sub(
r"(^|\W+)twitter",
'\U0001D54F',
message.content,
flags=re.IGNORECASE
)
new_content = new_content.replace("vxtwitter", "fixupx")
await message.reply(new_content, delete_after=300)