fix bug targeting ALL links instead of only tiktok

This commit is contained in:
Mylloon 2021-09-06 19:09:38 +02:00
parent 174072f645
commit f4c43eb150

View file

@ -207,6 +207,8 @@ class Internet(commands.Cog):
return return
urls = findall(r'http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', message.content) urls = findall(r'http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', message.content)
for url in urls: for url in urls:
if "tiktok.com" not in url:
return
url_embed = url.replace("tiktok.com", "dstn.to") url_embed = url.replace("tiktok.com", "dstn.to")
if message.content == url.replace(" ", ""): if message.content == url.replace(" ", ""):
await message.channel.send(f"Tiktok partagé par {message.author.mention}{url.replace('tiktok.com', 'dstn.to')}") await message.channel.send(f"Tiktok partagé par {message.author.mention}{url.replace('tiktok.com', 'dstn.to')}")