Project 4: _rageguard
RageGuard
A Discord bot that listens to a voice channel, detects repeated angry speech with AI and can time members out.


overview
RageGuard is a Discord moderation bot. It listens to selected members in a voice channel, classifies the emotion of their speech with a speech-emotion model, and applies a timeout only after repeated, high-confidence angry speech. Because voice emotion models are often wrong, it starts in monitor-only mode and logs what it would do.
The bot is written in Rust with serenity and songbird; the AI service is Python with FastAPI, PyTorch and a wav2vec2 model from Hugging Face.
highlights
- Audio split into 3-second segments, resampled to 16 kHz and sent to the AI service
- Sliding-window detection, so a single prediction never triggers a timeout
- A voice supervisor per server and an analysis worker per monitored member, with bounded queues
- Slash commands, a moderation log channel and Docker for the AI service