3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-23 12:29:27 +01:00
Commit Graph

246 Commits

Author SHA1 Message Date
Pragmatic Software
89eda8f0a9 Fix undefined variable warning in find_factoid 2015-10-19 12:21:42 -07:00
Pragmatic Software
930801a5fb Require curly braces or backticks around embedded commands 2015-10-10 04:27:36 -07:00
Pragmatic Software
54b8750d1b Allow adding channels as factoid adlib modifier 2015-10-05 02:11:52 -07:00
Pragmatic Software
cf72a11658 Improve factoid expansions 2015-10-05 02:03:13 -07:00
Pragmatic Software
a5c700eec3 Correct encode_entities() in export_factoids() for URLs, etc 2015-10-02 20:14:48 -07:00
Pragmatic Software
dc2f372551 Add missing encode_entities() to export_factoids() 2015-10-02 20:06:25 -07:00
Pragmatic Software
04aaeb5475 Fix handling of no factoid found from find_factoid() 2015-09-19 00:27:15 -07:00
Pragmatic Software
b5c5162ad0 Minor refactor of title case of adlib modifier 2015-09-14 10:29:28 -07:00
Pragmatic Software
739c28125b Remove extraneous whitespace 2015-09-14 10:25:16 -07:00
Pragmatic Software
aed3f34c43 Add optional modifiers to factoid variables
Adlib list variables can now accept trailing modifier keywords prefixed with
a colon. These can be chained together to combine their effects.

     :uc - uppercases the expansion
     :lc - lowercases the expansion
     :ucfirst - uppercases the first letter in the expansion
     :title - lowercases the expansion and then uppercases the first letter
              (effectively an alias for :lc:ucfirst)

Examples:
   <pragma_> echo $colors:uc
   <candide> RED
   <pragma_> echo $colors:ucfirst
   <candide> Blue
2015-09-14 10:22:55 -07:00
Pragmatic Software
ecaa45b3dc Expand factoid variables sooner so argument processing occurs on expanded action 2015-09-14 09:06:00 -07:00
Pragmatic Software
fa2865fb10 Fix potential undefined variable warning 2015-09-08 01:30:08 -07:00
Pragmatic Software
8c16fbd3e5 Allow factoids to be referenced from within messages
E.g.,

<pragma-> Userbob: You can learn more about candide by reading its !help page and checking out its !source
<candide> Userbob: To learn all about me, see http://www.iso-9899.info/wiki/Candide
<candide> Userbob: My guts can be browsed at https://github.com/pragma-/pbot

Only three triggers will be processed per message.  (I should create a
registry entry to customize this.)

Messages that are addressed at a specific user that exists in the channel will
have that user's name prepended to the factoid output.

Factoid triggers that are referenced from within messages will not produce
error messages if the factoid is not found.

Factoids that have an $arg or $nick special variable will not be triggered as
a reference.

Factoids that have the `noembed` meta-data value set to a true value will not
be invoked as a reference.
2015-09-03 20:56:44 -07:00
Pragmatic Software
bded959ba4 Remove unnecessary logic 2015-07-23 17:46:33 -07:00
Pragmatic Software
ba87aef524 Improve factshow/factfind behavior
factshow's and factfind's channel argument is now optional.

The commands will now automatically determine the channel a factoid lives in
if it is the only factoid of that name.

If there are multiple factoids existing in different channels then the commands
will display a disambiguation message and require an explicit channel argument
to choose a specific channel's factoid.
2015-07-21 15:07:56 -07:00
Pragmatic Software
241c30b4f4 Do not override special variables in expand_factoid_vars() 2015-07-09 23:24:00 -07:00
Pragmatic Software
1179a7e1f1 Don't remove dollar-sign from unexpanded factoid vars 2015-07-06 20:01:17 -07:00
Pragmatic Software
a0c798dd2a Expand factoid variables in /call statements
This allows us to call random factoids.

E.g.:

  factadd global fact1 is /say This is fact1.
  factadd global fact2 is /say Fact2 is also a pretty neat fact.
  factadd global fact3 is /say But don't forget about fact3!
  factadd global facts is fact1 fact2 fact3
  factadd global randomfact is /call $facts

Invoking the `randomfact` factoid will now randomy pick between
fact1, fact2 and fact3.

