1
0
forked from sass/tipibot

Edit discord role rights

This commit is contained in:
Rene Arumetsa
2026-06-01 22:19:12 +03:00
parent 24de79c503
commit 42f7bae681
6 changed files with 73 additions and 19 deletions

View File

@@ -14,6 +14,7 @@ import discord
from discord import app_commands
import strings as S
from core.admin import bot_admin_check
def register_ops_admin_commands(
@@ -32,7 +33,7 @@ def register_ops_admin_commands(
) -> None:
@tree.command(name="status", description=S.CMD["status"])
@app_commands.guild_only()
@app_commands.default_permissions(manage_guild=True)
@bot_admin_check()
async def cmd_status(interaction: discord.Interaction):
mem = process.memory_info()
cpu = process.cpu_percent(interval=0.1)
@@ -95,7 +96,7 @@ def register_ops_admin_commands(
@tree.command(name="sync", description=S.CMD["sync"])
@app_commands.guild_only()
@app_commands.default_permissions(manage_guild=True)
@bot_admin_check()
async def cmd_sync(interaction: discord.Interaction):
await interaction.response.defer(ephemeral=True)
tree.copy_global_to(guild=guild_obj)
@@ -107,7 +108,7 @@ def register_ops_admin_commands(
@tree.command(name="restart", description=S.CMD["restart"])
@app_commands.guild_only()
@app_commands.default_permissions(manage_guild=True)
@bot_admin_check()
async def cmd_restart(interaction: discord.Interaction):
restart_file.write_text(json.dumps({"channel_id": interaction.channel_id}), encoding="utf-8")
await interaction.response.send_message(S.MSG_RESTARTING, ephemeral=True)
@@ -117,7 +118,7 @@ def register_ops_admin_commands(
@tree.command(name="shutdown", description=S.CMD["shutdown"])
@app_commands.guild_only()
@app_commands.default_permissions(manage_guild=True)
@bot_admin_check()
async def cmd_shutdown(interaction: discord.Interaction):
await interaction.response.send_message(S.MSG_SHUTTING_DOWN, ephemeral=True)
log.info("/shutdown triggered by %s", interaction.user)
@@ -125,7 +126,7 @@ def register_ops_admin_commands(
@tree.command(name="pause", description=S.CMD["pause"])
@app_commands.guild_only()
@app_commands.default_permissions(manage_guild=True)
@bot_admin_check()
async def cmd_pause(interaction: discord.Interaction):
paused = not get_paused()
set_paused(paused)