correct twitter to vxtwitter.com even though it wont embed on iphones

This commit is contained in:
Luke Robles 2024-03-25 16:47:50 -07:00
parent 387a4416ee
commit 94a1c9a330

View File

@ -126,31 +126,31 @@ async def convert_heic_to_jpg(ctx):
return
# @bot.listen("on_message")
# async def fix_social_media_links(ctx):
# correct_domains = {
# "https://x.com": "vxtwitter",
# "https://www.x.com": "vxtwitter",
# "https://twitter.com": "vxtwitter",
# "https://www.twitter.com": "vxtwitter",
@bot.listen("on_message")
async def fix_social_media_links(ctx):
correct_domains = {
"https://x.com": "vxtwitter",
"https://www.x.com": "vxtwitter",
"https://twitter.com": "vxtwitter",
"https://www.twitter.com": "vxtwitter",
# "https://tiktok.com": "vxtiktok",
# "https://www.tiktok.com": "vxtiktok",
# }
# if ctx.author.id == bot.user.id:
# return
# for k in correct_domains.keys():
# if ctx.content.startswith(k) or ctx.content.startswith("www.{k}.com"):
# await ctx.channel.send(
# "%s said:\n%s"
# % (
# ctx.author.mention,
# ctx.content.replace(k, "https://%s.com" % correct_domains[k]).split(
# "?"
# )[0],
# )
# )
# await ctx.delete()
# return
}
if ctx.author.id == bot.user.id:
return
for k in correct_domains.keys():
if ctx.content.startswith(k) or ctx.content.startswith("www.{k}.com"):
await ctx.channel.send(
"%s said:\n%s"
% (
ctx.author.mention,
ctx.content.replace(k, "https://%s.com" % correct_domains[k]).split(
"?"
)[0],
)
)
await ctx.delete()
return
@bot.event