This was added to support the `randomkr` factoid.
2015-07-06 19:39:33 -07:00
Pragmatic Software
83f84e261a Minor bug-fixes 2015-07-01 15:21:08 -07:00
Pragmatic Software
144c3ec63b Fix apostrophe in expand action arguments, and fix regex 2015-06-26 00:10:23 -07:00
Pragmatic Software
f10e1c1c89 Support factoid argument indexing/slicing ($arg[0], $arg[2:4], etc) 2015-06-25 22:56:10 -07:00
Pragmatic Software
d431d70ac1 Reduce verbosity of factoid debug messages 2015-06-20 17:48:00 -07:00
Pragmatic Software
f2a8839707 Add $randomnick special factoid variable 2015-06-08 04:43:00 -07:00
Pragmatic Software
789a4bfe2d Correct handling of telling factoid aliases 2015-04-14 20:14:22 -07:00
Pragmatic Software
59c29977e6 Improve handling of factoids
Fix adding factoid to local channel when a factoid of same name already exists for global channel
Fix calling factoid from another channel with `fact` command
Do not prepend nick argument to aliases (/call factoids)
2015-04-10 14:59:17 -07:00
Pragmatic Software
17afac5908 Check commands table for keyword before searching regexs 2015-04-03 15:33:19 -07:00
Pragmatic Software
d1341ab4bd Use proper lookbehind to prevent expansion of escaped variables
Remove adlib recursion loop since using $action already enables
recursion since subsitution on $action resets the regex position
2015-04-03 13:06:24 -07:00
Pragmatic Software
ae3791815b Allow recursive expansion of adlib variables
Rename $count to $depth to reflect recursion
2015-04-03 12:33:39 -07:00
Pragmatic Software
433f381bc9 Don't expand $1, $2, etc, as adlibs 2015-04-03 10:40:48 -07:00
Pragmatic Software
528f66bfed Refactor Factoids.pm to allow expansion of variables in all factoid types
Variables like $args and adlib variables can now be expanded in modules
and other factoid types.
2015-04-03 10:11:21 -07:00
Pragmatic Software
6701ee67f9 find_factoid() can now be told to return found alias instead 2015-03-28 17:49:42 -07:00
Pragmatic Software
ec13cf14bc Search all channels if target channel is not a valid channel (private message, for instance) 2015-02-15 20:18:46 -08:00
Pragmatic Software
f640ade74e Fix regex factoids so that regular factoid keywords have priority over regex triggers 2014-10-28 20:33:11 +00:00
Pragmatic Software
4dbec8001e Fix regex factoids in global namespace not being triggered 2014-10-14 02:30:14 +00:00
Pragmatic Software
60d8235999 Add registry entry to control max recursion depth for interpreter 2014-05-31 01:05:47 +00:00
Pragmatic Software
a81ba775fc Restored load, unload, count and histogram commands.
Removed enable/disable commands; use factset instead.

Add default_rate_limit registry entry.

Add newlines to output of DualIndexHashable set() subroutine.
2014-05-24 12:01:59 +00:00
Pragmatic Software
02c0143634 Add factmove command to rename/move factoids between channels 2014-05-23 12:42:23 +00:00
Pragmatic Software
30e3c5ce35 Remove PBot getter/setters; move anti-flood registry defaults to AntiFlood.pm 2014-05-18 20:09:05 +00:00
Pragmatic Software
e07df35cbf Move command modules out of PBot.pm and into their respective modules
E.g., FactoidCommands.pm is now loaded inside Factoids.pm, etc.

Misc reformatting/refactoring of PBot.pm
2014-05-18 00:27:57 +00:00
Pragmatic Software
d955bfa06c Add centralized configuration registry module
Allows changing of bot configuration values without needing to restart
bot instance or needing to edit pbot.pl script.

Registry will initially be populated with default values from pbot.pl,
but if a registry file exists then the registry values will take
precedence over the pbot.pl values. For instance, if you regset the
bot trigger to '%' then the trigger will be '%' even if pbot.pl has '!'
or something else explicitly set.

Some registry items can have trigger hooks associated with them.  For
instance, the irc->botnick registry entry has a change_botnick_trigger
associated with it which changes the IRC nick on the server when a new
value is set via regset/regadd.

