A secure system for installing and managing private GitHub plugins in your Modmail bot with enhanced features and better reliability.
You can achieve the same by placing your
GITHUB_TOKENinside the.envof your bot. Remember that you shouldn't install any plugins in your bot, since they have full control and can hack your guild and NUKE it. If you install any plugin, it must be from a dev you trust!
- Private Repo Support: Install plugins from private repositories without using
.env - Interactive UI: Paginated embeds with reaction controls
- Auto-Detection: Smart cog name detection for better compatibility
- Progress Tracking: Real-time loading status updates
- Help Integration: Automatic command help display after successful install
?plugin add WebKide/modmail-plugins/private-plugins@mainReplace
?with your bot's prefix if you changed it
- Go to GitHub Token Settings
- Select scopes
Scopes define the access for personal tokens.
-
✅ repo
(Full control of private repositories)-
repo:status
(Access commit status) -
repo_deployment
(Access deployment status) -
public_repo
(Access public repositories) -
repo:invite
(Access repository invitations) -
security_events
(Read and write security events)
-
-
No other scopes needed
- Expiration
(recommended: 90 days) ⚠️ Make sure to copy your personal access token now. You won’t be able to see it again!
- 🔐 Token grants read access to ALL private repos
- 🚫 Never commit tokens to code
- 🔄 Rotate tokens periodically
| Command | Description | Example |
|---|---|---|
?private token <token> |
Store/verify GitHub token | ?private token ghp_abc123 |
?private testtoken |
Verify token validity | ?private testtoken |
?private testrepo |
Test repository access | ?private testrepo user repo |
| Command | Description | Example |
|---|---|---|
?private load <user/repo/name@branch> |
Install with progress tracking | ?private load user/repo/plugin-name@branch |
?private unload <user/repo/name@branch> |
Remove plugin completely | ?private unload user/repo/plugin-name@main |
?private validate <name> |
Check plugin structure | ?private validate plugin-name |
?private guide |
Show plugin structure guide | ?private guide |
| Command | Description | UI Features |
|---|---|---|
?private update |
Updater interface | 1️⃣-8️⃣: Update plugins ⬅️➡️: Pagination |
?private loaded |
View installed plugins | Shows branch info |
?private debug |
Repository debug tool | Checks access and structure |
1. User: ?private load user/repo/plugin-name@main
2. Bot: » Downloading plugin-name@main...
3. Bot: ✅ Downloaded! Now loading...
4. Bot: ✅ Successfully loaded plugin-name!
5. Bot: Shows available commands automaticallyAfter loading any plugin:
- Automatically displays available commands
- Shows correct help command (
?help YourPrivateCogName) - Handles nested plugin structures
- Detailed error messages with trace information
- Directory structure validation
- Requirements.txt installation feedback
+ PRIVATE PLUGINS (PAGE 1/2) +
1️⃣ /private-plugin-name@master
user/repo | User analytics system
2️⃣ /private-plugin-name@master
user/repo | Automated DB backups
...
⬅️ ➡️ (Navigate)
React with number to update private-pluginQ: How are cog names detected?
A: The system automatically scans for class YourPrivateCogName(commands.Cog) in plugin files.
Q: What if my plugin has a different structure?
A: Use ?private guide to see the recommended structure and addapt accordingly.
Q: Can I see plugin loading progress?
A: Yes! The bot now shows real-time download and load status, with clear error messages.
Q: How do I troubleshoot installation issues?
A: Use ?private debug user repo branch to diagnose problems.
Issue: "Could not find plugin directory"
- Check repository structure matches
?private guide - Verify branch exists, usually
@main - Use
?private debugto test access
Issue: "Missing setup function"
- Ensure
__init__.pycontainssetup(bot) - Validate with
?private validate plugin-name
Issue: "Commands not showing in help"
- Check cog class inherits from
commands.Cog - Verify command decorators are properly used
- Use
?private guideto compare your implementation
Run ?private guide to see:
- Required repository structure
- Example cog implementation
- Installation command format
- Best practices for plugin development