A Discord bot that allows users to democratically vote to mute other users in voice channels for a set period of time.
- Democratic voice channel moderation through voting
- Configurable vote threshold and duration
- Temporary muting that only affects voice channels (users can still type in text channels)
- Voice mute persists across channel changes
- Data persistence across bot restarts
- Admin command to clear votes and unmute users
- CSV logging system for all bot activities
- Go 1.22 or higher
- Discord bot token with proper permissions
- Bot requires administrator privileges on the server
-
Clone the repository:
git clone https://github.com/yourusername/DiscMuteBot.git cd DiscMuteBot
-
Configure your bot token in
config.json
:{ "token": "YOUR_BOT_TOKEN" }
-
Install dependencies and build:
go mod tidy go build -o DiscMuteBot bot/main.go
-
Generate an invitation link:
cd utils go run generate_invitation.go
-
Run the bot:
./DiscMuteBot
You can run the bot using Docker with these simple steps:
-
Build the Docker image:
docker build -t discmutebot .
-
Run the container:
docker run -d --name mute-bot \ -v $(pwd)/config.json:/app/config.json \ -v $(pwd)/logs:/app/logs \ discmutebot
For advanced Docker usage check out the extended documentation in:
utils/docker_build.md
- Comprehensive Docker deployment guideutils/docker_build.sh
- Helper script for common Docker operations
Example using the helper script:
chmod +x utils/docker_build.sh # Make script executable
./utils/docker_build.sh help # Show available commands
!mute @user
- Vote to mute the mentioned user in voice channels!muteinfo
- Show all users with active votes!muteinfo @user
- Show votes for a specific user!mutestatus
- Show mute system configuration!clean @user
- (Admin only) Clear all votes against a user and unmute them if necessary!ping
- Check if the bot is active!debug
- Show detailed information about the bot!servers
- Show servers where the bot is present!help
- Show available commands
The bot automatically logs all actions to CSV files in the logs
directory:
- Files are created daily in format
YYYY-MM-DD.csv
- Each log entry contains: timestamp, action type, initiator, target, vote count, and guild ID
- Action types include: VOTE, MUTE, UNMUTE, and CLEAN
- Logs can be used for moderation auditing and statistics
You can modify the following mute and voting rules in the main.go
file:
VOTE_DURATION
- Duration of votes (default: 30 minutes)MUTE_DURATION
- Duration of voice muting (default: 1 minute)VOTES_NEEDED
- Number of votes needed to mute a user (default: 1)
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome. Please open an issue or a pull request to suggest changes or improvements.