From 67625ca891ecaaf1822413cef1f056d51e003ce3 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Tue, 28 Feb 2023 03:35:40 -0500 Subject: [PATCH] added unix command --- galaxy/galaxy.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/galaxy/galaxy.py b/galaxy/galaxy.py index f567eed..b960932 100644 --- a/galaxy/galaxy.py +++ b/galaxy/galaxy.py @@ -1,5 +1,6 @@ from redbot.core import commands, checks import discord +import requests class Galaxy(commands.Cog): """Custom cog intended for use on the Galaxy discord server.""" @@ -7,6 +8,15 @@ class Galaxy(commands.Cog): def __init__(self, bot): self.bot = bot + @commands.command() + async def unix(self, ctx): + """Posts the current Unix timestamp.""" + URL = "http://worldtimeapi.org/api/timezone/Etc/UTC" + r = requests.get(url = URL) + data = r.json() + await ctx.send(data) + + @commands.command() async def warehouse(self, ctx: commands.Context, lvlfrom: int = 1, lvlto: int = 38): """Calculates the total cost to upgrade your warehouse from a level to a level."""