diff --git a/launchlib/info.json b/launchlib/info.json index 8df1059..c1c7ad7 100644 --- a/launchlib/info.json +++ b/launchlib/info.json @@ -8,7 +8,7 @@ "install_msg": "Thank you for installing LaunchLib. Get started with `[p]load launchlib`, then `[p]help LaunchLib`", "short": "Access launch data for space flights", "end_user_data_statement": "This cog does not store any End User Data", - "requirements": ["python-launch-library"], + "requirements": ["python-launch-library>=1.0.6"], "tags": [ "bobloy", "utils", diff --git a/launchlib/launchlib.py b/launchlib/launchlib.py index 0c6eeef..e34a23d 100644 --- a/launchlib/launchlib.py +++ b/launchlib/launchlib.py @@ -34,10 +34,10 @@ class LaunchLib(commands.Cog): """Nothing to delete""" return - async def _embed_launch_data(self, launch: ll.Launch): - status: ll.LaunchStatus = launch.get_status() + async def _embed_launch_data(self, launch: ll.AsyncLaunch): + status: ll.AsyncLaunchStatus = await launch.get_status() - rocket: ll.Rocket = launch.rocket + rocket: ll.AsyncRocket = launch.rocket title = launch.name description = status.description @@ -105,15 +105,13 @@ class LaunchLib(commands.Cog): @launchlib.command() async def next(self, ctx: commands.Context, num_launches: int = 1): # launches = await api.async_next_launches(num_launches) - loop = asyncio.get_running_loop() - - launches = await loop.run_in_executor( - None, functools.partial(self.api.fetch_launch, num=num_launches) - ) - - # launches = self.api.fetch_launch(num=num_launches) - - print(len(launches)) + # loop = asyncio.get_running_loop() + # + # launches = await loop.run_in_executor( + # None, functools.partial(self.api.fetch_launch, num=num_launches) + # ) + # + launches = await self.api.async_fetch_launch(num=num_launches) async with ctx.typing(): for x, launch in enumerate(launches):