|
|
@ -34,10 +34,10 @@ class LaunchLib(commands.Cog):
|
|
|
|
"""Nothing to delete"""
|
|
|
|
"""Nothing to delete"""
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
async def _embed_launch_data(self, launch: ll.Launch):
|
|
|
|
async def _embed_launch_data(self, launch: ll.AsyncLaunch):
|
|
|
|
status: ll.LaunchStatus = launch.get_status()
|
|
|
|
status: ll.AsyncLaunchStatus = await launch.get_status()
|
|
|
|
|
|
|
|
|
|
|
|
rocket: ll.Rocket = launch.rocket
|
|
|
|
rocket: ll.AsyncRocket = launch.rocket
|
|
|
|
|
|
|
|
|
|
|
|
title = launch.name
|
|
|
|
title = launch.name
|
|
|
|
description = status.description
|
|
|
|
description = status.description
|
|
|
@ -105,15 +105,13 @@ class LaunchLib(commands.Cog):
|
|
|
|
@launchlib.command()
|
|
|
|
@launchlib.command()
|
|
|
|
async def next(self, ctx: commands.Context, num_launches: int = 1):
|
|
|
|
async def next(self, ctx: commands.Context, num_launches: int = 1):
|
|
|
|
# launches = await api.async_next_launches(num_launches)
|
|
|
|
# launches = await api.async_next_launches(num_launches)
|
|
|
|
loop = asyncio.get_running_loop()
|
|
|
|
# loop = asyncio.get_running_loop()
|
|
|
|
|
|
|
|
#
|
|
|
|
launches = await loop.run_in_executor(
|
|
|
|
# launches = await loop.run_in_executor(
|
|
|
|
None, functools.partial(self.api.fetch_launch, num=num_launches)
|
|
|
|
# None, functools.partial(self.api.fetch_launch, num=num_launches)
|
|
|
|
)
|
|
|
|
# )
|
|
|
|
|
|
|
|
#
|
|
|
|
# launches = self.api.fetch_launch(num=num_launches)
|
|
|
|
launches = await self.api.async_fetch_launch(num=num_launches)
|
|
|
|
|
|
|
|
|
|
|
|
print(len(launches))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async with ctx.typing():
|
|
|
|
async with ctx.typing():
|
|
|
|
for x, launch in enumerate(launches):
|
|
|
|
for x, launch in enumerate(launches):
|
|
|
|