Merge branch 'feature/intern' of gitea.nebulo9.fr:nebulo9/botmafieux into feature/intern

This commit is contained in:
2026-09-21 10:51:30 +02:00
3 changed files with 30 additions and 7 deletions

2
.gitignore vendored
View File

@@ -165,3 +165,5 @@ data/
*.disabled *.disabled
config/ config/
tests/

View File

@@ -1,10 +1,13 @@
aiohappyeyeballs==2.6.2 aiohappyeyeballs==2.7.1
aiohttp==3.14.1 aiohttp==3.14.1
aiosignal==1.4.0 aiosignal==1.4.0
asarPy==1.0.1 asarPy==1.0.1
async-timeout==5.0.1
attrs==26.1.0 attrs==26.1.0
audioop-lts==0.2.2
beautifulsoup4==4.15.0 beautifulsoup4==4.15.0
certifi==2026.5.20 certifi==2026.5.20
cffi==2.1.0
charset-normalizer==3.4.7 charset-normalizer==3.4.7
frozenlist==1.8.0 frozenlist==1.8.0
h11==0.16.0 h11==0.16.0
@@ -15,6 +18,8 @@ outcome==1.3.0.post0
propcache==0.5.2 propcache==0.5.2
psycopg2-binary==2.9.12 psycopg2-binary==2.9.12
py-cord==2.8.0 py-cord==2.8.0
pycparser==3.0
PyNaCl==1.6.2
PySocks==1.7.1 PySocks==1.7.1
python-dotenv==1.2.2 python-dotenv==1.2.2
requests==2.34.2 requests==2.34.2
@@ -24,8 +29,9 @@ sortedcontainers==2.4.0
soupsieve==2.8.4 soupsieve==2.8.4
trio==0.33.0 trio==0.33.0
trio-websocket==0.12.2 trio-websocket==0.12.2
typing_extensions==4.15.0 typing_extensions==4.16.0
urllib3==2.7.0 urllib3==2.7.0
wavelink==3.5.2
websocket-client==1.9.0 websocket-client==1.9.0
wsproto==1.3.2 wsproto==1.3.2
yarl==1.24.2 yarl==1.24.2

View File

@@ -1,7 +1,5 @@
import discord import discord
from discord.ext import bridge from discord.ext import commands
# from cogs.birthday import BirthdayCog
# from cogs.productivity import ProductivityCog
from cogs.cs import CSCog from cogs.cs import CSCog
from cogs.insult import InsultsCog from cogs.insult import InsultsCog
from cogs.roulette import RouletteCog from cogs.roulette import RouletteCog
@@ -15,8 +13,9 @@ bot_intents.members = True
bot_intents.presences = True bot_intents.presences = True
bot_intents.guilds = True bot_intents.guilds = True
bot_intents.reactions = 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 = { COG_REGISTRY = {
'cs': CSCog, 'cs': CSCog,
@@ -29,6 +28,22 @@ COG_REGISTRY = {
from discord import option as discord_option 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')") @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) @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): async def reload(ctx: discord.ApplicationContext, feature: str):