Kolejny fix

This commit is contained in:
2024-04-05 17:10:46 +02:00
parent e47d7c0ecc
commit 3c0281b77f
+18 -14
View File
@@ -1103,11 +1103,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
) )
file = item.as_posix() return dir_path, file_list.append["wiadomo co wiadomo gdzie"]
if platform == "win32":
file = file.replace("/", "\\")
file_list.append(file)
return dir_path, file_list
# define an asynchronous generator # define an asynchronous generator
async def async_iterator_generator(range_of_iterable): async def async_iterator_generator(range_of_iterable):
@@ -2141,15 +2137,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.")