cordctl
A CLI utility to automate and simplify Discord server management tasks.
cordctl is currently under active development. While many core features are functional, it's not yet complete. Expect rough edges, potential bugs, and changes as development progresses.
Prerequisites
Before installing cordctl CLI, please ensure you have the following system dependencies:
- Python: Version 3.8 or higher.
- pip: Python package installer (usually comes with Python).
- FFmpeg (for music features):
- cordctl's music bot functionality requires FFmpeg to be installed and accessible in your system's PATH.
- Linux (Debian/Ubuntu):
sudo apt update && sudo apt install ffmpeg - Linux (Fedora):
sudo dnf install ffmpeg - macOS (Homebrew):
brew install ffmpeg - Windows: Download FFmpeg from the official FFmpeg website and add the
bindirectory to your system's PATH.
- Tkinter (for GUI elements):
- Tkinter is used for the graphical configuration tools (e.g., Welcomer GUI, Embed Builder).
- Windows & macOS: Usually included with Python.
- Linux: You might need to install it separately. For example, on Debian/Ubuntu:
sudo apt update && sudo apt install python3-tk. On Fedora:sudo dnf install python3-tkinter.
Table of Contents
About
cordctl helps Discord server administrators and moderators streamline common tasks through a command-line interface and interactive GUIs.
Features
- Bulk Channel Creation:
- Create multiple public text or voice channels with sequential naming.
- Create private channels with linked roles and configurable access permissions.
- Embed Builder GUI: construct embed messages with export/import functionality.
- Customizable Welcomer Bot & GUI:
- Design welcome images through tkinter GUI with backgrounds, avatar and text elements.
- Run bot for automatic personalized welcome images.
- Test with join simulation.
- Save/load JSON configurations.
- Role Management Bot:
- User-facing slash commands for role management (
/claim,/unclaim). - Optional unique role assignment.
- User-facing slash commands for role management (
- Basic Music Bot:
- Loop local MP3 files in voice channels.
- Guild Information: List Discord guilds your bot can access.
Installation
-
Prerequisites: Ensure all system dependencies listed above are met. You'll also need a Discord Bot Token and Client ID from the Discord Developer Portal.
-
Clone the repository:
git clone https://github.com/muzaffarmhd/cordctl.git cd cordctl
-
Set up a Virtual Environment (Recommended):
python -m venv venv
Activate it:
- macOS/Linux:
source venv/bin/activate - Windows:
venv\Scripts\activate
- macOS/Linux:
-
Install the CLI:
pip install .
Getting Started
-
Login: Configure cordctl with your Discord bot's credentials:
cordctl loginYou'll be prompted for your Bot Token and Client ID.
-
Refresh Guild Cache: After login, or if your bot's server membership changes, refresh the local guild cache:
cordctl refresh -
Explore Commands: See all commands:
cordctl --helpHelp for a specific command:
cordctl <command> --help # Example cordctl welcome run --help
Command Reference
Core
cordctl login- Description: Securely stores your Discord Bot Token and Client ID.
cordctl reset- Description: Removes stored Discord Bot Token and Client ID.
cordctl refresh- Description: Updates the local cache of guilds your bot is in.
cordctl list- Description: Lists guilds the authenticated bot is a member of. (Requires
cordctl refreshfirst).
- Description: Lists guilds the authenticated bot is a member of. (Requires
Channel Management
-
cordctl create-channels- Description: Creates multiple public text or voice channels.
- Options:
-t, --type [voice|text],--name TEXT,--start INTEGER,--end INTEGER. - Usage:
cordctl create-channels -t voice --name game-room --start 1 --end 5
-
cordctl create-private- Description: Creates private text/voice channels with corresponding roles.
- Options:
-t, --type [voice|text],--name TEXT,--start INTEGER,--end INTEGER,--exclude TEXT(comma-separated existing role names for access). - Usage:
cordctl create-private -t text --name project-zeta --start 1 --end 3 --exclude "Coordinator"
Embed Messages
cordctl embed- Description: Opens a GUI to build and send a Discord embed message. Prompts for Channel ID.
- GUI Features: Content, title, URL, description, color, author, image, thumbnail, footer, fields, timestamp. Supports JSON export/import.
Welcomer Bot
-
cordctl welcome config- Description: Opens a GUI to design the welcome image.
- GUI Features: Canvas preview, dimensions, background (color/image), avatar (visibility, size, position), multiple draggable text elements (content with
{username}, font, size, color). Supports JSON save/load.- Custom Backgrounds: Copied to
assets/relative to the saved config JSON. - Custom Fonts: Place
.ttffiles inassets/fonts/relative to the saved config JSON.
- Custom Backgrounds: Copied to
-
cordctl welcome run- Description: Runs the Welcomer Bot to greet new members.
- Options:
-c, --config FILEPATH: (Required) Path to the welcome image configuration JSON.--simulate-join / --no-simulate-join: (Optional) Simulate a member join for testing.
- Usage:
cordctl welcome run -c /path/to/config.json --simulate-join
Role Management
cordctl handle-roles- Description: Runs a bot that allows users to claim/unclaim roles using slash commands.
- Options:
--private: If set, a user can only have one role (other than@everyone) managed by this system at a time.
- Slash Commands:
/claim <role_name>: User claims the specified role./unclaim <role_name>: User removes the specified role.
Music Bot
cordctl play-music <playlist_directory>- Description: Runs a basic music bot that joins the voice channel of the user who types
!joinand plays.mp3files from the specified<playlist_directory>on loop. - Bot Commands (in Discord chat):
!join: Bot joins your current voice channel and starts playing music.
- Note: Requires FFmpeg to be installed and in PATH.
- Description: Runs a basic music bot that joins the voice channel of the user who types
Contributing
Contributions are welcome! Please:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-featureorfix/your-fix). - Make changes and commit them.
- Push your branch.
- Submit a pull request.
License
This project is licensed under the MIT License.
Metadata
Release files for cordctl 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| cordctl-0.0.2.tar.gz | 26.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cordctl-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 53.7 kB
Release files / cordctl-0.0.2.tar.gz
| Download URL | cordctl-0.0.2.tar.gz |
|---|---|
| Size | 26.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eb9860010e4f7f513b738d5c05d8881075715ee6ab98fac31e3a5b6b553f1a83
|
|
BLAKE2b-256 checksum How to use checksums |
445e8b341a32a78c36347589ee033a21040f1deb1f4d2efe62aeeaf761c8e3fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Release files / cordctl-0.0.2-py3-none-any.whl
| Download URL | cordctl-0.0.2-py3-none-any.whl |
|---|---|
| Size | 27.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c65bd01f227fa06c3df4dccccf0139b81a62fd736ebb2f6dfbcbd470f65ee444
|
|
BLAKE2b-256 checksum How to use checksums |
c0e2670274469f6d0f02bbbeb41925b2abdf305d994369cbfd1e0890541a4819
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Security for cordctl 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.