fix issue with double adding fx to vx
This commit is contained in:
parent
2f202240ac
commit
e5febe8dcb
11
app/bot.py
11
app/bot.py
@ -116,9 +116,12 @@ async def convert_heic_to_jpg(ctx):
|
|||||||
@bot.listen("on_message")
|
@bot.listen("on_message")
|
||||||
async def fix_social_media_links(ctx):
|
async def fix_social_media_links(ctx):
|
||||||
correct_domains = {
|
correct_domains = {
|
||||||
"x.com": "vxtwitter",
|
"https://x.com": "vxtwitter",
|
||||||
"twitter.com": "vxtwitter",
|
"https://www.x.com": "vxtwitter",
|
||||||
"tiktok.com": "vxtiktok",
|
"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:
|
if ctx.author.id == bot.user.id:
|
||||||
return
|
return
|
||||||
@ -128,7 +131,7 @@ async def fix_social_media_links(ctx):
|
|||||||
"%s said:\n%s"
|
"%s said:\n%s"
|
||||||
% (
|
% (
|
||||||
ctx.author.mention,
|
ctx.author.mention,
|
||||||
ctx.content.replace(k, "%s.com" % correct_domains[k]),
|
ctx.content.replace(k, "https://%s.com" % correct_domains[k]),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
await ctx.delete()
|
await ctx.delete()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user