3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-22 11:59:43 +01:00
Go to file
2020-01-08 20:30:52 -08:00
build License project under MPL2 2017-03-06 00:31:15 +00:00
data BotAdmins: admin hostmasks are no longer treated as regex. They support the normal * and ? wildcards. Removed stdin admin from data/admins. 2020-01-03 21:39:22 -08:00
doc doc/Factoids.md: update TOC and add code factoid languages 2020-01-08 20:30:52 -08:00
misc Add useful GitHub markdown TOC tool 2019-12-29 10:01:16 -08:00
modules Convert google module to GoogleSearch plugin 2019-12-28 22:57:38 -08:00
PBot list admins now sorts by name field instead of hostmask 2020-01-04 23:09:25 -08:00
Plugins Quotegrabs now always exported to data_dir 2019-12-30 20:01:04 -08:00
LICENSE License project under MPL2 2017-03-06 00:31:15 +00:00
MODULES Move MODULES to root directory 2019-12-23 09:45:18 -08:00
pbot pbot: remove unnecessary $pbot variable 2019-12-30 20:09:16 -08:00
README.md README.md: minor improvements 2020-01-08 01:45:11 -08:00

PBot

PBot is a versatile IRC Bot written in Perl

Installation / Quick Start

To get up-and-running quickly, check out the Quick Start guide.

Documentation

See the PBot documentation for more information.

Features

Commands

PBot has several useful core built-in commands. Additional commands can be added to PBot through Plugins and Factoids.

Plugins

PBot can dynamically load and unload Perl modules to alter its behavior.

These are some of the plugins that PBot has, there are many more:

Plugin Description
GoogleSearch Performs Internet searches using the Google search engine.
UrlTitles When a URL is seen in a channel, intelligently display its title. It will not display titles that are textually similiar to the URL, in order to maintain the channel signal-noise ratio.
Quotegrabs Grabs channel messages as quotes for posterity. Can grab messages from anywhere in the channel history. Can grab multiple messages at once!
RemindMe Lets people set up reminders. Lots of options.
ActionTrigger Lets admins set regular expression triggers to execute PBot commands or factoids.
AntiAway Detects when a person uses annoying in-channel away messages and warns them.
AutoRejoin Automatically rejoin channels if kicked or removed.
AntiNickSpam Detects when a person is spamming an excessive number of nicks in the channel and removes them.
AntiRepeat Warn people about excessively repeating messages. Kicks if they fail to heed warnings.
AntiTwitter Warn people about addressing others with @<nick>. Kicks if they fail to heed warnings.

There are even a few games!

Plugin Description
Spinach An advanced multiplayer Trivia game engine with a twist! A question is shown, everybody privately submits a false answer, all false answers and the true answer is shown, everybody tries to guess the true answer, points are gained when people pick your false answer!
Battleship The classic Battleship board game, simplified for IRC
Connect4 The classic Connect-4 game.

Factoids

Factoids are a very special type of command. Anybody interacting with PBot can create, edit, delete and invoke factoids. Factoids can be locked by the creator of the factoid to prevent them from being edited by others.

At its most simple, factoids merely output the text the creator sets.

<pragma-> !factadd hello /say Hello, $nick!
   <PBot> hello added to global channel.
<pragma-> PBot, hello
   <PBot> Hello, pragma-!

Significantly more complex factoids can be built by using $variables, command-substitution, command-piping, /code invocation, and more!

PBot factoids include these advanced features:

  • metadata (e.g. owner, times used, last used date, locked, etc)
  • advanced argument processing (indexing, splicing, etc)
  • special commands: /say, /me, /msg, /code, etc
  • advanced $variable interpolation ($var:lc to lowercase contents, $var:ucfirst to uppercase first letter, etc)
  • factoid-based variable lists (e.g., add a factoid $colors containing “red green blue” and then !echo $colors will randomly pick one)
  • changelog history
  • undo/redo history
  • and much, much more!

For more information, see the Factoids documentation.

Code Factoids

Code factoids are a special type of factoid that begin with the /code command.

/code <language> <code>

Thats right! Anybody can create a factoid that can execute arbitrary code in any language! This is one of PBots most powerful features.

How is this safe? Because the code is executed within a virtual machine that has been configured to fall-back to a previously saved state whenever it times out.

Modules

Modules are external command-line executable programs and scripts that can be loaded via PBot Factoids.

Suppose you have the Qalculate! command-line program and you want to provide a PBot command for it. You can create a very simple shell script containing:

#!/bin/sh
qalc "$*"

And lets call it qalc.sh and put it in PBots modules/ directory.

Then you can add the qalc factoid:

!factadd global qalc qalc.sh

And then set its type to module:

!factset global qalc type module

Now you have a qalc calculator in PBot!

<pragma-> !qalc 2 * 2
   <PBot> 2 * 2 = 4

These are just some of the modules PBot comes with; there are several more:

Module Description
C-to-English translator Translates C code to natural English sentences.
C precedence analyzer Adds parentheses to C code to demonstrate precedence.
C Jeopardy! game C programming trivia game based on the Jeopardy! TV game show.
Virtual machine Executes arbitrary code and commands within a virtual machine.
C Standard citations Cite specified sections/paragraphs from the C standard.
dict.org Dictionary Interface to dict.org for definitions, translations, acronyms, etc.
Urban Dictionary Search Urban Dictionary for definitions.
Manpages Display a concise formatting of manual pages (designed for C functions)

For more information, see the Modules documentation.

Useful IRC command improvements

  • mode command can take wildcards, e.g. mode +ov foo* bar* to op nicks beginning with foo and voice nicks beginning with bar
  • unban <nick> and unmute <nick> can remove all bans/mutes matching <nick>s hostmask or account
  • ban and mute will intelligently set banmasks; supports timeouts
  • ban and mute can take a comma-separate list of nicks. Will intelligently group them into multiple MODE +bbbb commands
  • kick can take a comma-separated list of nicks; accepts wildcards
  • and much, much, more

Channel management

PBot can perform the typical channel management tasks.

  • opping/deopping, etc
  • channel-mode tracking
  • user hostmask/alias tracking
  • ban-evasion detection
  • flood detection
  • whitelisting, blacklisting, etc
  • spam/advertisement detection
  • and much, much more

Admin management

PBot has easy admin management via simple built-in commands.

  • admins can be global admins or channel-specific admins
  • admins can be required to login with a password
  • admins can be set to be permanently logged-in
  • admin abilities configured by admin-levels

Easy configuration

PBots settings are contained in a central registry of key/value pairs grouped by sections.

These settings can easily be configured via several methods:

  • PBots command-line arguments
  • simple built-in commands (regset, regunset, etc)
  • editing the $data_dir/registry plain-text JSON file

Advanced interpreter

PBot has an advanced command interpreter with useful functionality.

  • piping
  • command substitution
  • command separation
  • inline commands
  • $variable interpolation
  • aliases
  • and more!

Support

For questions and support, feel free to join the #pbot2 channel on the Freenode IRC network (Web Chat).

License

PBot is licensed under the Mozilla Public License, version 2.