Skip to content

Commit

Permalink
[Weather] Bring up timestamps from dpy-2.0 branch
Browse files Browse the repository at this point in the history
  • Loading branch information
TrustyJAID committed Oct 17, 2021
1 parent 4a2216a commit 596c9fc
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions weather/weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Weather(commands.Cog):
"""Get weather data from https://openweathermap.org"""

__author__ = ["TrustyJAID"]
__version__ = "1.2.1"
__version__ = "1.3.0"

def __init__(self, bot):
self.bot = bot
Expand Down Expand Up @@ -222,12 +222,10 @@ async def get_weather(
currenttemp = abs(currenttemp - 273.15)
mintemp = abs(maxtemp - 273.15)
maxtemp = abs(maxtemp - 273.15)
sunrise = datetime.datetime.utcfromtimestamp(
data["sys"]["sunrise"] + data["timezone"]
).strftime("%H:%M")
sunset = datetime.datetime.utcfromtimestamp(
data["sys"]["sunset"] + data["timezone"]
).strftime("%H:%M")
sunrise_timestamp = int(data["sys"]["sunrise"])
sunset_timestamp = int(data["sys"]["sunset"])
sunrise = f"<t:{sunrise_timestamp}:t>"
sunset = f"<t:{sunset_timestamp}:t>"
embed = discord.Embed(colour=discord.Colour.blue())
if len(city) and len(country):
embed.add_field(name=_("🌍 **Location**"), value="{0}, {1}".format(city, country))
Expand Down

0 comments on commit 596c9fc

Please sign in to comment.