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
3 changes: 2 additions & 1 deletion api/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def initial_setup() -> Literal[0]:
"ping_server_override": False,
"debug_mode": False,
"show_ping_on_startup": True,
"isocard_server_enabled": True
"isocard_server_enabled": True,
"superusers": []
}
for key in default_runtime_option_values:
if key not in runtimeconfig_db["runtime_options"]:
Expand Down
11 changes: 7 additions & 4 deletions cogs/devtools.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Imports
import discord
import os
from api import auth
from framework.isobot.currency import CurrencyAPI
from framework.isobot.db import levelling
from discord import option, ApplicationContext, SlashCommandGroup
Expand All @@ -14,7 +15,9 @@
levelling = levelling.Levelling()

# Bot Superusers List
superusers = ["738290097170153472"]
def fetch_superusers() -> list:
"""Fetches a list of all of the superusers' Discord IDs registered in isobot."""
return list(auth.get_runtime_options["superusers"])

# Commands
class DevTools(commands.Cog):
Expand All @@ -30,7 +33,7 @@ def __init__(self, bot):
@option(name="user", description="Specify the user to change their balance", type=discord.User)
@option(name="modifier", description="Specify the balance to modify", type=int)
async def modify_balance(self, ctx: ApplicationContext, user: discord.User, modifier: int):
if str(ctx.author.id) not in superusers: return ctx.respond("This command is usable only by **developers** and **bot superusers**.", ephemeral=True)
if str(ctx.author.id) not in fetch_superusers(): return ctx.respond("This command is usable only by **developers** and **bot superusers**.", ephemeral=True)
try:
currency.add(user.id, modifier)
await ctx.respond(f"{user.name}\'s balance has been modified by {modifier} coins.\n\n**New Balance:** {currency.get_wallet(user.id)} coins", ephemeral=True)
Expand All @@ -43,7 +46,7 @@ async def modify_balance(self, ctx: ApplicationContext, user: discord.User, modi
@option(name="user", description="Who's rank do you want to edit?", type=discord.User)
@option(name="new_rank", description="The new rank you want to set for the user", type=int)
async def edit_rank(self, ctx: ApplicationContext, user: discord.User, new_rank: int):
if str(ctx.author.id) not in superusers: return await ctx.respond("This command is usable only by **developers** and **bot superusers**.", ephemeral=True)
if str(ctx.author.id) not in fetch_superusers(): return await ctx.respond("This command is usable only by **developers** and **bot superusers**.", ephemeral=True)
try:
levelling.set_level(user.id, new_rank)
await ctx.respond(f"{user.display_name}\'s rank successfully edited. `New Rank: {levelling.get_level(user.id)}`")
Expand All @@ -56,7 +59,7 @@ async def edit_rank(self, ctx: ApplicationContext, user: discord.User, new_rank:
@option(name="user", description="Who's rank do you want to edit?", type=discord.User)
@option(name="new_xp", description="The new xp count you want to set for the user", type=int)
async def edit_xp(self, ctx: ApplicationContext, user: discord.User, new_xp: int):
if str(ctx.author.id) not in superusers: return await ctx.respond("This command is usable only by **developers** and **bot superusers**.", ephemeral=True)
if str(ctx.author.id) not in fetch_superusers(): return await ctx.respond("This command is usable only by **developers** and **bot superusers**.", ephemeral=True)
try:
levelling.set_xp(user.id, new_xp)
await ctx.respond(f"{user.display_name}\'s XP count successfully edited. `New XP: {levelling.get_xp(user.id)}`")
Expand Down