da80dbb153
Remove InspIRCd mention because this script is mainly for UnrealIRCd-based networks. Also, that was a bad summary from ChatGPT.
506 lines
25 KiB
Markdown
506 lines
25 KiB
Markdown
Read this document in:
|
|
[🇬🇧 English](#channel-management)
|
|
[🇮🇹 Italian](#channel-management---versione-italiana)
|
|
[🇵🇹 Portuguese](#channel-management---vers%C3%A3o-portuguesa)
|
|
|
|
---
|
|
|
|
# Channel Management
|
|
|
|
An Eggdrop script for IRC channel management. Provides ops with commands to ban, kick, voice, and manage the bot's internal ban list, with support for automatic ban tracking and multiple languages.
|
|
|
|
---
|
|
|
|
## Requirements
|
|
|
|
- Eggdrop 1.8+
|
|
- Tcl 8.5+
|
|
- `msgcat` package (included in Tcl's standard library)
|
|
|
|
---
|
|
|
|
## Installation
|
|
|
|
1. Copy `cmgmt.tcl` to your Eggdrop `scripts/` directory.
|
|
2. Copy the `cmgmt_langs/` directory to your Eggdrop `scripts/` directory.
|
|
3. Add the following line to your Eggdrop configuration file:
|
|
```
|
|
source scripts/cmgmt.tcl
|
|
```
|
|
4. Rehash or restart your bot.
|
|
|
|
---
|
|
|
|
## Configuration
|
|
|
|
All configuration is done at the top of `cmgmt.tcl`.
|
|
|
|
| Variable | Default | Description |
|
|
|---|---|---|
|
|
| `locale` | `en` | Language to use. Must match a file in `cmgmt_langs/` (e.g. `en`, `pt`, `it`) |
|
|
| `trigger` | `@` | Prefix for public commands |
|
|
| `tBanDuration` | `30` | Duration of temporary bans, in minutes |
|
|
| `upCommand` | `curl -s -F file=@- https://x0.at/` | Command used to upload the ban list. Must read from stdin |
|
|
| `banMask` | `2` | Ban mask type used when banning a user by nick (see mask types below) |
|
|
| `addOpMask` | `1` | Mask type used when adding a user as op (see mask types below) |
|
|
| `protectMasks` | `*!*@services.ptirc.org` | Masks that can never be banned or kicked |
|
|
| `noAddNicks` | `ChanServ NickServ ChanBot` | Nicks to ignore when auto-adding bans |
|
|
| `noAddMasks` | `*!*@services.ptirc.org` | Masks to ignore when auto-adding bans |
|
|
|
|
### Ban Mask Types
|
|
|
|
| Value | Mask format |
|
|
|---|---|
|
|
| 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
|
|
|
|
Commands marked with **[o]** require the `o` (op) flag on the channel. Commands marked with **[n]** require the `n` (owner) flag globally. Commands are available both publicly in the channel (prefixed with the trigger) and privately via `/msg` to the bot.
|
|
|
|
### Public Commands (in channel)
|
|
|
|
| Command | Flag | Description |
|
|
|---|---|---|
|
|
| `@addban <mask>` | [o] | Adds a raw ban mask directly to the bot's ban list and sets it on the channel. The mask must be properly formatted (e.g. `*!*@host`) |
|
|
| `@ban <nick>` | [o] | Bans a user from the channel and adds the mask to the bot's ban list |
|
|
| `@tban <nick>` | [o] | Temporarily bans a user for the duration set in `tBanDuration` |
|
|
| `@kick <nick>` | [o] | Kicks a user from the channel |
|
|
| `@voice <nick>` | [o] | Gives voice (+v) to a user |
|
|
| `@devoice <nick>` | [o] | Removes voice (-v) from a user |
|
|
| `@unban <mask>` | [o] | Removes a ban mask from the channel and the bot's ban list |
|
|
| `@banlist` | [o] | Uploads the bot's ban list for the channel and posts a link |
|
|
| `@autoadd <on/off/status>` | [o] | Enables, disables, or checks the status of automatic ban adding |
|
|
| `@addop <nick>` | [n] | Adds a user as op for the channel in the bot's database |
|
|
| `@delop <nick>` | [n] | Removes a user's op access for the channel from the bot's database |
|
|
| `@addvoice <nick>` | [n] | Adds a user as voice for the channel in the bot's database |
|
|
| `@delvoice <nick>` | [n] | Removes a user's voice access for the channel from the bot's database |
|
|
| `@ops` | [n] | Lists all ops registered for the channel in the bot's database |
|
|
| `@voices` | [n] | Lists all voices registered for the channel in the bot's database |
|
|
| `@opcmds` | [o] | Lists all available commands |
|
|
|
|
### Private Commands (via /msg)
|
|
|
|
The syntax is the same but requires the channel to be specified as the first argument.
|
|
|
|
| Command | Flag | Description |
|
|
|---|---|---|
|
|
| `addban <#chan> <mask>` | [o] | Adds a raw ban mask directly to the bot's ban list and sets it on the channel |
|
|
| `ban <#chan> <nick>` | [o] | Bans a user from the specified channel |
|
|
| `tban <#chan> <nick>` | [o] | Temporarily bans a user from the specified channel |
|
|
| `kick <#chan> <nick>` | [o] | Kicks a user from the specified channel |
|
|
| `voice <#chan> <nick>` | [o] | Gives voice to a user in the specified channel |
|
|
| `devoice <#chan> <nick>` | [o] | Removes voice from a user in the specified channel |
|
|
| `unban <#chan> <mask>` | [o] | Removes a ban mask from the specified channel |
|
|
| `banlist <#chan>` | [o] | Uploads and sends the ban list for the specified channel |
|
|
| `autoadd <#chan> <on/off/status>` | [o] | Manages automatic ban adding for the specified channel |
|
|
| `addop <#chan> <nick>` | [n] | Adds a user as op for the specified channel |
|
|
| `delop <#chan> <nick>` | [n] | Removes a user's op access for the specified channel |
|
|
| `addvoice <#chan> <nick>` | [n] | Adds a user as voice for the specified channel |
|
|
| `delvoice <#chan> <nick>` | [n] | Removes a user's voice access for the specified channel |
|
|
| `ops <#chan>` | [n] | Lists all ops registered for the specified channel |
|
|
| `voices <#chan>` | [n] | Lists all voices registered for the specified channel |
|
|
| `opcmds <#chan>` | [o] | Lists all available commands |
|
|
|
|
---
|
|
|
|
## Automatic Ban Tracking
|
|
|
|
When enabled, the bot automatically mirrors IRC bans (`+b` modes) into its internal ban list. This keeps the bot's ban list in sync with the channel's ban list regardless of who sets the bans.
|
|
|
|
- Bans matching `protectMasks` are never added and will be immediately removed if set.
|
|
- Bans matching any host belonging to a user with the `m`, `n`, or `o` flag are protected and will be immediately removed.
|
|
- Extended bans (masks starting with `~`) are tracked separately as `EXTBAN` entries and marked as sticky.
|
|
- Auto-tracking is per-channel and is toggled with `@autoadd on/off`.
|
|
- Op notices (`NOTICE @#channel`) are sent when bans are automatically added.
|
|
- Every 5 minutes, the bot scans all channels for existing extended bans and adds any that are not yet in its internal list, also marking them as sticky.
|
|
|
|
---
|
|
|
|
## Language Support
|
|
|
|
The script uses Tcl's `msgcat` package for internationalisation. Language files are stored in `scripts/cmgmt_langs/` and named by locale (e.g. `en.msg`, `pt.msg`, `it.msg`).
|
|
|
|
To change the language, set the `locale` variable in the configuration section to the desired locale code.
|
|
|
|
### Available Languages
|
|
|
|
| Code | Language |
|
|
|---|---|
|
|
| `en` | English |
|
|
| `pt` | Portuguese (European) |
|
|
| `it` | Italian |
|
|
|
|
To add a new language, copy `en.msg`, rename it to the desired locale code, and translate the strings. The `%1$s` positional placeholders must be kept in the same order as described in the comments above each entry. The `is.enabled` and `is.disabled` keys are used as the substituted value inside the `autoadd.status` message, so they should be translated as a single word or short phrase that fits naturally into that sentence.
|
|
|
|
### Custom Upload Command
|
|
|
|
The `upCommand` variable accepts any command that reads from stdin and returns a URL. Some examples:
|
|
|
|
```tcl
|
|
# x0.at (default)
|
|
variable upCommand "curl -s -F file=@- https://x0.at/"
|
|
|
|
# termbin.com
|
|
variable upCommand "nc termbin.com 9999"
|
|
|
|
# Your own pastebin
|
|
variable upCommand "curl -s -F file=@- https://your-pastebin.com/upload"
|
|
```
|
|
|
|
---
|
|
|
|
## Notes
|
|
|
|
- The bot will not ban, kick, or remove voice from users with the `o` flag or users matching `protectMasks`.
|
|
- If someone tries to use a ban/kick command on the bot itself, the bot will kick them instead.
|
|
- `@addban` expects a correctly formatted mask. No mask generation is done — what you type is what gets set.
|
|
- `@ban` and `@tban` generate the ban mask automatically from the target's host, using the type set in `banMask`. If the host begins with `uid` or `sid`, the mask is always set to `*!*@host` regardless of `banMask`.
|
|
- The ban list upload requires an external command that reads from stdin. The default uses [x0.at](https://x0.at/). This can be changed via the `upCommand` variable.
|
|
- Extended bans are tracked but not managed by the bot's ban/unban commands — they are handled solely through IRC mode changes.
|
|
|
|
---
|
|
|
|
---
|
|
|
|
# Channel Management - Versione Italiana
|
|
|
|
Uno script Eggdrop per la gestione dei canali IRC. Fornisce agli op i comandi per bannare, kickare, assegnare la voice e gestire la lista ban interna del bot, con supporto per il tracciamento automatico dei ban e per più lingue.
|
|
|
|
---
|
|
|
|
## Requisiti
|
|
|
|
- Eggdrop 1.8+
|
|
- Tcl 8.5+
|
|
- Pacchetto `msgcat` (incluso nella libreria standard di Tcl)
|
|
|
|
---
|
|
|
|
## Installazione
|
|
|
|
1. Copia `cmgmt.tcl` nella directory `scripts/` di Eggdrop.
|
|
2. Copia la directory `cmgmt_langs/` nella directory `scripts/` di Eggdrop.
|
|
3. Aggiungi la seguente riga al file di configurazione di Eggdrop:
|
|
```
|
|
source scripts/cmgmt.tcl
|
|
```
|
|
4. Esegui il rehash o riavvia il bot.
|
|
|
|
---
|
|
|
|
## Configurazione
|
|
|
|
Tutta la configurazione si trova all'inizio di `cmgmt.tcl`.
|
|
|
|
| Variabile | Predefinito | Descrizione |
|
|
|---|---|---|
|
|
| `locale` | `en` | Lingua da utilizzare. Deve corrispondere a un file in `cmgmt_langs/` (es. `en`, `pt`, `it`) |
|
|
| `trigger` | `@` | Prefisso per i comandi pubblici |
|
|
| `tBanDuration` | `30` | Durata dei ban temporanei, in minuti |
|
|
| `upCommand` | `curl -s -F file=@- https://x0.at/` | Comando per caricare la lista ban. Deve leggere dallo stdin |
|
|
| `banMask` | `2` | Tipo di banmask utilizzata quando si banna un utente per nick (vedi i tipi di mask qui sotto) |
|
|
| `addOpMask` | `1` | Tipo di mask utilizzata quando si aggiunge un utente come op (vedi i tipi di mask qui sotto) |
|
|
| `protectMasks` | `*!*@services.ptirc.org` | Mask che non possono mai essere bannate o kickate |
|
|
| `noAddNicks` | `ChanServ NickServ ChanBot` | Nick da ignorare durante l'aggiunta automatica dei ban |
|
|
| `noAddMasks` | `*!*@services.ptirc.org` | Mask da ignorare durante l'aggiunta automatica dei ban |
|
|
|
|
### Tipi di Banmask
|
|
|
|
| Valore | Formato della mask |
|
|
|---|---|
|
|
| 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` |
|
|
|
|
---
|
|
|
|
## Comandi
|
|
|
|
I comandi contrassegnati con **[o]** richiedono il flag `o` (op) sul canale. I comandi contrassegnati con **[n]** richiedono il flag `n` (owner) globale. I comandi sono disponibili sia pubblicamente nel canale (preceduti dal trigger) che privatamente tramite `/msg` al bot.
|
|
|
|
### Comandi Pubblici (nel canale)
|
|
|
|
| Comando | Flag | Descrizione |
|
|
|---|---|---|
|
|
| `@addban <mask>` | [o] | Aggiunge una banmask grezza direttamente alla lista ban del bot e la imposta sul canale. La mask deve essere correttamente formattata (es. `*!*@host`) |
|
|
| `@ban <nick>` | [o] | Banna un utente dal canale e aggiunge la mask alla lista ban del bot |
|
|
| `@tban <nick>` | [o] | Banna temporaneamente un utente per la durata impostata in `tBanDuration` |
|
|
| `@kick <nick>` | [o] | Kicka un utente dal canale |
|
|
| `@voice <nick>` | [o] | Assegna la voice (+v) a un utente |
|
|
| `@devoice <nick>` | [o] | Rimuove la voice (-v) a un utente |
|
|
| `@unban <mask>` | [o] | Rimuove una banmask dal canale e dalla lista ban del bot |
|
|
| `@banlist` | [o] | Carica la lista ban del canale e pubblica il link |
|
|
| `@autoadd <on/off/status>` | [o] | Abilita, disabilita o controlla lo stato dell'aggiunta automatica dei ban |
|
|
| `@addop <nick>` | [n] | Aggiunge un utente come op del canale nel database del bot |
|
|
| `@delop <nick>` | [n] | Rimuove i permessi di op di un utente per il canale dal database del bot |
|
|
| `@addvoice <nick>` | [n] | Aggiunge un utente come voice del canale nel database del bot |
|
|
| `@delvoice <nick>` | [n] | Rimuove i permessi di voice di un utente per il canale dal database del bot |
|
|
| `@ops` | [n] | Elenca tutti gli op registrati per il canale nel database del bot |
|
|
| `@voices` | [n] | Elenca tutte le voice registrate per il canale nel database del bot |
|
|
| `@opcmds` | [o] | Elenca tutti i comandi disponibili |
|
|
|
|
### Comandi Privati (via /msg)
|
|
|
|
La sintassi è la stessa ma richiede il canale come primo argomento.
|
|
|
|
| Comando | Flag | Descrizione |
|
|
|---|---|---|
|
|
| `addban <#chan> <mask>` | [o] | Aggiunge una banmask grezza direttamente alla lista ban del bot e la imposta sul canale |
|
|
| `ban <#chan> <nick>` | [o] | Banna un utente dal canale specificato |
|
|
| `tban <#chan> <nick>` | [o] | Banna temporaneamente un utente dal canale specificato |
|
|
| `kick <#chan> <nick>` | [o] | Kicka un utente dal canale specificato |
|
|
| `voice <#chan> <nick>` | [o] | Assegna la voice a un utente nel canale specificato |
|
|
| `devoice <#chan> <nick>` | [o] | Rimuove la voice a un utente nel canale specificato |
|
|
| `unban <#chan> <mask>` | [o] | Rimuove una banmask dal canale specificato |
|
|
| `banlist <#chan>` | [o] | Carica e invia la lista ban del canale specificato |
|
|
| `autoadd <#chan> <on/off/status>` | [o] | Gestisce l'aggiunta automatica dei ban per il canale specificato |
|
|
| `addop <#chan> <nick>` | [n] | Aggiunge un utente come op del canale specificato |
|
|
| `delop <#chan> <nick>` | [n] | Rimuove i permessi di op di un utente per il canale specificato |
|
|
| `addvoice <#chan> <nick>` | [n] | Aggiunge un utente come voice del canale specificato |
|
|
| `delvoice <#chan> <nick>` | [n] | Rimuove i permessi di voice di un utente per il canale specificato |
|
|
| `ops <#chan>` | [n] | Elenca tutti gli op registrati per il canale specificato |
|
|
| `voices <#chan>` | [n] | Elenca tutte le voice registrate per il canale specificato |
|
|
| `opcmds <#chan>` | [o] | Elenca tutti i comandi disponibili |
|
|
|
|
---
|
|
|
|
## Tracciamento Automatico dei Ban
|
|
|
|
Quando abilitato, il bot registra automaticamente i ban IRC (mode `+b`) nella sua lista ban interna, mantenendola sincronizzata con quella del canale indipendentemente da chi imposta i ban.
|
|
|
|
- I ban che corrispondono a `protectMasks` non vengono mai aggiunti e vengono rimossi immediatamente se impostati.
|
|
- I ban che corrispondono a un host di un utente con flag `m`, `n` o `o` sono protetti e vengono rimossi immediatamente.
|
|
- I ban estesi (mask che iniziano con `~`) vengono tracciati separatamente come voci `EXTBAN` e contrassegnati come sticky.
|
|
- Il tracciamento automatico è per-canale e si attiva con `@autoadd on/off`.
|
|
- Quando i ban vengono aggiunti automaticamente, viene inviata una notice agli op (`NOTICE @#canale`).
|
|
- Ogni 5 minuti, il bot analizza tutti i canali alla ricerca di ban estesi esistenti e aggiunge quelli non ancora presenti nella sua lista interna, contrassegnandoli come sticky.
|
|
|
|
---
|
|
|
|
## Supporto Multilingua
|
|
|
|
Lo script utilizza il pacchetto `msgcat` di Tcl per l'internazionalizzazione. I file di lingua si trovano in `scripts/cmgmt_langs/` e sono nominati in base al codice locale (es. `en.msg`, `pt.msg`, `it.msg`).
|
|
|
|
Per cambiare lingua, imposta la variabile `locale` nella sezione di configurazione con il codice locale desiderato.
|
|
|
|
### Lingue Disponibili
|
|
|
|
| Codice | Lingua |
|
|
|---|---|
|
|
| `en` | Inglese |
|
|
| `pt` | Portoghese (Europeo) |
|
|
| `it` | Italiano |
|
|
|
|
Per aggiungere una nuova lingua, copia `en.msg`, rinominalo con il codice locale desiderato e traduci le stringhe. I segnaposto posizionali `%1$s` devono essere mantenuti nell'ordine indicato nei commenti sopra ogni voce. Le chiavi `is.enabled` e `is.disabled` vengono usate come valore sostituito all'interno del messaggio `autoadd.status`, quindi devono essere tradotte come una parola o una breve espressione che si inserisca naturalmente in quella frase.
|
|
|
|
### Comando di Upload Personalizzato
|
|
|
|
La variabile `upCommand` accetta qualsiasi comando che legga dallo stdin e restituisca un URL. Alcuni esempi:
|
|
|
|
```tcl
|
|
# x0.at (predefinito)
|
|
variable upCommand "curl -s -F file=@- https://x0.at/"
|
|
|
|
# termbin.com
|
|
variable upCommand "nc termbin.com 9999"
|
|
|
|
# Il tuo pastebin
|
|
variable upCommand "curl -s -F file=@- https://tuo-pastebin.com/upload"
|
|
```
|
|
|
|
---
|
|
|
|
## Note
|
|
|
|
- Il bot non bannerà , kickerà o rimuoverà la voice agli utenti con flag `o` o che corrispondono a `protectMasks`.
|
|
- Se qualcuno tenta di usare un comando ban/kick sul bot stesso, il bot kickerà lui al suo posto.
|
|
- `@addban` si aspetta una mask correttamente formattata. Non viene effettuata alcuna generazione automatica della mask — quello che scrivi è quello che viene impostato.
|
|
- `@ban` e `@tban` generano automaticamente la banmask dall'host del bersaglio, usando il tipo impostato in `banMask`. Se l'host inizia con `uid` o `sid`, la mask viene sempre impostata come `*!*@host` indipendentemente da `banMask`.
|
|
- Il caricamento della lista ban richiede un comando esterno che legga dallo stdin. Il predefinito utilizza [x0.at](https://x0.at/). Può essere cambiato tramite la variabile `upCommand`.
|
|
- I ban estesi vengono tracciati ma non gestiti dai comandi ban/unban del bot — vengono gestiti esclusivamente tramite i cambi di mode IRC.
|
|
|
|
---
|
|
|
|
---
|
|
|
|
# Channel Management - Versão Portuguesa
|
|
|
|
Um script Eggdrop para gestão de canais IRC. Fornece aos ops comandos para banir, kickar, atribuir voice e gerir a lista de bans interna do bot, com suporte para rastreamento automático de bans e múltiplos idiomas.
|
|
|
|
---
|
|
|
|
## Requisitos
|
|
|
|
- Eggdrop 1.8+
|
|
- Tcl 8.5+
|
|
- Pacote `msgcat` (incluÃdo na biblioteca padrão do Tcl)
|
|
|
|
---
|
|
|
|
## Instalação
|
|
|
|
1. Copia `cmgmt.tcl` para a directoria `scripts/` do Eggdrop.
|
|
2. Copia a directoria `cmgmt_langs/` para a directoria `scripts/` do Eggdrop.
|
|
3. Adiciona a seguinte linha ao ficheiro de configuração do Eggdrop:
|
|
```
|
|
source scripts/cmgmt.tcl
|
|
```
|
|
4. Faz rehash ou reinicia o bot.
|
|
|
|
---
|
|
|
|
## Configuração
|
|
|
|
Toda a configuração é feita no inÃcio de `cmgmt.tcl`.
|
|
|
|
| Variável | Predefinição | Descrição |
|
|
|---|---|---|
|
|
| `locale` | `en` | Idioma a utilizar. Tem de corresponder a um ficheiro em `cmgmt_langs/` (ex. `en`, `pt`, `it`) |
|
|
| `trigger` | `@` | Prefixo para os comandos públicos |
|
|
| `tBanDuration` | `30` | Duração dos bans temporários, em minutos |
|
|
| `upCommand` | `curl -s -F file=@- https://x0.at/` | Comando para carregar a lista de bans. Tem de ler do stdin |
|
|
| `banMask` | `2` | Tipo de banmask utilizada ao banir um utilizador por nick (ver tipos de mask abaixo) |
|
|
| `addOpMask` | `1` | Tipo de mask utilizada ao adicionar um utilizador como op (ver tipos de mask abaixo) |
|
|
| `protectMasks` | `*!*@services.ptirc.org` | Masks que nunca podem ser banidas ou kickadas |
|
|
| `noAddNicks` | `ChanServ NickServ ChanBot` | Nicks a ignorar na adição automática de bans |
|
|
| `noAddMasks` | `*!*@services.ptirc.org` | Masks a ignorar na adição automática de bans |
|
|
|
|
### Tipos de Banmask
|
|
|
|
| Valor | Formato da mask |
|
|
|---|---|
|
|
| 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` |
|
|
|
|
---
|
|
|
|
## Comandos
|
|
|
|
Os comandos marcados com **[o]** requerem o flag `o` (op) no canal. Os comandos marcados com **[n]** requerem o flag `n` (owner) globalmente. Os comandos estão disponÃveis tanto publicamente no canal (prefixados com o trigger) como privadamente via `/msg` ao bot.
|
|
|
|
### Comandos Públicos (no canal)
|
|
|
|
| Comando | Flag | Descrição |
|
|
|---|---|---|
|
|
| `@addban <mask>` | [o] | Adiciona uma banmask directamente à lista de bans do bot e define-a no canal. A mask tem de estar correctamente formatada (ex. `*!*@host`) |
|
|
| `@ban <nick>` | [o] | Bane um utilizador do canal e adiciona a mask à lista de bans do bot |
|
|
| `@tban <nick>` | [o] | Bane temporariamente um utilizador pelo tempo definido em `tBanDuration` |
|
|
| `@kick <nick>` | [o] | Kicka um utilizador do canal |
|
|
| `@voice <nick>` | [o] | Atribui voice (+v) a um utilizador |
|
|
| `@devoice <nick>` | [o] | Remove a voice (-v) a um utilizador |
|
|
| `@unban <mask>` | [o] | Remove uma banmask do canal e da lista de bans do bot |
|
|
| `@banlist` | [o] | Carrega a lista de bans do canal e publica o link |
|
|
| `@autoadd <on/off/status>` | [o] | Activa, desactiva ou verifica o estado da adição automática de bans |
|
|
| `@addop <nick>` | [n] | Adiciona um utilizador como op do canal na base de dados do bot |
|
|
| `@delop <nick>` | [n] | Remove o acesso de op de um utilizador para o canal da base de dados do bot |
|
|
| `@addvoice <nick>` | [n] | Adiciona um utilizador como voice do canal na base de dados do bot |
|
|
| `@delvoice <nick>` | [n] | Remove o acesso de voice de um utilizador para o canal da base de dados do bot |
|
|
| `@ops` | [n] | Lista todos os ops registados para o canal na base de dados do bot |
|
|
| `@voices` | [n] | Lista todas as voices registadas para o canal na base de dados do bot |
|
|
| `@opcmds` | [o] | Lista todos os comandos disponÃveis |
|
|
|
|
### Comandos Privados (via /msg)
|
|
|
|
A sintaxe é a mesma mas requer o canal como primeiro argumento.
|
|
|
|
| Comando | Flag | Descrição |
|
|
|---|---|---|
|
|
| `addban <#chan> <mask>` | [o] | Adiciona uma banmask directamente à lista de bans do bot e define-a no canal |
|
|
| `ban <#chan> <nick>` | [o] | Bane um utilizador do canal especificado |
|
|
| `tban <#chan> <nick>` | [o] | Bane temporariamente um utilizador do canal especificado |
|
|
| `kick <#chan> <nick>` | [o] | Kicka um utilizador do canal especificado |
|
|
| `voice <#chan> <nick>` | [o] | Atribui voice a um utilizador no canal especificado |
|
|
| `devoice <#chan> <nick>` | [o] | Remove a voice a um utilizador no canal especificado |
|
|
| `unban <#chan> <mask>` | [o] | Remove uma banmask do canal especificado |
|
|
| `banlist <#chan>` | [o] | Carrega e envia a lista de bans do canal especificado |
|
|
| `autoadd <#chan> <on/off/status>` | [o] | Gere a adição automática de bans para o canal especificado |
|
|
| `addop <#chan> <nick>` | [n] | Adiciona um utilizador como op do canal especificado |
|
|
| `delop <#chan> <nick>` | [n] | Remove o acesso de op de um utilizador para o canal especificado |
|
|
| `addvoice <#chan> <nick>` | [n] | Adiciona um utilizador como voice do canal especificado |
|
|
| `delvoice <#chan> <nick>` | [n] | Remove o acesso de voice de um utilizador para o canal especificado |
|
|
| `ops <#chan>` | [n] | Lista todos os ops registados para o canal especificado |
|
|
| `voices <#chan>` | [n] | Lista todas as voices registadas para o canal especificado |
|
|
| `opcmds <#chan>` | [o] | Lista todos os comandos disponÃveis |
|
|
|
|
---
|
|
|
|
## Rastreamento Automático de Bans
|
|
|
|
Quando activado, o bot regista automaticamente os bans IRC (mode `+b`) na sua lista de bans interna, mantendo-a sincronizada com a do canal independentemente de quem define os bans.
|
|
|
|
- Bans que correspondam a `protectMasks` nunca são adicionados e são removidos imediatamente se definidos.
|
|
- Bans que correspondam ao host de um utilizador com flag `m`, `n` ou `o` são protegidos e removidos imediatamente.
|
|
- Bans estendidos (masks que começam com `~`) são rastreados separadamente como entradas `EXTBAN` e marcados como sticky.
|
|
- O rastreamento automático é por canal e é activado com `@autoadd on/off`.
|
|
- Quando bans são adicionados automaticamente, é enviada uma notice aos ops (`NOTICE @#canal`).
|
|
- A cada 5 minutos, o bot analisa todos os canais à procura de bans estendidos existentes e adiciona os que ainda não estão na sua lista interna, marcando-os como sticky.
|
|
|
|
---
|
|
|
|
## Suporte a Idiomas
|
|
|
|
O script utiliza o pacote `msgcat` do Tcl para internacionalização. Os ficheiros de idioma estão em `scripts/cmgmt_langs/` e são nomeados pelo código de locale (ex. `en.msg`, `pt.msg`, `it.msg`).
|
|
|
|
Para alterar o idioma, define a variável `locale` na secção de configuração com o código de locale pretendido.
|
|
|
|
### Idiomas DisponÃveis
|
|
|
|
| Código | Idioma |
|
|
|---|---|
|
|
| `en` | Inglês |
|
|
| `pt` | Português (Europeu) |
|
|
| `it` | Italiano |
|
|
|
|
Para adicionar um novo idioma, copia `en.msg`, renomeia-o com o código de locale pretendido e traduz as strings. Os marcadores posicionais `%1$s` têm de ser mantidos na ordem indicada nos comentários acima de cada entrada. As chaves `is.enabled` e `is.disabled` são usadas como valor substituÃdo dentro da mensagem `autoadd.status`, por isso devem ser traduzidas como uma palavra ou expressão curta que se encaixe naturalmente nessa frase.
|
|
|
|
### Comando de Upload Personalizado
|
|
|
|
A variável `upCommand` aceita qualquer comando que leia do stdin e devolva um URL. Alguns exemplos:
|
|
|
|
```tcl
|
|
# x0.at (predefinição)
|
|
variable upCommand "curl -s -F file=@- https://x0.at/"
|
|
|
|
# termbin.com
|
|
variable upCommand "nc termbin.com 9999"
|
|
|
|
# O teu próprio pastebin
|
|
variable upCommand "curl -s -F file=@- https://teu-pastebin.com/upload"
|
|
```
|
|
|
|
---
|
|
|
|
## Notas
|
|
|
|
- O bot não vai banir, kickar ou remover a voice a utilizadores com flag `o` ou que correspondam a `protectMasks`.
|
|
- Se alguém tentar usar um comando ban/kick no próprio bot, o bot kicka essa pessoa em vez disso.
|
|
- `@addban` espera uma mask correctamente formatada. Não é feita nenhuma geração automática de mask — o que escreveres é o que fica definido.
|
|
- `@ban` e `@tban` geram automaticamente a banmask a partir do host do alvo, usando o tipo definido em `banMask`. Se o host começar com `uid` ou `sid`, a mask é sempre definida como `*!*@host` independentemente de `banMask`.
|
|
- O carregamento da lista de bans requer um comando externo que leia do stdin. A predefinição utiliza [x0.at](https://x0.at/). Pode ser alterado através da variável `upCommand`.
|
|
- Os bans estendidos são rastreados mas não geridos pelos comandos ban/unban do bot — são tratados exclusivamente através de mudanças de mode IRC. |