diff --git a/.gitignore b/.gitignore index b6e1cad..4c4e301 100644 --- a/.gitignore +++ b/.gitignore @@ -164,4 +164,6 @@ data/ *.disabled -config/ \ No newline at end of file +config/ + +tests/ \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 956c7f9..cffcf9f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,10 +1,13 @@ -aiohappyeyeballs==2.6.2 +aiohappyeyeballs==2.7.1 aiohttp==3.14.1 aiosignal==1.4.0 asarPy==1.0.1 +async-timeout==5.0.1 attrs==26.1.0 +audioop-lts==0.2.2 beautifulsoup4==4.15.0 certifi==2026.5.20 +cffi==2.1.0 charset-normalizer==3.4.7 frozenlist==1.8.0 h11==0.16.0 @@ -15,6 +18,8 @@ outcome==1.3.0.post0 propcache==0.5.2 psycopg2-binary==2.9.12 py-cord==2.8.0 +pycparser==3.0 +PyNaCl==1.6.2 PySocks==1.7.1 python-dotenv==1.2.2 requests==2.34.2 @@ -24,8 +29,9 @@ sortedcontainers==2.4.0 soupsieve==2.8.4 trio==0.33.0 trio-websocket==0.12.2 -typing_extensions==4.15.0 +typing_extensions==4.16.0 urllib3==2.7.0 +wavelink==3.5.2 websocket-client==1.9.0 wsproto==1.3.2 yarl==1.24.2 diff --git a/setup/bot.py b/setup/bot.py index b7ae522..f241337 100644 --- a/setup/bot.py +++ b/setup/bot.py @@ -1,7 +1,5 @@ import discord -from discord.ext import bridge -# from cogs.birthday import BirthdayCog -# from cogs.productivity import ProductivityCog +from discord.ext import commands from cogs.cs import CSCog from cogs.insult import InsultsCog from cogs.roulette import RouletteCog @@ -15,8 +13,9 @@ bot_intents.members = True bot_intents.presences = True bot_intents.guilds = True bot_intents.reactions = True +bot_intents.voice_states = True -bot = bridge.Bot(command_prefix='$', intents=bot_intents) +bot = commands.Bot(command_prefix='$', intents=bot_intents) COG_REGISTRY = { 'cs': CSCog, @@ -29,6 +28,22 @@ COG_REGISTRY = { from discord import option as discord_option +@bot.slash_command(name="reload", description="Reload a feature (cog) by name, or 'all')") +@discord_option(name="feature", description="Feature to reload (e.g. cs, insult, roles, roulette, all)", input_type=str, required=True) +async def reload(ctx: discord.ApplicationContext, feature: str): + # Only allow administrators + if not ctx.author or not getattr(ctx.author, 'guild_permissions', None) or not ctx.author.guild_permissions.administrator: + await ctx.respond("You must be a server administrator to use this command.", ephemeral=True) + return + + await ctx.defer() + reload_feature(feature) + await ctx.followup.send(f"Reload requested for feature: {feature}", ephemeral=True) + +# Register a global admin slash command directly on the bot to avoid circular imports. +from discord import option as discord_option + + @bot.slash_command(name="reload", description="Reload a feature (cog) by name, or 'all')") @discord_option(name="feature", description="Feature to reload (e.g. cs, insult, roles, roulette, all)", input_type=str, required=True) async def reload(ctx: discord.ApplicationContext, feature: str):