Skip to content
Johnny Xmas edited this page Jul 28, 2025 · 1 revision

JohnnyBot - The Missing Discord Server Management Toolkit

Welcome to the JohnnyBot wiki! JohnnyBot does all of the stuff Discord bizarrely won't let you do! Designed to automate tons of server management and enforce some rules while you're at it.

Quick Navigation

What is JohnnyBot?

JohnnyBot provides features such as automatic role assignment, message deletion, and user management to ensure a smooth server experience. Most commands are limited to users with the MODERATOR_ROLE_NAME, however the PetBot commands can be leveraged by all users.

Key Features

Command-based Moderation

  • Provides moderators with slash commands to manage members, messages, and post announcements
  • Mass role assignment for efficient user management

Voice Channel Chaperone

  • Monitors voice channels and mutes all members if only one adult and one child are present
  • Sends an alert to the moderators channel

Reminder System

  • Set recurring reminders to be sent to specific channels at regular intervals
  • Persistent reminder storage with automatic scheduling

Event Feed Integration

  • Subscribe to calendar feeds and get notifications for new events
  • Configurable notification channels

Logging and Notifications

  • Logs actions and errors to a rotating log file in the bot directory
  • DM a tail of the log on request

Message Archive

  • Allows moderators to dump and archive user messages from specific channels
  • Provides temporary download links for message archives
  • Automatically cleans up old archive files

Channel Write Protection

  • Deletes any non-moderator messages posted in the PROTECTED_CHANNELS you define in config.py
  • This is a hack to get around Discord's requirement of a minimum number of messageable channels

PetBot Interactions

  • Includes PetBot functionality with time-themed messages

Requirements

  • Python 3.7 (tested up to 3.13)
  • All modules in requirements.txt
  • Firewall rule allowing inbound connections on port TCP port 80 (for message archive hosting)

Getting Started

  1. Follow the Setup Guide for complete installation instructions
  2. Browse the Commands Reference to learn about available commands
  3. Configure your bot according to your server's needs

Concurrency Model

Important: The bot uses both asyncio and threading for different purposes. DO NOT CHANGE THIS:

asyncio is used for:

  • All Discord API interactions (primary event loop)
  • Background tasks (like reminder checking)
  • Command handling
  • Network operations

threading is used for:

  • Synchronous operations that cannot be made async (like file I/O)
  • Thread-safe caching of Discord objects
  • Synchronization primitives (locks) for shared resources

This hybrid approach allows the bot to:

  1. Handle Discord async API efficiently
  2. Perform blocking operations without stalling the event loop
  3. Maintain thread safety for shared resources
  4. Scale well under load

Contributing

Contributions are welcome! If you encounter any bugs or have suggestions, feel free to open an issue or submit a pull request on the GitHub repository.

Attribution

Bot interaction functionality adapted from PetBot under MIT License.

License

This project is licensed under the GNU General Public License v3.0.