109 lines
4.3 KiB
Markdown
109 lines
4.3 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 pastebin service (configurable)
|
|
- Clean channel output (banlist sent via pastebin link)
|
|
- Proper access control using Eggdrop flags
|
|
- Efficient mode queueing with pushmode
|
|
|
|
## Requirements
|
|
- Eggdrop 1.6.x or higher
|
|
- curl command-line tool (for pastebin uploads)
|
|
- netcat (optional, for alternative paste methods)
|
|
|
|
## 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" |
|
|
| 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 Pastebin Service
|
|
The script uses curl to upload ban lists. To change the pastebin service:
|
|
|
|
1. Locate this line in the banlist procs:
|
|
set result [exec cat $filename | curl -s -F file=@- http://hotpaste.0bin.xyz/]
|
|
|
|
2. Replace with your preferred service:
|
|
# For termbin.com
|
|
set result [exec cat $filename | nc termbin.com 9999]
|
|
|
|
# For your own pastebin
|
|
set result [exec curl -s -F file=@- http://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 pastebin 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. |