Hooks can't be async
All checks were successful
Build and Publish Jimmy.2 / build_and_publish (push) Successful in 7s
All checks were successful
Build and Publish Jimmy.2 / build_and_publish (push) Successful in 7s
This commit is contained in:
parent
fb4935e331
commit
858782eec8
1 changed files with 2 additions and 2 deletions
|
@ -263,7 +263,7 @@ class YTDLCog(commands.Cog):
|
||||||
last_edit = time.time()
|
last_edit = time.time()
|
||||||
options = self.default_options.copy()
|
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()
|
n = time.time()
|
||||||
_total = _data.get("total_bytes", _data.get("total_bytes_estimate"))
|
_total = _data.get("total_bytes", _data.get("total_bytes_estimate"))
|
||||||
if _total:
|
if _total:
|
||||||
|
@ -282,7 +282,7 @@ class YTDLCog(commands.Cog):
|
||||||
if (n - last_edit) >= 5:
|
if (n - last_edit) >= 5:
|
||||||
embed.clear_fields()
|
embed.clear_fields()
|
||||||
embed.add_field(name="Progress", value=line)
|
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()
|
last_edit = time.time()
|
||||||
options["progress_hooks"] = [_download_hook]
|
options["progress_hooks"] = [_download_hook]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue