8000 GitHub - jaspermayone-forks/thread-it: 🧡 A Discord bot that keeps channels clean by converting replies into threads.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

🧡 A Discord bot that keeps channels clean by converting replies into threads.

License

Notifications You must be signed in to change notification settings

jaspermayone-forks/thread-it

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Thread It 🧡

Python Discord.py License

A Discord bot that automatically keeps channels clean by converting message replies into organized public threads. Thread It promotes organized conversations by seamlessly moving reply discussions into dedicated threads, preventing channel clutter while maintaining context.

🎦 Video Demo
Thread.It.mp4

πŸ“‹ Table of Contents

✨ Features

  • Automatic Thread Creation: Converts message replies into organized public threads
  • Clean Channel Management: Keeps main channels clutter-free by moving discussions to threads
  • Smart Thread Naming: Automatically generates meaningful thread names from original message content
  • Seamless Operation: Works in the background without requiring manual commands
  • Content Preservation: Maintains all reply content including text, attachments, and embeds
  • Permission Validation: Ensures proper bot permissions before attempting operations
  • Comprehensive Logging: Detailed logging for monitoring and debugging
  • Error Handling: Robust error handling with graceful fallbacks

πŸ”„ How It Works

  1. User posts a message in a Discord channel
  2. Another user replies to that message
  3. Thread It detects the reply and automatically:
    • Creates a public thread on the original message
    • Moves the reply content into the new thread
    • Removes the original reply from the main channel
    • Preserves all attachments, embeds, and formatting

The result: Clean main channels with organized discussions in dedicated threads!

πŸš€ Installation

Prerequisites

  • Python 3.9 or higher
  • A Discord bot token
  • Discord server with appropriate permissions

Step 1: Clone the Repository

git clone https://github.com/wei/thread-it.git
cd thread-it

Step 2: Set Up Virtual Environment

# Create virtual environment
python -m venv venv

# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate

Step 3: Install Dependencies

pip install -r requirements.txt

Step 4: Create Discord Bot

  1. Go to the Discord Developer Portal
  2. Create a new application
  3. Navigate to the "Bot" section
  4. Create a bot and copy the token
  5. Enable the following Privileged Gateway Intents:
    • Message Content Intent (required)
  6. Generate an invite URL with these permissions:
    • View Channels
    • Send Messages
    • Send Messages in Threads
    • Create Public Threads
    • Manage Messages
    • Read Message History

Step 5: Configure Environment Variables

# Copy the example environment file
cp .env.example .env

# Edit .env with your bot token
# DISCORD_TOKEN=your_bot_token_here
# LOG_LEVEL=INFO

Step 6: Run the Bot

python bot.py

πŸ“– Usage

Once installed and running, Thread It works automatically! No commands are needed.

Example Workflow

Main Channel:
πŸ‘€ Alice: "What's everyone's favorite Python library?"

πŸ‘€ Bob: "I love requests for HTTP calls!" (replies to Alice's message)

Result: Thread It automatically creates a thread titled "What's everyone's favorite Python library?" and moves Bob's reply into it.

Supported Content Types

  • βœ… Text messages
  • βœ… Images and attachments
  • βœ… Embeds
  • βœ… Message formatting (bold, italic, code blocks, etc.)
  • βœ… Mentions and links (cleaned from thread names)

Bot Behavior

  • Ignores bot messages: Prevents infinite loops
  • Only processes replies: Regular messages are left untouched
  • Skips existing threads: Won't create threads within threads
  • Validates permissions: Checks required permissions before acting
  • Sends helpful notifications: Briefly notifies users where to continue their conversation (auto-deletes after 8 seconds)
  • Handles errors gracefully: Logs issues without crashing

πŸ” Required Permissions

Thread It requires specific Discord permissions to function properly. When inviting the bot to your server, ensure these permissions are granted:

Bot Permissions

Permission Purpose
View Channels Read messages in channels
Send Messages Send messages in main channels
Send Messages in Threads Send messages in created threads
Create Public Threads Create threads on messages
Manage Messages Delete original reply messages
Read Message History Access message history for context

Gateway Intents

The following intents must be enabled in the Discord Developer Portal:

  • Message Content Intent (Privileged): Required to read message content

Permission Issues?

If you're experiencing permission-related problems, see our Troubleshooting Guide for detailed solutions.

πŸ“ž Support & Documentation

Getting Help

Quick Links

🀝 Contributing

We welcome contributions to Thread It! Whether you want to fix bugs, add features, or improve documentation, your help is appreciated.

Quick Start for Contributors:

  1. Read the Contributing Guide
  2. Fork the repository
  3. Set up your development environment
  4. Make your changes
  5. Submit a pull request

For detailed development setup, code style guidelines, testing requirements, and submission process, see our comprehensive Contributing Guide.

πŸ“„ License

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

MIT License Summary: You can use, modify, and distribute this project freely for commercial or private use. No warranty is provided.


πŸ™ Acknowledgments

  • Discord.py - The excellent Python library for Discord bot development
  • Discord - For providing the platform and API
  • Contributors - Everyone who has contributed to making Thread It better
  • Community - Users who provide feedback and report issues

About

🧡 A Discord bot that keeps channels clean by converting replies into threads.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%
0