113 lines
4.4 KiB
Markdown
113 lines
4.4 KiB
Markdown
# Channel Management TCL Script for Eggdrop
|
|
|
|
## Description
|
|
A comprehensive channel management script for Eggdrop bots that provides both public and private commands for banning, temporary banning, kicking, unbanning, and viewing ban lists.
|
|
|
|
## Features
|
|
- Public commands using configurable trigger (!ban, !tban, !kick, !unban, !banlist, !opcmds)
|
|
- Private message commands (ban, tban, kick, unban, banlist, opcmds)
|
|
- Permanent and temporary bans with configurable duration
|
|
- Automatic banmask generation with multiple mask types
|
|
- Special handling for uid/sid hosts
|
|
- Anti-abuse protection (cannot ban/kick the bot itself)
|
|
- Ban list uploads to a configurable file hosting service
|
|
- Clean channel output (banlist sent via upload link)
|
|
- Proper access control using Eggdrop flags
|
|
- Efficient mode queueing with pushmode
|
|
|
|
## Requirements
|
|
- Eggdrop 1.6.x or higher
|
|
- curl command-line tool (for ban list uploads)
|
|
|
|
## Installation
|
|
1. Copy the script to your Eggdrop scripts directory
|
|
2. Add the following line to your Eggdrop config file:
|
|
source scripts/chanmanagement.tcl
|
|
3. Rehash or restart your Eggdrop
|
|
|
|
## Configuration
|
|
All configuration variables are at the top of the script:
|
|
|
|
| Variable | Description | Default |
|
|
|----------|-------------|---------|
|
|
| trigger | Command trigger character | "!" |
|
|
| banReason | Reason for permanent bans | "User has been banned from the channel." |
|
|
| tBanReason | Reason for temporary bans | "User has been temporarily banned from the channel." |
|
|
| kickReason | Reason for kicks | "Your behaviour is not conducive to the desired environment." |
|
|
| revengeKick | Message when someone tries to ban/kick the bot | "Very funny... NOT" |
|
|
| tBanDuration | Temporary ban duration in minutes | "30" |
|
|
| upCommand | Command used to upload the ban list | "curl -s -F file=@- https://x0.at/" |
|
|
| banMask | Banmask type (0-9) | "2" |
|
|
|
|
### Banmask Types
|
|
- 0: \*!user@host
|
|
- 1: \*!\*user@host
|
|
- 2: \*!\*@host
|
|
- 3: \*!\*user@*.host
|
|
- 4: \*!\*@*.host
|
|
- 5: nick!user@host
|
|
- 6: nick!\*user@host
|
|
- 7: nick!\*@host
|
|
- 8: nick!\*user@*.host
|
|
- 9: nick!\*@*.host
|
|
|
|
## Commands
|
|
|
|
### Public Commands (in channel)
|
|
| Command | Syntax | Description |
|
|
|---------|--------|-------------|
|
|
| ban | !ban \<nick> | Permanently ban a user |
|
|
| tban | !tban \<nick> | Temporarily ban a user |
|
|
| kick | !kick \<nick> | Kick a user from channel |
|
|
| unban | !unban \<mask> | Remove a ban by mask |
|
|
| banlist | !banlist | Get link to current ban list |
|
|
| opcmds | !opcmds | List available commands |
|
|
|
|
### Private Commands (via /msg)
|
|
| Command | Syntax | Description |
|
|
|---------|--------|-------------|
|
|
| ban | /msg botnick ban <#chan> \<nick> | Permanently ban a user |
|
|
| tban | /msg botnick tban <#chan> \<nick> | Temporarily ban a user |
|
|
| kick | /msg botnick kick <#chan> \<nick> | Kick a user from channel |
|
|
| unban | /msg botnick unban <#chan> \<mask> | Remove a ban by mask |
|
|
| banlist | /msg botnick banlist <#chan> | Get link to current ban list |
|
|
| opcmds | /msg botnick opcmds <#chan> | List available commands |
|
|
|
|
## Access Control
|
|
Users need either:
|
|
- Global +o flag, OR
|
|
- Channel +o flag on the specific channel
|
|
|
|
## Customizing the Upload Service
|
|
The upload command is controlled by the `upCommand` configuration variable. The ban list file is piped into the command via stdin, so your command must read from stdin. The default uses x0.at:
|
|
|
|
```
|
|
variable upCommand "curl -s -F file=@- https://x0.at/"
|
|
```
|
|
|
|
To use a different service, replace the value with any command that reads from stdin and returns a URL:
|
|
|
|
```
|
|
# For termbin.com
|
|
variable upCommand "nc termbin.com 9999"
|
|
|
|
# For your own pastebin
|
|
variable upCommand "curl -s -F file=@- https://your-pastebin.com/upload"
|
|
```
|
|
|
|
## Important Notes
|
|
- Do not modify code below the configuration section unless you understand TCL
|
|
- The script includes protection against banning/kicking the bot itself
|
|
- Temporary bans use Eggdrop's internal ban expiration
|
|
- Ban lists are uploaded as text files and a link is returned to the user
|
|
|
|
## Troubleshooting
|
|
- "Failed to upload ban list": Check that curl is installed and the upload service is accessible
|
|
- Commands not working: Verify the user has appropriate flags (o|o)
|
|
- Bot not responding: Ensure the script is loaded and binds are active
|
|
|
|
## License
|
|
This script is provided as-is. Use at your own risk. The author is not responsible for any midnight visitations resulting from improper modification of the code.
|
|
|
|
## Author
|
|
Your friendly neighborhood script writer who will definitely not touch you at night if you follow the instructions. |