check for www or tiktok.com
This commit is contained in:
parent
406d044d64
commit
787e44c6c8
13
app/bot.py
13
app/bot.py
@ -116,18 +116,19 @@ 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 = {
|
||||||
"https://x.com": "vxtwitter",
|
"x.com": "vxtwitter",
|
||||||
"https://twitter.com": "vxtwitter",
|
"twitter.com": "vxtwitter",
|
||||||
"https://tiktok.com": "vxtiktok",
|
"tiktok.com": "vxtiktok",
|
||||||
"https://www.tiktok.com": "vxtiktok",
|
|
||||||
}
|
}
|
||||||
|
if ctx.author.id == bot.user.id:
|
||||||
|
return
|
||||||
for k in correct_domains.keys():
|
for k in correct_domains.keys():
|
||||||
if k in ctx.content:
|
if k in ctx.content or "www.%s.com" % k in ctx.content:
|
||||||
await ctx.channel.send(
|
await ctx.channel.send(
|
||||||
"%s said:\n%s"
|
"%s said:\n%s"
|
||||||
% (
|
% (
|
||||||
ctx.author.mention,
|
ctx.author.mention,
|
||||||
ctx.content.replace(k, "https://%s.com" % correct_domains[k]),
|
ctx.content.replace(k, "%s.com" % correct_domains[k]),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
await ctx.delete()
|
await ctx.delete()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user