Skip to content
This repository was archived by the owner on Feb 7, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions cogs/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
import psutil
# import openai # Removed because OpenAI commands were disabled, and OpenAI fails to load due to missing "PyDantic" dependency
import discord
import json
import time
import datetime
from api import auth
from framework.isobot import currency, embedengine, commands as cmds
from framework.isobot.db import levelling
Expand All @@ -30,6 +33,7 @@ class Utils(commands.Cog):

def __init__(self, bot):
self.bot = bot
self.start_time = time.time()

@commands.slash_command(
name='echo',
Expand Down Expand Up @@ -186,12 +190,17 @@ async def status(self, ctx: ApplicationContext):
sys_ram = str(f"{psutil.virtual_memory()[2]}GiB")
sys_cpu = str(f"{psutil.cpu_percent(1)}%")
bot_users = currency.get_user_count()
total_users = int()
for guild in self.bot.guilds:
total_users += guild.member_count
localembed = discord.Embed(title="Client Info")
localembed.add_field(name="OS Name", value=os_name)
localembed.add_field(name="Uptime", value=str(datetime.timedelta(seconds=int(round(time.time()-self.start_time)))))
localembed.add_field(name="OS Name", value=os_name, inline=True)
localembed.add_field(name="RAM Available", value=sys_ram)
localembed.add_field(name="CPU Usage", value=sys_cpu)
localembed.add_field(name="Registered Users", value=f"{bot_users} users", inline=True)
localembed.add_field(name="Uptime History", value="[here](https://stats.uptimerobot.com/PlKOmI0Aw8)")
localembed.add_field(name="Total Users", value=f"{total_users} users")
localembed.add_field(name="Uptime History", value="[here](https://stats.uptimerobot.com/PlKOmI0Aw8)", inline=True)
localembed.add_field(name="Release Notes", value="[latest](https://github.com/PyBotDevs/isobot/releases/latest)")
localembed.set_footer(text=f"Requested by {ctx.author.name}", icon_url=ctx.author.avatar)
await ctx.respond(embed=localembed)
Expand Down
2 changes: 2 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ async def on_ready():
s.log(f'[main/Client] Logged in as {client.user.name}. Start time: {start_time.strftime("%H:%M:%S")}\n[main/Client] Ready to accept commands. Click Ctrl+C to shut down the bot.')
await client.change_presence(activity=discord.Activity(type=discord.ActivityType.playing, name="Isobot is finally back! Improved uptime!"), status=discord.Status.idle)
s.log(f'[main/Log] {colors.green}Status set to IDLE. Rich presence set.{colors.end}')

# Start and Deploy Ping Server
if api.auth.get_mode() or api.auth.get_runtime_options()["ping_server_override"]:
# If ping_server_override is set to true, it will start the pinging server no matter what. If it's set to false, it will only start if client mode is set to replit.
s.log(f"[main/Flask] {f'{colors.yellow}Ping server override.{colors.end} ' if api.auth.get_runtime_options()['ping_server_override'] else ''}Starting pinger service...")
Expand Down