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
6 changes: 6 additions & 0 deletions cogs/economy.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ def new_bank(id: int):
currency['bank'][str(id)] = 0
return 0
else: return 1

def get_user_count():
users = 0
for x in currency["wallet"].keys():
users += 1
return users

# Commands
class Economy(commands.Cog):
Expand Down
23 changes: 22 additions & 1 deletion cogs/utils.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Imports
import discord
import os
import psutil
import framework.isobot.embedengine
from discord import option, ApplicationContext
from discord.ext import commands
from cogs.economy import get_wallet, get_bank, get_user_networth
from cogs.economy import get_wallet, get_bank, get_user_networth, get_user_count
from cogs.levelling import get_level, get_xp

# Variables
Expand Down Expand Up @@ -62,6 +64,25 @@ async def profile(self, ctx: ApplicationContext, user: discord.User = None):
# More stats will be added later
# Maybe I should make a userdat system for collecting statistical data to process and display here, coming in a future update.
await ctx.respond(embed=localembed)

@commands.slash_command(
name="status",
description="Shows the current client info"
)
async def status(self, ctx: ApplicationContext):
os_name = os.name
sys_ram = str(f"{psutil.virtual_memory()[2]}GiB")
sys_cpu = str(f"{psutil.cpu_percent(1)}%")
bot_users = get_user_count()
localembed = discord.Embed(title="Client Info")
localembed.add_field(name="OS Name", value=os_name)
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="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_url)
await ctx.respond(embed=localembed)

# Cog Initialization
def setup(bot): bot.add_cog(Utils(bot))
20 changes: 0 additions & 20 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,26 +291,6 @@ async def sync(ctx: ApplicationContext):
@option(name="question", description="What do you want to predict?", type=str)
async def prediction(ctx: ApplicationContext, question:str): await ctx.respond(f"My prediction is... **{random.choice(['Yes', 'No'])}!**")

@client.slash_command(
name="status",
description="Shows the current client info"
)
async def status(ctx: ApplicationContext):
os_name = os.name
sys_ram = str(f"{psutil.virtual_memory()[2]}GiB")
sys_cpu = str(f"{psutil.cpu_percent(1)}%")
bot_users = 0
for x in levels.keys(): bot_users += 1
localembed = discord.Embed(title="Client Info")
localembed.add_field(name="OS Name", value=os_name)
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="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_url)
await ctx.respond(embed=localembed)

# Cog Commands (these cannot be moved into a cog)
cogs = client.create_group("cog", "Commands for working with isobot cogs.")

Expand Down