This is seriously last fix

description update

last fix ?

Small fix

Kolejny fix

Final fix

FX2

fx
This commit is contained in:
2024-04-05 16:39:59 +02:00
committed by migatu
parent ae0d807714
commit 82273df13c
+19 -18
View File
@@ -782,14 +782,7 @@ async def get_file(ctx, source, link):
logger.info( logger.info(
"Failed to download %s, make sure yt_dlp is up to date", link "Failed to download %s, make sure yt_dlp is up to date", link
) )
extract = re.search("v=(...........)[&,$]*", link) file_list.append("wiadomo co wiadomo gdzie")
ident = extract.group(1)
for item in Path.glob(Path(dir_path), "**/*.mp3"):
file = item.as_posix()
if platform == "win32":
file = file.replace("/", "\\")
if re.match(".*" + ident + ".*", file):
file_list.append(file)
return dir_path, file_list return dir_path, file_list
# define an asynchronous generator # define an asynchronous generator
@@ -1694,7 +1687,7 @@ async def parametry_muzyki_mego_ludu(ctx, ile_historii=1500, ile_slow_kluczowych
@client.hybrid_command( @client.hybrid_command(
name="krecimy_pornola", name="krecimy_pornola",
description="Podaj link do youtube - sciagnie i doda muzyke", description="Wiadomo co, dla kogo i po co",
guild=discord.Object(id=664789470779932693), guild=discord.Object(id=664789470779932693),
) )
async def krecimy_pornola(ctx): async def krecimy_pornola(ctx):
@@ -1707,15 +1700,23 @@ async def krecimy_pornola(ctx):
with the Discord API and with the Discord API and
""" """
await ctx.send("Dej mnie chwilkę") await ctx.send("Dej mnie chwilkę")
logger.info("Pornol") allowed = False
async with ctx.typing(): for role in ctx.author.roles:
# wyciagnij linka z kontekstu if role.name == "Bartender":
content = ctx.message.content.split() allowed = True
for item_yt in content: if allowed:
if re.match("http.*", item_yt): logger.info("Pornol")
_, files = await get_file(ctx, "Pornol", item_yt) async with ctx.typing():
if files: # wyciagnij linka z kontekstu
logger.info("Pornol udany") content = ctx.message.content.split()
for item_yt in content:
if re.match("http.*", item_yt):
sciezka, files = await get_file(ctx, "Pornol", item_yt)
if files:
logger.info("Pornol udany")
ctx.reply(f"Jest w tajnym archiwum pod adresem{sciezka})")
else:
ctx.reply("Jak ładnie szefa poprosisz.")