added unix command

This commit is contained in:
Seaswimmer 2023-02-28 03:35:40 -05:00
parent b128366eef
commit 67625ca891

View file

@ -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."""