Un bot Discord.
  • Rust 87.2%
  • Lua 4.8%
  • Dockerfile 4%
  • Ruby 1.5%
  • HCL 1.4%
  • Other 1.1%
Find a file
Lameur f5b4419f20
Fix linting error, global update
Signed-off-by: Lameur <adam.auclair@outlook.fr>
2026-03-16 09:08:16 +01:00
.cargo Rewriting in Rust 2026-03-16 01:32:39 +01:00
.devcontainer Rewriting in Rust 2026-03-16 01:32:39 +01:00
.forgejo Fix linting error, global update 2026-03-16 09:08:16 +01:00
.mise Fix linting error, global update 2026-03-16 09:08:16 +01:00
.vscode Rewriting in Rust 2026-03-16 01:32:39 +01:00
config Fix linting error, global update 2026-03-16 09:08:16 +01:00
crates Fix linting error, global update 2026-03-16 09:08:16 +01:00
Docker Fix linting error, global update 2026-03-16 09:08:16 +01:00
scripts Fix linting error, global update 2026-03-16 09:08:16 +01:00
src Fix linting error, global update 2026-03-16 09:08:16 +01:00
supply-chain Fix linting error, global update 2026-03-16 09:08:16 +01:00
.dockerignore Update 2026-03-16 03:25:59 +01:00
.editorconfig Rewriting in Rust 2026-03-16 01:32:39 +01:00
.env.example Fix linting error, global update 2026-03-16 09:08:16 +01:00
.gitignore Update 2026-03-16 03:25:59 +01:00
bot.code-workspace Update 2026-03-16 03:25:59 +01:00
cargo.toml Fix linting error, global update 2026-03-16 09:08:16 +01:00
CHANGELOG.md Rewriting in Rust 2026-03-16 01:32:39 +01:00
clippy.toml Rewriting in Rust 2026-03-16 01:32:39 +01:00
CONTRIBUTING.md Rewriting in Rust 2026-03-16 01:32:39 +01:00
cross.toml Rewriting in Rust 2026-03-16 01:32:39 +01:00
DefLogoTactic2_upscayl_16x_digital-art-4x.png modified origin 2025-10-01 19:20:46 +02:00
docker-bake.hcl Rewriting in Rust 2026-03-16 01:32:39 +01:00
docker-compose.yml Update 2026-03-16 03:25:59 +01:00
LICENSE Rewriting in Rust 2026-03-16 01:32:39 +01:00
mise.lock Fix linting error, global update 2026-03-16 09:08:16 +01:00
mise.toml Fix linting error, global update 2026-03-16 09:08:16 +01:00
precious.toml Fix linting error, global update 2026-03-16 09:08:16 +01:00
README.md Rewriting in Rust 2026-03-16 01:32:39 +01:00
rust-toolchain.toml Rewriting in Rust 2026-03-16 01:32:39 +01:00
rustfmt.toml Update 2026-03-16 03:25:59 +01:00
SECURITY.md Fix linting error, global update 2026-03-16 09:08:16 +01:00

🤖 Secretaire - Discord Bot de Modération

Bot Discord de modération et gestion de serveur écrit en Rust.

Rust License: MIT Docker

🚀 Déploiement Rapide (Docker)

# 1. Configuration
cp .env.example .env
nano .env  # Ajoute ton DISCORD_TOKEN

# 2. Build & Run
docker-compose up -d

# 3. Logs
docker-compose logs -f

C'est tout ! 🎉

🏗️ Architecture

Projet Cargo Workspace modulaire :

secretaire/
├── crates/
│   ├── secretaire-core/      # Fonctionnalités communes
│   ├── secretaire-admins/    # Commandes d'administration
│   └── secretaire-utils/     # Commandes utilitaires
└── src/
    └── main.rs               # Point d'entrée

Fonctionnalités

🛡️ Administration

  • ban / unban - Bannir/débannir
  • kick - Expulser
  • warn - Avertissements
  • clear - Purge de messages
  • spy / delspy - Surveillance
  • say - Faire parler le bot
  • invite - Gestion invitations
  • mp - Messages privés
  • rule - Règles du serveur

🔧 Utilitaires

  • help - Aide interactive
  • ping - Latence
  • system - Infos système
  • uptime - Temps de fonctionnement

🐳 Docker (Recommandé)

Avec Docker Compose

# Démarrer
docker-compose up -d

# Arrêter
docker-compose down

# Logs
docker-compose logs -f

# Restart
docker-compose restart

# Rebuild
docker-compose build
docker-compose up -d

Avec Docker directement

# Build
docker build -f Dockerfile.rust -t secretaire:latest .

# Run
docker run -d \
  --name secretaire \
  --env-file .env \
  --restart unless-stopped \
  secretaire:latest

# Logs
docker logs -f secretaire

# Stop
docker stop secretaire && docker rm secretaire

Avec mise (développeurs)

# Build
mise run docker:build

# Run
mise run docker:run

# Logs
mise run docker:logs

# Deploy complet
mise run deploy

🛠️ Développement

Prérequis

Setup local

# Installation
mise install
mise run init

# Développement avec auto-reload
mise run dev

Commandes essentielles

# Tests
mise run test

# Vérifications complètes
mise run check          # Format + Lint + Tests
mise run security:all   # Audits de sécurité

# Build
mise run build          # Build release

📋 Liste complète : mise tasks

🔒 Sécurité

  • cargo-audit - Audit des vulnérabilités
  • cargo-deny - Vérification des licences
  • precious - Formatage uniforme
  • Image Docker minimale (Alpine)
  • Utilisateur non-root dans le container
# Audit de sécurité
mise run security:all

⚙️ Configuration

Variables d'environnement dans .env :

# Requis
DISCORD_TOKEN=your_bot_token_here

# Optionnels
BOT_PREFIX=!
RUST_LOG=secretaire=info

📊 Performance

Métrique Valeur
Taille image Docker ~15 MB
Mémoire (idle) ~30 MB
CPU (idle) ~0.5%
Temps de démarrage ~200ms

🔄 Mise à jour

# Pull les changements
git pull

# Rebuild et redéploie
docker-compose build
docker-compose up -d

# Ou avec mise
mise run deploy

📚 Documentation

Générer la documentation

mise run docs:open

🐛 Dépannage

Le bot ne démarre pas

# Vérifier les logs
docker-compose logs secretaire

# Vérifier la config
cat .env

# Vérifier le token
echo $DISCORD_TOKEN

Le bot ne répond pas

  1. Vérifier les intents Discord
  2. Vérifier les permissions du bot
  3. /help pour tester

Problème de mémoire

Ajuster les limites dans docker-compose.yml :

deploy:
  resources:
    limits:
      memory: 512M  # Augmenter si nécessaire

🤝 Contributing

  1. Fork le projet
  2. Crée une branche (git checkout -b feature/amazing)
  3. Commit (git commit -m 'feat: add amazing')
  4. Push (git push origin feature/amazing)
  5. Ouvre une Pull Request

Avant de commit :

mise run check

📝 Changelog

Voir CHANGELOG.md

📄 License

MIT License - voir LICENSE

🙏 Remerciements


Fait avec ❤️ en Rust 🦀 | Déployé avec 🐳 Docker