Update Chanban/README.md
This commit is contained in:
+306
-15
@@ -35,7 +35,6 @@ All configuration is done at the top of `cmgmt.tcl`.
|
||||
| `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 (see mask types below) |
|
||||
| `addOpMask` | `1` | Mask type used when adding an op |
|
||||
| `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 |
|
||||
@@ -59,7 +58,7 @@ All configuration is done at the top of `cmgmt.tcl`.
|
||||
|
||||
## Commands
|
||||
|
||||
Most commands require the user to have the `o` (op) flag on the channel. The `addop`, `delop`, and `ops` commands require the `n` (owner) flag. Commands are available both publicly in the channel (prefixed with the trigger) and privately via `/msg` to the bot.
|
||||
All commands require the user to have the `o` (op) flag on the channel. Commands are available both publicly in the channel (prefixed with the trigger) and privately via `/msg` to the bot.
|
||||
|
||||
### Public Commands (in channel)
|
||||
|
||||
@@ -73,9 +72,6 @@ Most commands require the user to have the `o` (op) flag on the channel. The `ad
|
||||
| `@unban <mask>` | Removes a ban mask from the channel and the bot's ban list |
|
||||
| `@banlist` | Uploads the bot's ban list for the channel and posts a link |
|
||||
| `@autoadd <on/off/status>` | Enables, disables, or checks the status of automatic ban adding |
|
||||
| `@addop <nick>` | Adds a user as channel op (requires `n` flag) |
|
||||
| `@delop <nick>` | Removes a user as channel op (requires `n` flag) |
|
||||
| `@ops` | Lists all registered ops for the channel (requires `n` flag) |
|
||||
| `@opcmds` | Lists all available commands |
|
||||
|
||||
### Private Commands (via /msg)
|
||||
@@ -92,9 +88,6 @@ The syntax is the same but requires the channel to be specified as the first arg
|
||||
| `unban <#chan> <mask>` | Removes a ban mask from the specified channel |
|
||||
| `banlist <#chan>` | Uploads and sends the ban list for the specified channel |
|
||||
| `autoadd <#chan> <on/off/status>` | Manages automatic ban adding for the specified channel |
|
||||
| `addop <#chan> <nick>` | Adds a user as channel op (requires `n` flag) |
|
||||
| `delop <#chan> <nick>` | Removes a user as channel op (requires `n` flag) |
|
||||
| `ops <#chan>` | Lists all registered ops for the specified channel (requires `n` flag) |
|
||||
| `opcmds <#chan>` | Lists all available commands |
|
||||
|
||||
---
|
||||
@@ -107,7 +100,7 @@ When enabled, the bot automatically mirrors IRC bans (`+b` modes) into its inter
|
||||
- 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.
|
||||
- Op notices (`NOTICE @#channel`) are sent when bans are automatically added or removed.
|
||||
|
||||
---
|
||||
|
||||
@@ -122,14 +115,12 @@ To change the language, set the `locale` variable in the configuration section t
|
||||
| Code | Language |
|
||||
|---|---|
|
||||
| `en` | English |
|
||||
| `it` | Italian |
|
||||
| `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 `%s` placeholders must be kept in the same order as described in the comments above each entry.
|
||||
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.
|
||||
|
||||
---
|
||||
|
||||
## Custom Upload Command
|
||||
### Custom Upload Command
|
||||
|
||||
The `upCommand` variable accepts any command that reads from stdin and returns a URL. Some examples:
|
||||
|
||||
@@ -151,4 +142,304 @@ variable upCommand "curl -s -F file=@- https://your-pastebin.com/upload"
|
||||
- The bot will not ban, kick, or devoice 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.
|
||||
- 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.
|
||||
- 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 (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
|
||||
|
||||
Tutti i comandi richiedono che l'utente abbia il flag `o` (op) sul canale. I comandi sono disponibili sia pubblicamente nel canale (preceduti dal trigger) che privatamente tramite `/msg` al bot.
|
||||
|
||||
### Comandi Pubblici (nel canale)
|
||||
|
||||
| Comando | Descrizione |
|
||||
|---|---|
|
||||
| `@ban <nick>` | Banna un utente dal canale e aggiunge la mask alla lista ban del bot |
|
||||
| `@tban <nick>` | Banna temporaneamente un utente per la durata impostata in `tBanDuration` |
|
||||
| `@kick <nick>` | Kicka un utente dal canale |
|
||||
| `@voice <nick>` | Assegna la voice (+v) a un utente |
|
||||
| `@devoice <nick>` | Rimuove la voice (-v) a un utente |
|
||||
| `@unban <mask>` | Rimuove una banmask dal canale e dalla lista ban del bot |
|
||||
| `@banlist` | Carica la lista ban del canale e pubblica il link |
|
||||
| `@autoadd <on/off/status>` | Abilita, disabilita o controlla lo stato dell'aggiunta automatica dei ban |
|
||||
| `@opcmds` | Elenca tutti i comandi disponibili |
|
||||
|
||||
### Comandi Privati (via /msg)
|
||||
|
||||
La sintassi è la stessa ma richiede il canale come primo argomento.
|
||||
|
||||
| Comando | Descrizione |
|
||||
|---|---|
|
||||
| `ban <#chan> <nick>` | Banna un utente dal canale specificato |
|
||||
| `tban <#chan> <nick>` | Banna temporaneamente un utente dal canale specificato |
|
||||
| `kick <#chan> <nick>` | Kicka un utente dal canale specificato |
|
||||
| `voice <#chan> <nick>` | Assegna la voice a un utente nel canale specificato |
|
||||
| `devoice <#chan> <nick>` | Rimuove la voice a un utente nel canale specificato |
|
||||
| `unban <#chan> <mask>` | Rimuove una banmask dal canale specificato |
|
||||
| `banlist <#chan>` | Carica e invia la lista ban del canale specificato |
|
||||
| `autoadd <#chan> <on/off/status>` | Gestisce l'aggiunta automatica dei ban per il canale specificato |
|
||||
| `opcmds <#chan>` | 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 o rimossi automaticamente, viene inviata una notice agli op (`NOTICE @#canale`).
|
||||
|
||||
---
|
||||
|
||||
## 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.
|
||||
|
||||
### 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.
|
||||
- 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 (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
|
||||
|
||||
Todos os comandos requerem que o utilizador tenha o flag `o` (op) no canal. 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 | Descrição |
|
||||
|---|---|
|
||||
| `@ban <nick>` | Bane um utilizador do canal e adiciona a mask à lista de bans do bot |
|
||||
| `@tban <nick>` | Bane temporariamente um utilizador pelo tempo definido em `tBanDuration` |
|
||||
| `@kick <nick>` | Kicka um utilizador do canal |
|
||||
| `@voice <nick>` | Atribui voice (+v) a um utilizador |
|
||||
| `@devoice <nick>` | Remove a voice (-v) a um utilizador |
|
||||
| `@unban <mask>` | Remove uma banmask do canal e da lista de bans do bot |
|
||||
| `@banlist` | Carrega a lista de bans do canal e publica o link |
|
||||
| `@autoadd <on/off/status>` | Activa, desactiva ou verifica o estado da adição automática de bans |
|
||||
| `@opcmds` | Lista todos os comandos disponíveis |
|
||||
|
||||
### Comandos Privados (via /msg)
|
||||
|
||||
A sintaxe é a mesma mas requer o canal como primeiro argumento.
|
||||
|
||||
| Comando | Descrição |
|
||||
|---|---|
|
||||
| `ban <#chan> <nick>` | Bane um utilizador do canal especificado |
|
||||
| `tban <#chan> <nick>` | Bane temporariamente um utilizador do canal especificado |
|
||||
| `kick <#chan> <nick>` | Kicka um utilizador do canal especificado |
|
||||
| `voice <#chan> <nick>` | Atribui voice a um utilizador no canal especificado |
|
||||
| `devoice <#chan> <nick>` | Remove a voice a um utilizador no canal especificado |
|
||||
| `unban <#chan> <mask>` | Remove uma banmask do canal especificado |
|
||||
| `banlist <#chan>` | Carrega e envia a lista de bans do canal especificado |
|
||||
| `autoadd <#chan> <on/off/status>` | Gere a adição automática de bans para o canal especificado |
|
||||
| `opcmds <#chan>` | 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 ou removidos automaticamente, é enviada uma notice aos ops (`NOTICE @#canal`).
|
||||
|
||||
---
|
||||
|
||||
## 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.
|
||||
|
||||
### 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.
|
||||
- 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.
|
||||
Reference in New Issue
Block a user