Tons of other fixes and improvements throughout.
2014-05-17 20:08:19 +00:00
Pragmatic Software
d8d26b1cea Add registerable atexit functionality and trap SIGINT 2014-05-16 22:11:31 +00:00
Pragmatic Software
7367e4f18c Include action_with_args in factoids export 2014-04-07 04:50:00 +00:00
Pragmatic Software
8338b009d4 Properly handle preserve-whitespace; use modulelaucher_subpattern regex to correct whitespace 2014-03-18 14:55:34 +00:00
Pragmatic Software
36b7e1fa6f Improve handling of interpreter result and module execution 2014-03-14 10:05:11 +00:00
Pragmatic Software
17ed2fb64a Remove extranous ) typo in "Displaying text" string 2014-03-07 16:51:18 +00:00
Pragmatic Software
921c9917a5 Add $channel special variable for factoids/modules that expands to $from parameter 2014-03-04 21:40:13 +00:00
Pragmatic Software
9b2c374bbb Use export_site properly in Quotegrabs.pm 2014-03-03 10:33:34 +00:00
Pragmatic Software
f6c75f2b4f Factoids and Quotegrabs HTML exported tables can now be filtered 2014-03-03 09:24:33 +00:00
Pragmatic Software
aeec4fb2f5 Restore missing "$keyword is $result" when triggering factoid without $ref_from 2013-10-14 17:22:06 +00:00
Pragmatic Software
d374fdfc01 Skip channels without factoids in html export 2013-10-13 10:23:49 +00:00
Pragmatic Software
c91a8e5c3d Fix /say substitution derp that allowed "/say /msg foo bar" to actually invoke /msg rather than saying "/msg foo bar" 2013-10-12 15:06:27 +00:00
Pragmatic Software
02ebf106a8 Add table of contents to factoids html export 2013-10-12 13:52:12 +00:00
Pragmatic Software
aab27f4797 Improve factoids export to use tablesorter 2013-10-12 13:35:57 +00:00
Pragmatic Software
edff4b6c4c Update ref_user to use full hostmask instead of just nick; add edited_by/edited_on to factoid metadata levels hash 2013-07-31 13:48:50 +00:00
Pragmatic Software
dc52430044 Add SSL support, and other misc updates 2013-02-25 02:27:24 +00:00
Pragmatic Software
39a38b58f8 Triggering non-existent factoids now attempts to factfind (for keywords and text) before trying a levenshtein closest match (of keywords) 2012-11-04 20:42:38 +00:00
Pragmatic Software
ccf1d35a54 Improvements in interpreter; tell <nick> about <command>; etc 2012-08-23 22:50:07 +00:00
Pragmatic Software
8a70c06096 Misc bug fixes and tweaks 2012-07-22 19:22:30 +00:00
Pragmatic Software
1d691caeb9 factoids: don't show nick prefix if has action_with_args; updated factoids
interpreter: don't expand $nick in result for all commands
2011-12-17 00:30:44 +00:00
Pragmatic Software
a57394c762 factoids: oops, broke global channel searching, fixed (exact_channel restored) 2011-02-14 08:09:50 +00:00
Pragmatic Software
bede029261 factoids: probably adds/remove upper/lowercase keywords 2011-02-14 07:25:15 +00:00
Pragmatic Software
cd8791a854 factoids: better handling of triggering factoids in other namesapces; actions_with_args fixed 2011-01-30 07:18:28 +00:00
Pragmatic Software
845dff008e factoids: levenshtein search working again; rate-limit working again 2011-01-30 06:29:05 +00:00
Pragmatic Software
e4019895d3 factoids: added comments explaining namespace handling 2011-01-30 03:55:09 +00:00
Pragmatic Software
cb2c17f636 factids: er, it is fact <location> <keyword> not fact <keyword> <location>, oops 2011-01-30 03:06:45 +00:00
Pragmatic Software
ffdecba6ee factoids: be more clear about how to choose factoids from another channel if ambiguous keyword; find_factoid searches channel namespace better 2011-01-30 03:03:31 +00:00
Pragmatic Software
221a698ecb factoids: if unknown keyword is triggered inadvertedly, .e.g. by referencing the bot by name, and the args dont look like a nick then do not spit out the levenshtein matches text 2011-01-30 02:44:56 +00:00
Pragmatic Software
9336428ea2 factoids: improved handling of factoids belonging to other channels; significantly 2011-01-29 01:21:17 +00:00
Pragmatic Software
44b737a8c3 factoids: allow factset/factunset by regular users; factset/factunset now has list of metadata levels, and does ownership checking; added action_with_args metadata field to be substituted for action if factoid triggered with arguments 2011-01-25 22:40:22 +00:00
Pragmatic Software
a619f8fe9b factoids: Dont break factoids if used from stdin 2011-01-24 23:46:07 +00:00
Pragmatic Software
22c1673f3d factoids: dont remove trailing colon and/or comma from keywords in interpreter 2011-01-24 01:30:19 +00:00
Pragmatic Software
0f47100dc9 Rate-limit now per-channel (sort of) 2010-08-14 09:45:58 +00:00
Pragmatic Software
96db60d0fa encode_entities for factoid URLs in HTML export 2010-07-01 05:54:04 +00:00
Pragmatic Software
28a5d47af1 Exported factoids now have clickable links 2010-07-01 01:43:49 +00:00
Pragmatic Software
affb2c66d5 Remove trailing comma or colon from end of keyword if other characters exist before it; allow sentence-like arguments again 2010-06-30 12:18:25 +00:00
Pragmatic Software
31e53f2aff Allow question-marks in triggers if more than one is used; remove period from factoid names; return undef if factoid keyword is blank 2010-06-30 11:36:45 +00:00
Pragmatic Software
c6e48954c5 Levenshtein distance increased from 50% to 60%; Levenshtein searches all channels on unfound factoid 2010-06-30 10:59:50 +00:00
Pragmatic Software
9fa3b865e9 Factoids now ignore arguments that do not look like a nick if the factoid doesn't take an argument -- fixes factoid triggers on sentences with bot's name; find_factoid searches global channel if $from is not a channel 2010-06-30 04:58:22 +00:00
Pragmatic Software
5f5cd6ec08 regex factoids now trigger properly 2010-06-30 03:48:13 +00:00
Pragmatic Software
d7f2583aac Prettier export headers; factrem output for not owner now includes channel 2010-06-29 07:14:26 +00:00
Pragmatic Software
380a2b322c Factoid HTML export table now fits width appropriately 2010-06-29 06:50:49 +00:00
Pragmatic Software
43089e4599 Cleaned up extra factoid groups; made export factoids a little prettier; renamed "default channel" to "global channel" throughout 2010-06-29 06:12:52 +00:00
Pragmatic Software
6d3fc7f628 find_factoid now takes exact_trigger parameter; this fixes confusion with regex factoids 2010-06-27 02:52:06 +00:00
Pragmatic Software
818e09861c Added rate_limit to factoids 2010-06-21 15:23:46 +00:00
Pragmatic Software
562d265261 Adding factoid in a channel now creates that factoid in that channel instead of .*; info command now shows what channel factoid belongs to 2010-06-21 13:28:54 +00:00
Pragmatic Software
f9ab0c7e77 Added Time::Duration::ago() to !info command 2010-06-21 10:44:15 +00:00
Pragmatic Software
4be7fe3b34 Refactored Factoids to use DualIndexHashObject; added factset/factunset to set factoid meta-data; factoids now per-channel; slightly unfinished 2010-06-20 06:16:48 +00:00
Pragmatic Software
e6f9296010 Removed extra logging information 2010-06-19 17:38:14 +00:00
Pragmatic Software
8ebe546850 New factoid loading/saving -- much more flexible! 2010-05-08 23:36:56 +00:00
Pragmatic Software
1330bfcff5 Allow <foo> is <bar> to pass through to other interpeters if factoid already exists 2010-04-18 07:34:01 +00:00
Pragmatic Software
e051ede6f0 List Levenshtein-based closest matches if factoid not found 2010-04-09 22:55:24 +00:00
Pragmatic Software
0c54d9c93e Send message on private ignore; parse adlib variables better 2010-04-02 18:23:31 +00:00
Pragmatic Software
0b78e4ed79 Regex factoids restored 2010-04-02 17:33:18 +00:00
Pragmatic Software
d299a8fb0f 90% done in object-oriented conversion -- IgnoreList doesnt save/load/use regex yet. 2010-03-24 06:47:40 +00:00
Pragmatic Software
fa50724b58 Progressing on object-oriented conversion. Some functionality may be missing. 2010-03-23 18:24:02 +00:00
Pragmatic Software
bd46c11120 Half-way through converting everything to objects. Committing mostly working copy as preview. 2010-03-22 07:33:44 +00:00