Skip to content

πŸ” Advanced Discord logging bot with comprehensive server monitoring, message tracking, and administrative controls

License

Notifications You must be signed in to change notification settings

duskdeveloper/discord-logging-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

discord-logging-bot

πŸ” Advanced Discord logging bot with comprehensive server monitoring, message tracking, and administrative controls

Advanced Discord Logging Bot

A comprehensive Discord bot for server logging with message tracking, user activity monitoring, and administrative controls.

Features

Message Logging

  • Real-time message logging from all channels
  • Message edit tracking with before/after content
  • Message deletion logging with original content
  • Attachment tracking and logging

User Activity Monitoring

  • Member join/leave notifications
  • Role change tracking
  • Voice channel activity logging
  • User status and activity monitoring

Administrative Controls

  • Configurable logging channels for different event types
  • Toggle individual logging features on/off
  • Customizable command prefixes
  • Per-server configuration storage
  • Setup wizard for easy initial configuration

Advanced Features

  • Multiple log channel support (separate channels for different log types)
  • Rich embed formatting with timestamps and user avatars
  • Comprehensive error handling and logging
  • Rate limiting and permission checks
  • Modular code structure for easy maintenance

Setup Instructions

Prerequisites

  • Python 3.8 or higher
  • Discord.py library
  • A Discord bot token from the Discord Developer Portal

Installation

  1. Clone the repository:
git clone https://github.com/duskdeveloper/discord-logging-bot.git
cd discord-logging-bot
  1. Install dependencies:
pip install discord.py
  1. Create a Discord Application and Bot:

  2. Set up environment variables:

export DISCORD_BOT_TOKEN="your_bot_token_here"

Or create a .env file:

DISCORD_BOT_TOKEN=your_bot_token_here
  1. Invite the bot to your server:

    • In the Discord Developer Portal, go to "OAuth2" > "URL Generator"
    • Select "bot" scope
    • Select required permissions: Administrator (or specific permissions)
    • Use the generated URL to invite the bot
  2. Run the bot:

python main.py

Configuration

Quick Setup

Use the setup wizard for easy configuration:

!log setup

Manual Configuration

Setting Log Channels

!log channel <type> #channel-name

Available log types:

  • messages - Regular message logging
  • edits - Message edit tracking
  • deletions - Message deletion tracking
  • joins - Member join notifications
  • leaves - Member leave notifications
  • roles - Role change tracking
  • voice - Voice channel activity
  • default - Fallback channel for all log types

Toggle Features

!log toggle <feature>

Available features:

  • main - Enable/disable all logging
  • messages - Message logging
  • edits - Edit tracking
  • deletions - Deletion tracking
  • joins - Join notifications
  • leaves - Leave notifications
  • roles - Role changes
  • voice - Voice activity

View Configuration

!log status

Change Prefix

!log prefix <new_prefix>

Commands

Administrative Commands (Administrator Required)

  • !log help - Show all available commands
  • !log setup - Run the setup wizard
  • !log status - View current configuration
  • !log toggle <feature> - Toggle logging features
  • !log channel <type> <channel> - Set log channel for specific type
  • !log channels - List all configured log channels
  • !log clear <type> - Clear log channel setting
  • !log prefix <prefix> - Change command prefix

General Commands

  • !ping - Check bot latency
  • !info - Display bot information

File Structure

β”œβ”€β”€ bot/
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ core.py          # Main bot class
β”‚   β”œβ”€β”€ events.py        # Event handlers
β”‚   β”œβ”€β”€ commands.py      # Command handlers
β”‚   β”œβ”€β”€ config.py        # Configuration manager
β”‚   β”œβ”€β”€ logger.py        # Logging system
β”‚   └── utils.py         # Utility functions
β”œβ”€β”€ config/
β”‚   └── default_config.json  # Default configuration
β”œβ”€β”€ main.py              # Entry point
└── README.md

Configuration Files

The bot automatically creates configuration files in the config/ directory:

  • default_config.json - Default settings for all servers
  • {guild_id}.json - Per-server configuration files

Logging Types

Message Events

  • New messages with content and attachments
  • Message edits with before/after comparison
  • Message deletions with original content
  • Direct message tracking (optional)

User Events

  • Member joins with account age
  • Member leaves with role information
  • Role assignments and removals
  • Nickname changes
  • Status updates

Voice Events

  • Voice channel joins
  • Voice channel leaves
  • Voice channel switches
  • Mute/deafen status changes

Permissions

The bot requires the following Discord permissions:

  • Read Messages
  • Send Messages
  • Embed Links
  • Read Message History
  • View Channels
  • Manage Messages (for advanced features)
  • View Audit Log (for detailed logging)

Support

For issues and feature requests, please open an issue on GitHub.

License

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

About

πŸ” Advanced Discord logging bot with comprehensive server monitoring, message tracking, and administrative controls

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages