Make uptime readable

pull/4/head
BodgeMaster 2023-01-21 20:44:50 +01:00
parent ae203e2ad3
commit 975fabf7eb
1 changed files with 4 additions and 4 deletions

8
bot.py
View File

@ -2,7 +2,7 @@
# Code revised by BodgeMaster
# Code Licensed under GPL 3.0
import sys, time, json
import sys, time, json, datetime
import discord
from discord import app_commands
@ -16,8 +16,8 @@ config_file = open("config.json", "r")
config = json.loads(config_file.read());
config_file.close()
def seconds_elapsed():
return int(time.time() - BOOT_TIME)
def uptime():
return str(datetime.timedelta(seconds=int(time.time() - BOOT_TIME)))
class MyClient(discord.Client):
@ -101,7 +101,7 @@ async def report_message(interaction: discord.Interaction, message: discord.Mess
@client.tree.command(name="status")
async def status(interaction: discord.Interaction):
embed = discord.Embed(title='/etc/os-release bot by jocadbz')
embed.add_field(name="Uptime:", value=seconds_elapsed(), inline=True)
embed.add_field(name="Uptime:", value=uptime(), inline=True)
embed.add_field(name="Version:", value=config["bot version"], inline=True)
embed.set_footer(text=config["bot issues"])
url_view = discord.ui.View()