Skip to content

Discord democracy is here. This bot enables temporary voice mutes to any user who gets enough votes.

License

Notifications You must be signed in to change notification settings

hecrp/DemocraticDiscMute

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

πŸ”‡ DiscMuteBot

A Discord bot that allows users to democratically vote to mute other users in voice channels for a set period of time.

✨ Features

  • 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

πŸ› οΈ Requirements

  • Go 1.22 or higher
  • Discord bot token with proper permissions
  • Bot requires administrator privileges on the server

πŸš€ Quick Setup

  1. Clone the repository:

    git clone https://github.com/yourusername/DiscMuteBot.git
    cd DiscMuteBot
    
  2. Configure your bot token in config.json:

    {
      "token": "YOUR_BOT_TOKEN"
    }
  3. Install dependencies and build:

    go mod tidy
    go build -o DiscMuteBot bot/main.go
    
  4. Generate an invitation link:

    cd utils
    go run generate_invitation.go
    
  5. Run the bot:

    ./DiscMuteBot
    

Docker Setup

You can run the bot using Docker with these simple steps:

  1. Build the Docker image:

    docker build -t discmutebot .
  2. 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 guide
  • utils/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

πŸ“ 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

πŸ“Š Logging System

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

βš™οΈ Advanced Configuration

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)

πŸ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.

🀝 Contributing

Contributions are welcome. Please open an issue or a pull request to suggest changes or improvements.

About

Discord democracy is here. This bot enables temporary voice mutes to any user who gets enough votes.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published