aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ks123 <[email protected]>2020-03-31 08:27:54 +0300
committerGravatar ks123 <[email protected]>2020-03-31 08:27:54 +0300
commite82daf0d152313909abb25e5bbe254a30dc4fd9e (patch)
tree7dc5fa248e30465bb73234d89f76e0bf70f4d621
parent(Space Cog): Added `get_rovers` task canceling with `cog_unload` function. (diff)
(Space Cog): Removed `async` from `create_nasa_embed` function.
-rw-r--r--bot/seasons/evergreen/space.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/bot/seasons/evergreen/space.py b/bot/seasons/evergreen/space.py
index 11623ca7..89b31e87 100644
--- a/bot/seasons/evergreen/space.py
+++ b/bot/seasons/evergreen/space.py
@@ -82,7 +82,7 @@ class Space(Cog):
result = await self.fetch_from_nasa("planetary/apod", params)
await ctx.send(
- embed=await self.create_nasa_embed(
+ embed=self.create_nasa_embed(
f"Astronomy Picture of the Day - {result['date']}",
result["explanation"],
result["url"]
@@ -107,7 +107,7 @@ class Space(Cog):
item = random.choice(data["collection"]["items"])
await ctx.send(
- embed=await self.create_nasa_embed(
+ embed=self.create_nasa_embed(
item["data"][0]["title"],
item["data"][0]["description"],
item["links"][0]["href"]
@@ -142,7 +142,7 @@ class Space(Cog):
image_url = f"{NASA_EPIC_BASE_URL}/archive/natural/{year}/{month}/{day}/jpg/{item['image']}.jpg"
await ctx.send(
- embed=await self.create_nasa_embed(
+ embed=self.create_nasa_embed(
"Earth Image", item["caption"], image_url, f" \u2022 Identifier: {item['identifier']}"
)
)
@@ -192,7 +192,7 @@ class Space(Cog):
item = random.choice(result["photos"])
await ctx.send(
- embed=await self.create_nasa_embed(
+ embed=self.create_nasa_embed(
f"{item['rover']['name']}'s {item['camera']['full_name']} Mars Image", "", item["img_src"],
)
)
@@ -223,7 +223,7 @@ class Space(Cog):
async with self.http_session.get(url=f"{base}/{endpoint}?{urlencode(params)}") as resp:
return await resp.json()
- async def create_nasa_embed(self, title: str, description: str, image: str, footer: Optional[str] = "") -> Embed:
+ def create_nasa_embed(self, title: str, description: str, image: str, footer: Optional[str] = "") -> Embed:
"""Generate NASA commands embeds. Required: title, description and image URL, footer (addition) is optional."""
return Embed(
title=title,