Hooks can't be async
All checks were successful
Build and Publish Jimmy.2 / build_and_publish (push) Successful in 7s

This commit is contained in:
Nexus 2024-05-31 03:06:47 +01:00
parent fb4935e331
commit 858782eec8
Signed by: nex
GPG key ID: 0FA334385D0B689F

View file

@ -263,7 +263,7 @@ class YTDLCog(commands.Cog):
last_edit = time.time()
options = self.default_options.copy()
async def _download_hook(_data: dict[str, typing.Any]):
def _download_hook(_data: dict[str, typing.Any]):
n = time.time()
_total = _data.get("total_bytes", _data.get("total_bytes_estimate"))
if _total:
@ -282,7 +282,7 @@ class YTDLCog(commands.Cog):
if (n - last_edit) >= 5:
embed.clear_fields()
embed.add_field(name="Progress", value=line)
await ctx.edit(embed=embed)
ctx.bot.loop.create_task(ctx.edit(embed=embed))
last_edit = time.time()
options["progress_hooks"] = [_download_hook]