<PBot> faq: Module loaded by pragma- on Fri Dec 31 02:34:04 2004 -> https://github.com/pragma-/pbot/blob/master/modules/cfaq.pl, used 512 times (last by ecrane)
Note that commands need not be submitted to the channel; you can /msg it instead. If you /msg PBot, it will respond with a private message in return. In private message, you do not need to specify its name or one of the trigger symbols.
Many commands may be triggered from within a sentence by adding curly braces or backticks around the command after the trigger. You can embed up to three commands in one message.
If the sentence begins with a nick that is currently in the channel, the command's response will be prefixed with that nick.
<pragma-> Alice: Check out !{K&R} for a good book on C. !`H&S` is also a great reference manual.
<PBot> Alice: K&R is The C Programming Language, 2nd edition, by Kernighan and Ritchie - http://wayback.archive-it.org/5263/20150203070038/http://cm.bell-labs.com/cm/cs/cbook/ - errata: http://www.iso-9899.info/2ediffs.html
<PBot> Alice: H&S is "C - A Reference Manual" by Harbison & Steele; a reference for C on par with K&R - http://www.amazon.com/Reference-Manual-Samuel-P-Harbison/dp/013089592X
PBot's behavior can be customized via a central registry of key/value pairs segregated by sections.
There are two types of registry values: literals and arrays. Literals can be strings, floats or integers. Arrays are comma-separated lists of literals.
For example, the bot's trigger is defined in `general.trigger`. You may add a trigger key in `#channel` to override the trigger value for that channel: `#channel.trigger`.
For another example, the anti-flood max lines is defined in `antiflood.chat_flood_threshold`. To override this setting in `#neatchannel`, you can set `#neatchannel.chat_flood_threshold`.
Some registry values can be *regular expressions*, like the above trigger example. Setting `general.trigger` to the character class `[,!%]` means that it will respond to `,``!` and `%` as trigger characters on a general basis.
If you omit the `<key>` argument, it will list all the defined keys and values for the registry item. If you specify `<key>` but omit `<value>`, it will show the value for that specific key.
*`type`: sets the type of this registry key; values can be `text` (literal) or `array`.
*`value`: the value of this registry key.
*`private`: whether the value of the registry key is displayed in regset, regshow or regfind. If set to a true value, the value of the registry key will be shown as "**\<private\>**".
regunset
--------
`regunset` deletes a meta-data key from a registry key.
Usage: `regunset <section> <item> <key>`
regchange
---------
`regchange` changes the value of a registry item using a *regular substitution expression*.
<PBot> [foo] animals set to aardvark, badger, cat, dingo
<pragma> regset foo animals type array
<PBot> [foo] animals: 'type' set to 'array'
List of recognized registry items
---------------------------------
* antiaway.bad_actions
* antiaway.bad_nicks
* antiaway.kick_msg
* antiflood.chat_flood_punishment
* antiflood.chat_flood_threshold
* antiflood.chat_flood_time_threshold
* antiflood.debug_checkban
* antiflood.dont_enforce_admins
* antiflood.enforce
* antiflood.enter_abuse_max_offenses
* antiflood.enter_abuse_punishment
* antiflood.enter_abuse_threshold
* antiflood.enter_abuse_time_threshold
* antiflood.join_flood_punishment
* antiflood.join_flood_threshold
* antiflood.join_flood_time_threshold
* antiflood.nick_flood_punishment
* antiflood.nick_flood_threshold
* antiflood.nick_flood_time_threshold
* antikickautorejoin.punishment
* antikickautorejoin.threshold
* bantracker.chanserv_ban_timeout
* bantracker.debug
* bantracker.mute_timeout
* factoids.default_rate_limit
* general.compile_blocks_channels
* general.compile_blocks
* general.compile_blocks_ignore_channels
* general.config_dir
* general.data_dir
* general.deop_timeout
* general.module_dir
* general.module_repo
* general.paste_ratelimit
* general.show_url_titles_channels
* general.show_url_titles
* general.show_url_titles_ignore_channels
* general.trigger
* interpreter.max_recursion
* irc.botnick
* irc.debug
* irc.identify_password
* irc.ircname
* irc.ircserver
* irc.log_default_handler
* irc.max_msg_len
* irc.port
* irc.show_motd
* irc.SSL_ca_file
* irc.SSL_ca_path
* irc.SSL
* irc.username
* lagchecker.lag_history_interval
* lagchecker.lag_history_max
* lagchecker.lag_threshold
* messagehistory.debug_aka
* messagehistory.debug_link
* messagehistory.max_messages
* messagehistory.sqlite_commit_interval
* messagehistory.sqlite_debug
* nicklist.debug
* [channel].dont_enforce_antiflood
* [channel].max_newlines
* [channel].no_url_titles
* [channel].no_compile_blocks
* [channel].preserve_newlines
Factoids
========
### Channel namespaces
Factoids added in one channel may be called/triggered in another channel or in private message, providing that the other channel doesn't already have a factoid of the same name (in which case that channel's factoid will be triggered).
Factoids may also be added to a special channel named `global` or `.*`. Factoids that are set in this channel will be accessible to any channel, including private messages. However, factoids that are set in a specific channel will override factoids of the same name that are set in the global channel or other channels.
For example, a factoid named `malloc` set in `##c` will be called instead of `malloc` set in `global`, if the factoid were triggered in `##c`; otherwise, the latter 'malloc' will be triggered if the factoid were triggered in another channel.
Similiarily, if there were no `malloc` factoid in the `global` namespace, but only in `##c` and you attempted to use this factoid in a channel other than `##c`, that channel will invoke `##c`'s version of `malloc`, providing that channel doesn't have its own `malloc` factoid.
Likewise, if there is a `malloc` factoid set in `##c++` and the factoid is triggered in the `##c++` channel, then this version of `malloc` will be called instead of the `##c` or the `global` factoid.
However, if you are in a channel that doesn't have a `malloc` factoid and there is no `malloc` factoid in the global channel, and you attempt to call `malloc` then the bot will display a message notifying you that `malloc` is ambiguous and which channels it belongs to so that you may use the [fact](#fact) command to call the correct factoid.
`$args` expands to any text following the keyword. If there is no text then it expands to the nick of the caller.
#### $arg[n]
`$arg[n]` expands to the nth argument. Indexing begins from 0 (the first argument is `$arg[0]`). You may use a negative number to count from the end; e.g., `$arg[-2]` means the 2nd argument from the end. Multiple words can be double-quoted to constitute one argument. If the argument does not exist, the variable and the leading space before it will be silently removed.
#### $arg[n:m]
`$arg[n:m]` expands to a slice of arguments between `n` and `m`. Indexing begins from 0 (the first argument is `$arg[0]`). Not specifying the `m` value means the rest of the arguments; e.g., `$arg[2:]` means the remaining arguments after the first two. Multiple words can be double-quoted to constitute one argument. If the argument does not exist, the variable and the leading space before it will be silently removed.
#### $arglen
`$arglen` expands to the number of arguments provided to a factoid.
#### $channel
`$channel` expands to the name of the channel in which the factoid is used.
#### $randomnick
`$randomnick` expands to a random nick from the channel in which the factoid is used.
#### $0
`$0` expands to the original keyword used to invoke a factoid. See also [Overriding $0](#Overriding_$0).
### adlib list variables
You may create a list of adlib words by using the normal factoid creation method. Multiple words can be surrounded with quotes to constitute one element.
<pragma-> factadd global colors is red green blue "bright yellow" pink "dark purple" orange
<PBot> colors added to the global channel
Then you can instruct PBot to pick a random word from this list to use in another factoid by inserting the list as a variable.
<pragma-> factadd global sky is /say The sky is $colors.
Code-factoids are a special type of factoid whose text is executed as Perl instructions. The return value from these instructions is the final text of the factoid. This final text is then parsed and treated like any other factoid text.
By default, the variables created within code-factoids do not persist between factoid invocations. This behavior can be overridden by factsetting a persist-key with a unique value.
To create a code-factoid, simply wrap the factoid text with curly braces.
You can use the [factset](#factset) command to set a special factoid meta-data key named `action_with_args` to trigger an alternate message if an argument has been supplied.
You can use the [factset](#factset) command to set a special factoid meta-data key named `add_nick` to prepend the nick of the caller to the output. This is mostly useful for modules.
If three arguments are given, the factoid is renamed in the source channel. If four arguments are given, the factoid is moved to the target channel with the target name.
To view or set factoid meta-data, such as owner, rate-limit, etc, use the `factset` command. See also: [factoid metadata list](#Factoid_Metadata_List).
This is a list of recognized factoid meta-data fields. The number in parentheses next to the field is the minimum admin level necessary to modify it; if there is no such number then anybody may modify it.
*`created_on` (90): The timestamp of when the factoid was created.
*`enabled` (10): Whether the factoid can be invoked or not.
*`last_referenced_in` (90): The channel or private-message in which the factoid was last used.
*`last_referenced_on` (90): The timestamp of when the factoid was last used.
*`modulelauncher_subpattern` (90): A substitution expression used to modify the arguments into a command-line.
*`owner` (90): The creator of the factoid.
*`rate_limit` (10): How often the factoid may be invoked, in seconds. Zero for unlimited.
*`ref_count` (90): How many times the factoid has been invoked.
*`ref_user` (90): The hostmask of the last person to invoke the factoid.
*`type` (90): The type of the factoid. "text" for regular factoid; "module" for module.
*`edited_by` (90): The hostmask of the person to last edit the factoid.
*`edited_on` (90): The timestamp of when the factoid was last edited.
*`locked` (10): If enabled, prevents the factoid from being changed or removed.
*`add_nick` (10): Prepends the nick of the person invoking the factoid to the output of the factoid.
*`nooverride` (10): Prevents the creation of a factoid with an identical name in a different channel.
*`effective-level` (20): the effective admin level at which this factoid executes (i.e., for /kick, etc)
*`persist-key` (20): the storage key for allowing code-factoids to persist variables
*`action_with_args`: Alternate action to perform if an argument has been supplied when invoking the factoid.
*`noembed`: Factoid will not be triggered if embedded within a sentence.
*`interpolate`: when set to a false value, $variables will not be expanded.
*`use_output_queue`: when set to a true value, the output will be delayed by a random number of seconds to simulate reading/typing.
### factunset
To unset factoid meta-data, use the `factunset` command.
Usage: `factunset <channel> <factoid> <key>`
Finding a factoid
-----------------
### factfind
To search the database for a factoid, use the 'factfind` command. You may optionally specify whether to narrow by channel and/or include factoid owner and/or last referenced by in the search.
<PBot> NULL: Factoid submitted by Major-Willard for all channels on Sat Jan 1 16:17:42 2005 [5 years and 178 days ago], referenced 39 times (last by pragma- on Sun Jun 27 04:40:32 2010 [5 seconds ago])
Grabs a message someone says, and adds it to the quotegrabs database. You may grab multiple nicks/messages in one quotegrab by separating the arguments with a plus sign (the nicks need not be different -- you can grab multiple messages by the same nick by specifying a different history for each grab).
You can use `-b/-before` and `-a/-after` to display the messages before and after the result me For example, `recall ##c -b 99` would show the last 100 messages in the ##c channel. `recall bob 50 -b 5 -a 5` would show the 50th most recent message from bob, including 5 messages before and 5 messages after that message. If you also specify `-x <nick>`, then the before and after messages will be limited to messages from the `<nick>` argument; for example, `recall -x bob -b 10` would show bob's 10 most recent messages.
Alternatively, you can use `-n/-count` to display that many matches resulting from a `-h/-history` search; for example, `recall -h http -n 5` would show the last 5 messages containing "http". You can specify `-x/-context` to limit the search to a specific nick; for example, `recall -h http -x bob -n 5` would show bob's last 5 messages containing "http".
Code compiler (and executor). This command will compile and execute user-provided code in a number of languages, and then display the compiler and/or program output.
The program is executed within a gdb debugger instance, which may be interacted with via the [gdb macros described below](#Using_the_GDB_debugger) or with the `gdb("command")` function.
The compiler and program are executed inside a virtual machine. After each run, the virtual machine is restored to a previous state. No system calls have been disallowed. You can write to and read from the filesystem, provided you do it in the same program. The network cable has been unplugged. You are free to write and test any code you like. Have fun.
-`[nick] { <same as above without the cc in front> }`
You can pass any gcc compiler options. By default, `-Wall -Wextra -std=c11 -pedantic` are passed unless an option is specified.
The `-paste` option will pretty-format and paste the code/output to a paste site and display the URL (useful to preserve newlines in output, and to refer to line-numbers).
The `-nomain` flag will prevent the code from being wrapped with a `main()` function. This is not necessary if you're explicitly defining a `main` function; it's only necessary if you don't want a `main` function at all.
The `-noheaders` flag will prevent any of the default headers from being added to the code. This is not necessary if you explicitly include any headers since doing so will override the default headers. This flag is only necessary if you want absolutely no headers whatsoever.
In C and C++, you may `#include <file.h>` one after another on the same line. The bot will automatically put them on separate lines. If you do use `#include`, the files you specify will replace the default includes. You do not need to append a `\n` after the `#include`.
<pragma-> cc #include<sys/utsname.h> struct utsname u; uname(&u);
<PBot> pragma-: <nooutput:u ={sysname="Linux",nodename ="compiler",release ="3.2.0-8-generic",version ="#15-Ubuntu SMP Wed Jan 11 13:57:44 UTC 2012",machine ="x86_64",__domainname ="(none)"}>
<!---->
<pragma-> cc #include<stdio.h>#include<stdlib.h> void func(void) { puts("Hello, world"); } func();
<PBot> pragma-: Hello, World
In the previous examples, only the specified includes (e.g., `<sys/utsname.h>` in the first example, `<stdio.h>` and `<stdlib.h>` in the second, will be included instead of the default includes.
##### Using #define
You can also `#define` macros; however, `#defines` require an explicit `\n` sequence to terminate, oe the remainder of the line will be part of the macro.
<pragma-> cc #define GREETING "Hello, World"\n puts(GREETING);
<PBot> pragma-: Hello, World
#### main() Function Unnecessary
In C and C++, if there is no `main` function, then a `main` function will created and wrapped around the appropriate bits of your code (unless the `-nomain` flag was specified); anything outside of any functions, excluding preprocessor stuff, will be put into this new `main` function.
<pragma-> cc -paste int add(int a, int b) { return a + b; } printf("4 + 6 = %d -- ", add(4, 6)); int add3(int a, int b, int c)
<PBot> pragma-: Stack level 1, frame at 0x7fffffffe660: rip = 0x400e28 in foo (); saved rip 0x400e43 called by frame at 0x7fffffffe680, caller of frame at 0x7fffffffe650 source language c. Arglist at 0x7fffffffe650, args: Locals at 0x7fffffffe650, Previous frame's sp is 0x7fffffffe660 Saved registers: rbp at 0x7fffffffe650, rip at 0x7fffffffe658
Each cc snippet is saved in a buffer which is named after the channel or nick it was used in. You can use [show](#show) or [diff](#diff) with a buffer argument to view that buffer; otherwise you can use the [copy](#copy) command to copy the most recent snippet of another buffer into the current buffer and optionally chain it with another command -- for example, to copy the `##c` buffer (e.g., from a private message or a different channel) and paste it: `cc copy ##c and paste`.
The commands are: [copy](#copy), [show](#show), [diff](#diff), [paste](#paste), [run](#run), [undo](#undo), [s//](#s.2F.2F), [replace](#replace), [prepend](#prepend), [append](#append), and [remove](#remove). Most of the commands may be chained together by separating them with whitespace or "and".
To copy the most recent snippet from another buffer (e.g., to copy another channel's or private message's buffer to your own private message or channel), use the `copy` command. Other commands can optionally be chained after this command.
<PBot> Let Batman be another name for a character. Let Bruce_Wayne be a character. Let superhero be a character, with value being Bruce_Wayne cast to a Batman.
Expands macros in C code and displays the resulting code. Macros must be terminated by a `\n` sequence. You may `#include` headers to expand macros defined within.
Displays questions from the [http://http://www.eskimo.com/~scs/C-faq/top.html](comp.lang.c FAQ). Some queries may return more than one result; if this happens, you may use the `match #` optional argument to specify the match you'd like to view.
Usage: `faq [match #] <search regex>`
<pragma-> faq cast malloc
<PBot> 2 results, displaying #1: 7. Memory Allocation, 7.6 Why am I getting ``warning: assignment of pointer from integer lacks a cast** for calls to malloc? : http://www.eskimo.com/~scs/C-faq/q7.6.html
<pragma-> faq 2 cast malloc
<PBot> 2 results, displaying #2: 7. Memory Allocation, 7.7 Why does some code carefully cast the values returned by malloc to the pointer type being allocated? : http://www.eskimo.com/~scs/C-faq/q7.7.html
<pragma-> faq ^6.4
<PBot> 6. Arrays and Pointers, 6.4 Why are array and pointer declarations interchangeable as function formal parameters? : http://www.eskimo.com/~scs/C-faq/q6.4.html
### cfact
Displays a random C fact. You may specify a search text to limit the random set to those containing that text.
`Usage: cfact [search text]`
<pragma-> cfact
<PBot> pragma-: [6.7.2.1 Structure and union specifiers] A structure or union may have a member declared to consist of a specified number of bits. Such a member is called a bit-field.
The `cjeopardy` command isplays a random C Jeopardy question. You can specify a search text to limit the random set to those containing that text. Answer the questions with `what is ...?`
<PBot> 1009) This macro expands to a integer constant expressions that can be used as the argument to the exit function to return successful termination status to the host environment.
<pragma-> what is EXIT_SUCCESS?
<PBot> pragma-: 'EXIT_SUCCESS' is correct! (1m15s)
Shows ranking for various C Jeopardy statistics, or your personal rankings in each of the statistics. If used without any arguments, it shows the available keywords for which statistics to rank.
Displays a specific C Jeopardy question without making it the current question. Useful for seeing which question belongs to a question id; .e.g. with `qstats`.
Usage: `qshow <question id>`
### c99std
Searches ISO/IEC 9899:TC3 (WG14/N1256), also known as the C99 draft standard. http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1256.pdf
If specified, `section` must be in the form of `X.YpZ` where `X` and `Y` are section/chapter and, optionally, `pZ` is paragraph.
To display a specific section and all its paragraphs, specify just the `section` without `pZ`.
To display just a specific paragraph, specify the full `section` identifier (`X.YpZ`).
You may use `-n #` to skip to the nth match.
To list only the section numbers containing 'search text', add `-list`.
If both `section` and `search regex` are specified, then the search space will be within the specified section identifier.
<pragma-> c99std pointer value
<PBot> Displaying #1 of 64 matches: 5.1.2.2.1p1: [Program startup] If they are declared, the parameters to the main function shall obey the following constraints: -- The value of argc shall be nonnegative. -- argv[argc] shall be a null pointer. -- If the value of argc is greater than zero, the array members argv[0] through argv[argc-1] inclusive shall contain pointers to st... truncated; see http://codepad.org/f2DULaGQ for full text.
<PBot> Displaying #1 of 4 matches: 6.3.2.1p1: [Lvalues, arrays, and function designators] Except when it is the operand of the sizeof operator or the unary & operator, or is a string literal used to initialize an array, an expression that has type ``array of type is converted to an expression with type ``pointer to type that points to the initial element of the array ob... truncated; see http://codepad.org/mf1RNnr2 for full text.
<PBot> Displaying #3 of 4 matches: 6.3.2.3p1: [Pointers] For any qualifier q, a pointer to a non-q-qualified type may be converted to a pointer to the q-qualified version of the type; the values stored in the original and converted pointers shall compare equal.
<PBot> Includes: sys/types.h, unistd.h - pid_t fork(void); - SVr4, SVID, POSIX, X/OPEN, BSD - fork creates a child process that differs from the parent process only in its PID and PPID, and in the fact that resource utilizations are set to 0 - http://www.iso-9899.info/man?fork
<pragma-> man atexit
<PBot> Includes: stdlib.h - int aid (*function)(void)); - SVID 3, BSD 4.3, ISO 9899 - atexit () function registers the given function to be called at normal program termination, whether via exit(3) or via return from the program's main - http://www.iso-9899.info/man?atexit
<pragma-> man getcwd
<PBot> Includes: unistd.h - char *getcwd(char *buf, size_t size); - POSIX.1 - getcwd () function copies an absolute pathname of the current working directory to the array pointed to by buf, which is of length size - http://www.iso-9899.info/man?getcwd
<PBot> brian kernighan (115,000): Brian Kernighan's Home Page: (http://www.cs.princeton.edu/~bwk/)
<!---->
<pragma-> google 3 brian kernighan
<PBot> brian kernighan (115,000): Brian Kernighan's Home Page: (http://www.cs.princeton.edu/~bwk/), An Interview with Brian Kernighan: (http://www-2.cs.cmu.edu/~mihaib/kernighan-interview/), Interview with Brian Kernighan | Linux Journal: (http://www.linuxjournal.com/article.php?sid=7035), Brian W. Kernighan: (http://www.lysator.liu.se/c/bwk/) ,Brian W. Kernighan: Programming in C: A Tutorial: (http://www.lysator.liu.se/c/bwk-tutor.html)
### define
### dict
Displays dictionary definitions from http://dict.org using DICT protocol.
Databases for the `-d` option are listed here: http://www.iso-9899.info/PBot/dict_databases.txt -- Note that there may be several commands aliased to one of these databases; for example, the `foldoc` command is an alias to `dict -d foldoc`.
Usage: `dict [-d database] [-n start from definition number] [-t abbreviation of word class type (n]oun, v]erb, adv]erb, adj]ective, etc)] [-search <regex> for definitions matching <regex>] <word>`
<pragma-> dict hit
<PBot> hit: n: 1) (baseball) a successful stroke in an athletic contest (especially in baseball); "he came all the way around on Williams' hit", 2) the act of contacting one thing with another; "repeated hitting raised a large bruise"; "after three misses she finally got a hit" [syn: hitting, striking], 3) a conspicuous success; "that song was his first hit and marked the beginning of his career"; "that new Broadway show is a real smasher"
<!---->
<pragma-> dict -n 4 hit
<PBot> hit: n: 4) (physics) an brief event in which two or more bodies come together; "the collision of the particles resulted in an exchange of energy and a change of direction" [syn: collision], 5) a dose of a narcotic drug, 6) a murder carried out by an underworld syndicate; "it has all the earmarks of a Mafia hit", 7) a connection made via the internet to another website; "WordNet gets many hits from users worldwide"
<!---->
<pragma-> dict -t v hit
<PBot> hit: v: 1) cause to move by striking; "hit a ball", 2) hit against; come into sudden contact with; "The car hit a tree"; "He struck the table with his elbow" [syn: strike, impinge on, run into, collide with] [ant: miss], 3) affect or afflict suddenly, usually adversely; "We were hit by really bad weather"; "He was stricken with cancer when he was still a teenager"; "The earstruck at midnight" [syn: strike], 4) deal a blow to
<!---->
<pragma-> dict -search ball hit
<PBot> hit: n: 1) (baseball) a successful stroke in an athletic contest (especially in baseball); "he came all the way around on Williams' hit", v: 1) cause to move by striking; "hit a ball"
<PBot> posix (3 entries): Portable Operating System for Information Exchange, Portable Operating System Interface Extensions (IBM), Portable Operating System Interface for Unix
<pragma-> acronym linux
<PBot> linux (1 entries): Linux Is Not UniX
### math
### calc
Evaluate calculations. Can also perform various unit conversions.
Usage: `math <expression>``calc <expression>`
<pragma-> calc 5 + 5
<PBot> 5 + 5 = 10
<!---->
<pragma-> calc 80F to C
<PBot> pragma-: 80F to C = 26.6666666666667 C
### qalc
Evaluate calculations using the `QCalculate!` program.
<PBot> "Each success only buys an admission ticket to a more difficult problem." -- Henry Kissinger (1923 - ).
<pragma-> quote --author lao tzu
<PBot> 41 matching quotes found. "A journey of a thousand miles begins with a single step." -- Lao-tzu (604 BC - 531 BC).
<pragma-> quote butterfly
<PBot> 11 matching quotes found. "A chinese philosopher once had a dream that he was a butterfly. From that day on, he was never quite certain that he was not a butterfly, dreaming that he was a man." -- Unknown.
*`channel`: which channel the admin can administrate; use `global` for all channels. This field cannot be changed without removing and re-adding the admin.
*`hostmask`: a *regular expression* of what hostmask the admin is recognized/allowed to login from (e.g., `somenick!.*@.*.somedomain.com` or `.*@unaffiliated/someuser`). This field cannot be changed without removing and re-adding the admin.
*`password`: the password the admin will use to login (from /msg!). A password is not required if the `stayloggedin` and `loggedin` meta-data are set for the admin; however, a dummy password still needs to be set.
Sets meta-data for an admin account. You can use the `name` field or the `hostmask` field that was set via `adminadd`. See also: [admin metadata list](#Admin_Metadata_List).
If both `key` and `value` are omitted, chanset will show all the keys and values for that channel. If only `value` is omitted, chanset will show the value for that key.
*`enabled`: when set to a true value, PBot will auto-join this channel after identifying to NickServ (unless `general.autojoin_wait_for_nickserv` is `0`, in which case auto-join happens immediately).
*`chanop`: when set to a true value, PBot will perform channel management (anti-flooding, ban-evasion, etc).
*`permop`: when set to a true value, PBot will automatically op itself when joining and remain opped instead of automatically opping and deopping as necessary.
Timeout can be specified as an relative time in English; for instance, `5 minutes`, `1 month and 2 weeks`, `next thursday`, `friday after next`, and so on.
Bans a user. If the argument is a `nick` instead of a `hostmask`, it will determine an appropriate banmask for that nick.
Usage: `ban <nick or hostmask> [channel [timeout]]`
If `timeout` is omitted, PBot will ban the user for 24 hours. Timeout can be specified as an relative time in English; for instance, `5 minutes`, `1 month and 2 weeks`, `next thursday`, `friday after next`, and so on.
### unban
Unbans a user. If the argument is a `nick` instead of a `hostmask`, it will find all bans that match any of that nick's hostmasks or NickServ accounts and unban them.
Usage: `unban <nick or hostmask> [channel]`
### kick
Removes a user from the channel. `nick` can be a comma-separated list of multiple users. If `reason` is omitted, a random insult will be used.
Usage from channel: `kick <nick> [reason]`
From private message: `kick <channel> <nick> [reason]`
PBot can monitor the channel for excessive rapid traffic originating from an individual and automatically ban the offender for a certain length of time.
If four (4) or more messages are sent within five (5) seconds, the flood control is triggered. The offender will be muted for 30 seconds for the first offense. Each additional offense will result in the offender being muted for a much longer period. For example, the first offense will result in 30 seconds, the 2nd offense will be 5 minutes, the 3rd will be 1 hour, and so on. The offense counter is decremented once every 24 hours.
The offender will be sent the following private message: "You have been muted due to flooding. Please use a web paste service such as http://ideone.com for lengthy pastes. You will be allowed to speak again in $timeout."
If four (4) or more JOINs are observed within thirty (30) minutes *without any messages in between joins*, the offender will be forwarded to another channel for a limited time: 2^(number_of_offenses + 2) hours.
In addition to private instructions from PBot, this channel will have a /topic and ChanServ on-join message with instructions explaining to the offender how to remove the forwarding. The instructions are to message PBot with: `unbanme`.
Any messages sent to the public channel by the user at any time will reset their JOIN counter back to zero. The unbanme command can only be used for the first two offenses -- the offense counter is decremented once every 24 hours.
The offender will be sent the following private message: "You have been banned from $channel due to join flooding. If your connection issues have been resolved, or this was an accident, you may request an unban at any time by responding to this message with: `unbanme`, otherwise you will be automatically unbanned in $timeout."
If four (4) consecutive messages are sent with ten (10) seconds or less between individual messages and without another person speaking, an enter-key-abuse counter is incremented. This counter will then continue to be incremented every two (2) consecutive messages with ten (10) seconds or less in between until another person speaks or more than ten (10) seconds have elapsed, whereupon it returns to requiring four (4) consecutive messages. When this counter reaches three (3) or greater, the offender will be muted using the same timeout rules as message flooding. This counter is automatically decremented once per hour.
The offender will be sent the following private message: "You have been muted due to abusing the enter key. Please do not split your sentences over multiple messages. You will be allowed to speak again in $timeout."
If four (4) or more nick-changes are observed within thirty (30) minutes, the nick-change flood control is triggered. The offender will be muted for 15 minutes for the first offense. Each additional offense will result in the offender being muted for a much longer period. The offense counter is decremented once every 24 hours.
The offender will be sent the following private message: "You have been temporarily banned due to nick-change flooding. You will be unbanned in $timeout."
When such a case is detected, PBot will kickban the offender (with a kick message of "$timeout ban for auto-rejoining after kick") for 5 minutes for the first offense. Each additional offense will result in the offender being banned for a much longer period. The offense counter is decremented once every 24 hours.
ChanServ can op and deop PBot as necessary, unless the channel `permop` meta-data is set to a true value. PBot will wait until about 5 minutes have elapsed before requesting a deop from ChanServ. This timeout can be controlled via the `general.deop_timeout` registry value, which can be overriden on a per-channel basis.