3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-06 20:19:33 +01:00
Commit Graph

202 Commits

Author SHA1 Message Date
Pragmatic Software
b04015286c Interpreter: minor corrections to split_line 2019-05-28 11:56:06 -07:00
Pragmatic Software
e287887765 Interpreter: rewrite make_args to gracefully handle unbalanced quotes 2019-05-28 11:11:32 -07:00
Pragmatic Software
925a5e57bd Minor whitespace syntax clean-up throughout 2019-05-28 09:19:42 -07:00
Pragmatic Software
aa19260a24 Interpreter: fix mishandling of spaces when building arglist 2019-05-27 07:43:14 -07:00
Pragmatic Software
a892e8e5c1 Interpreter: add tell nick the <command> syntax 2019-05-20 13:10:08 -07:00
Pragmatic Software
2dc78f7383 Interpreter: fix incorrect handling of quoted arguments 2019-05-15 10:59:48 -07:00
Pragmatic Software
6f6090efc5 Interpreter: reduce human-like delay durations 2019-05-15 10:59:20 -07:00
Pragmatic Software
73741e5418 code-factoids: handle arguments a little better 2019-05-09 21:04:28 -07:00
Pragmatic Software
f8d8cac7d4 Interpreter: case-insensitive "Why would I want to do that to myself?" exceptions 2019-05-04 19:04:11 -07:00
Pragmatic Software
42f0bb7002 Interpreter: ignore bot commands from unidentified users in +z channels 2018-08-13 20:06:07 -07:00
Pragmatic Software
75f6d86a88 AntiFlood: disregard unreg spam floods on +z channels 2018-08-13 14:25:35 -07:00
Pragmatic Software
16b708851a Replace missed split with split_args 2018-08-09 22:44:28 -07:00
Pragmatic Software
174de2be8e Update all commands to understand quoted arguments; factoid names, etc, can now contain spaces 2018-08-08 17:38:57 -07:00
Pragmatic Software
6454ff82aa Interpreter: support array of positional arguments 2018-08-06 20:23:35 -07:00
Pragmatic Software
7b20a00797 Interpreter: improve parsing of pipes 2018-08-06 18:47:07 -07:00
Pragmatic Software
65644815e0 Interpreter: check for +z chanmode and ignore commands from banned users 2018-08-05 22:48:24 -07:00
Pragmatic Software
e1028f84a2 Fix escaping of pipes and command substitutions 2018-05-21 19:27:57 -07:00
Pragmatic Software
4f54ee669c Do not do me/my expansion for a few more commands 2018-05-21 18:06:32 -07:00
Pragmatic Software
89f38026d3 Fix preserve whitespace setting 2018-05-21 18:02:16 -07:00
Pragmatic Software
3626399b85 Immediately process output queue if delay <= 0 2018-02-18 16:39:26 -08:00
Pragmatic Software
4064075df9 Force checkflood for output_queue to ensure messages are logged 2018-02-16 11:12:41 -08:00
Pragmatic Software
8248661ef0 Interpreter: Exempt some more keywords from me/my expansion; add "I am" -> "nick is" expansion 2018-02-09 19:09:11 -08:00
Pragmatic Software
774da2f033 Do not replace me or my in Spinach lies 2018-01-31 22:12:28 -08:00
Pragmatic Software
7e061741da Improve nick-prefix/override 2018-01-23 13:58:03 -08:00
Pragmatic Software
8441869fac Fix embedded command extraction 2017-12-18 03:51:09 -08:00
Pragmatic Software
8fb98d614f Add ability to override command effective-level 2017-12-11 12:44:19 -08:00
Pragmatic Software
1d2d057d45 Properly flag whether a command was processed and interpreted 2017-12-09 13:26:20 -08:00
Pragmatic Software
f24c26d2ef Straighten out nickoverride a bit 2017-12-09 13:25:11 -08:00
Pragmatic Software
b2273d32fb Extract nested command substitutions and pipes 2017-12-08 20:26:08 -08:00
Pragmatic Software
4338455e11 Properly extract embedded commands 2017-12-08 19:28:08 -08:00
Pragmatic Software
e2db94c354 Add WebPaste.pm for rotating paste sites 2017-12-05 21:05:44 -08:00
Pragmatic Software
1378e41c1b Improve handling of /say, etc, in output text 2017-12-04 21:22:19 -08:00
Pragmatic Software
0d0c12e798 Unescape escaped command substitutions 2017-12-04 20:12:27 -08:00
Pragmatic Software
43d227d1a9 Support command substitution 2017-12-04 18:34:34 -08:00
Pragmatic Software
f6da7f5662 Prevent /msg to serv@network (currently only abusable by admins) 2017-12-03 19:09:34 -08:00
Pragmatic Software
3ab8f44a8a No need to show debugcontext log for empty result 2017-12-02 15:04:36 -08:00
Pragmatic Software
7a53f74e83 Handle commands/pipes with newlines 2017-11-30 18:50:17 -08:00
Pragmatic Software
51735494b3 Minor improvement to nick addressing 2017-11-30 13:11:39 -08:00
Pragmatic Software
6ddfce4cc3 Remove code duplication 2017-11-28 19:10:22 -08:00
Pragmatic Software
ed5a34f16e Fix piping from aliases containing pipes 2017-11-28 19:07:01 -08:00
Pragmatic Software
e0e8434b85 Fix piping code-factoids 2017-11-28 18:30:35 -08:00
Pragmatic Software
3b36634fa9 Fix factoid case duplication; enable me/my for pipes 2017-11-27 02:14:34 -08:00
Pragmatic Software
1222436616 Pipes can now be escaped for easy factadding, etc 2017-11-25 20:01:34 -08:00
Pragmatic Software
78a12b3a46 Improve nickoverride processing 2017-11-25 20:00:55 -08:00
Pragmatic Software
a7f298520d Temporarily fix /msg, sort of 2017-11-23 14:12:23 -08:00
Pragmatic Software
51b1b25b16 Add debugcontext registry item for $stuff dumps 2017-11-20 16:10:48 -08:00
Pragmatic Software
fc6e0759d3 Fix dead argument in pipe 2017-11-19 14:39:03 -08:00
Pragmatic Software
45dcefc752 /kick factoids can now be piped 2017-11-17 21:38:28 -08:00
Pragmatic Software
7b903854a3 Remove secretstuff; use $stuff context instead 2017-11-17 21:37:54 -08:00
Pragmatic Software
656adae53c Improvements to piping and stuff 2017-11-17 13:53:23 -08:00
Pragmatic Software
3ed4d58570 Significant refactoring of command passing
Instead of passing locally-scoped short-lived parameters to subroutines,
we now create and pass around a "stuff" context hash.

This allows contextual state to be passed and updated throughout the life
of a command.

This commit is a WIP and is 90% finished. There are likely to be a couple of
edge-cases where strange things may happen. But command-piping mostly works!
2017-11-16 09:23:58 -08:00
Pragmatic Software
68279d7a82 Minor refactor of process_line to ignore embedded commands within full commands 2017-11-14 15:27:30 -08:00
Pragmatic Software
d644ac04d5 Limit factoid keywords to 30 characters 2017-11-13 12:00:34 -08:00
Pragmatic Software
d771d66d8f fact_find no longer treats some aliases as regex when they alias a built-in command 2017-10-09 19:35:11 -07:00
Pragmatic Software
f07c34f53f Paste to ix.io instead of sprunge; set 10 second timeout for pastes 2017-10-05 14:31:58 -07:00
Pragmatic Software
8ba0664b85 Improve parsing of embedded factoids 2017-10-05 14:31:00 -07:00
Pragmatic Software
85693f905a Convert code-factoids to use VM
Code-factoids can now use the compiler virtual machine. Any languages installed
in the VM are valid candidates for code-factoids!

Syntax: factadd keyword /code language code here
2017-09-10 19:53:29 -07:00
Pragmatic Software
d6a845f988 Do some basic string validation for factoids and such 2017-09-05 00:27:28 -07:00
Pragmatic Software
1b70de807b Change split / / to split /\s+/ throughout 2017-09-02 00:39:29 -07:00
Pragmatic Software
5ee07e08d2 Replace control chars with escaped ordinals 2017-09-02 00:19:39 -07:00
Pragmatic Software
0fd81482d7 Follow factoid aliases when checking for use_output_queue 2017-08-30 18:03:10 -07:00
Pragmatic Software
b0b1d1affa Fix incorrect fact_find in interpreter 2017-08-30 06:54:23 -07:00
Pragmatic Software
2ac7b6feb6 Exclude "Why would I want to do that to myself?" from specific commands 2017-08-26 04:06:36 -07:00
Pragmatic Software
1a08156443 Add $0 in factoid action to expand to first keyword used to invoke factoid 2017-08-26 01:45:18 -07:00
Pragmatic Software
17a62b48e4 Limit truncation pastes to 8000 bytes 2017-08-24 15:16:42 -07:00
Pragmatic Software
f6827aa886 Give embedded commands lowest priority so they are not extracted from actual commands 2017-08-24 15:13:20 -07:00
Pragmatic Software
375dd52b41 Add some more commands to me/my-expansion exclusion-list 2017-08-23 19:22:03 -07:00
Pragmatic Software
63bbcb0941 Handle command queue results 2017-08-12 23:42:56 -07:00
Pragmatic Software
c8fa308113 Fix harmless undefined variable warning 2017-08-08 21:18:45 -07:00
Pragmatic Software
e723379c4d Improve the bot's understanding of "me" and "my" 2017-08-01 21:34:57 -07:00
Tomasz Kramkowski
b5d8f72254 License project under MPL2
This patch adds the file LICENSE which is the verbatim copy of the
Mozilla Public License Version 2.0 as retreived from
https://www.mozilla.org/media/MPL/2.0/index.815ca599c9df.txt on
2017-03-05.

This patch also places license headers for the MPL2 type A variant of
the license header in the following files:

PBot/AntiFlood.pm
PBot/BanTracker.pm
PBot/BlackList.pm
PBot/BotAdminCommands.pm
PBot/BotAdmins.pm
PBot/ChanOpCommands.pm
PBot/ChanOps.pm
PBot/Channels.pm
PBot/Commands.pm
PBot/DualIndexHashObject.pm
PBot/EventDispatcher.pm
PBot/FactoidCommands.pm
PBot/FactoidModuleLauncher.pm
PBot/Factoids.pm
PBot/HashObject.pm
PBot/IRCHandlers.pm
PBot/IgnoreList.pm
PBot/IgnoreListCommands.pm
PBot/Interpreter.pm
PBot/LagChecker.pm
PBot/Logger.pm
PBot/MessageHistory.pm
PBot/MessageHistory_SQLite.pm
PBot/NickList.pm
PBot/PBot.pm
PBot/Plugins.pm
PBot/Plugins/AntiAway.pm
PBot/Plugins/AntiKickAutoRejoin.pm
PBot/Plugins/AntiRepeat.pm
PBot/Plugins/AntiTwitter.pm
PBot/Plugins/AutoRejoin.pm
PBot/Plugins/Counter.pm
PBot/Plugins/Quotegrabs.pm
PBot/Plugins/Quotegrabs/Quotegrabs_Hashtable.pm
PBot/Plugins/Quotegrabs/Quotegrabs_SQLite.pm
PBot/Plugins/UrlTitles.pm
PBot/Plugins/_Example.pm
PBot/Refresher.pm
PBot/Registerable.pm
PBot/Registry.pm
PBot/RegistryCommands.pm
PBot/SQLiteLogger.pm
PBot/SQLiteLoggerLayer.pm
PBot/SelectHandler.pm
PBot/StdinReader.pm
PBot/Timer.pm
PBot/Utils/ParseDate.pm
PBot/VERSION.pm
build/update-version.pl
modules/acronym.pl
modules/ago.pl
modules/c11std.pl
modules/c2english.pl
modules/c2english/CGrammar.pm
modules/c2english/c2eng.pl
modules/c99std.pl
modules/cdecl.pl
modules/cfaq.pl
modules/cjeopardy/IRCColors.pm
modules/cjeopardy/QStatskeeper.pm
modules/cjeopardy/Scorekeeper.pm
modules/cjeopardy/cjeopardy.pl
modules/cjeopardy/cjeopardy_answer.pl
modules/cjeopardy/cjeopardy_filter.pl
modules/cjeopardy/cjeopardy_hint.pl
modules/cjeopardy/cjeopardy_qstats.pl
modules/cjeopardy/cjeopardy_scores.pl
modules/cjeopardy/cjeopardy_show.pl
modules/codepad.pl
modules/compiler_block.pl
modules/compiler_client.pl
modules/compiler_vm/Diff.pm
modules/compiler_vm/cc
modules/compiler_vm/compiler_client.pl
modules/compiler_vm/compiler_server.pl
modules/compiler_vm/compiler_server_vbox_win32.pl
modules/compiler_vm/compiler_server_watchdog.pl
modules/compiler_vm/compiler_vm_client.pl
modules/compiler_vm/compiler_vm_server.pl
modules/compiler_vm/compiler_watchdog.pl
modules/compiler_vm/languages/_c_base.pm
modules/compiler_vm/languages/_default.pm
modules/compiler_vm/languages/bash.pm
modules/compiler_vm/languages/bc.pm
modules/compiler_vm/languages/bf.pm
modules/compiler_vm/languages/c11.pm
modules/compiler_vm/languages/c89.pm
modules/compiler_vm/languages/c99.pm
modules/compiler_vm/languages/clang.pm
modules/compiler_vm/languages/clang11.pm
modules/compiler_vm/languages/clang89.pm
modules/compiler_vm/languages/clang99.pm
modules/compiler_vm/languages/clangpp.pm
modules/compiler_vm/languages/clisp.pm
modules/compiler_vm/languages/cpp.pm
modules/compiler_vm/languages/freebasic.pm
modules/compiler_vm/languages/go.pm
modules/compiler_vm/languages/haskell.pm
modules/compiler_vm/languages/java.pm
modules/compiler_vm/languages/javascript.pm
modules/compiler_vm/languages/ksh.pm
modules/compiler_vm/languages/lua.pm
modules/compiler_vm/languages/perl.pm
modules/compiler_vm/languages/python.pm
modules/compiler_vm/languages/python3.pm
modules/compiler_vm/languages/qbasic.pm
modules/compiler_vm/languages/scheme.pm
modules/compiler_vm/languages/server/_c_base.pm
modules/compiler_vm/languages/server/_default.pm
modules/compiler_vm/languages/server/c11.pm
modules/compiler_vm/languages/server/c89.pm
modules/compiler_vm/languages/server/c99.pm
modules/compiler_vm/languages/server/clang.pm
modules/compiler_vm/languages/server/clang11.pm
modules/compiler_vm/languages/server/clang89.pm
modules/compiler_vm/languages/server/clang99.pm
modules/compiler_vm/languages/server/cpp.pm
modules/compiler_vm/languages/server/freebasic.pm
modules/compiler_vm/languages/server/haskell.pm
modules/compiler_vm/languages/server/java.pm
modules/compiler_vm/languages/server/qbasic.pm
modules/compiler_vm/languages/server/tendra.pm
modules/compiler_vm/languages/sh.pm
modules/compiler_vm/languages/tendra.pm
modules/compliment
modules/cstd.pl
modules/define.pl
modules/dice_roll.pl
modules/excuse.sh
modules/expand_macros.pl
modules/fnord.pl
modules/funnyish_quote.pl
modules/g.pl
modules/gdefine.pl
modules/gen_cfacts.pl
modules/gencstd.pl
modules/get_title.pl
modules/getcfact.pl
modules/google.pl
modules/gspy.pl
modules/gtop10.pl
modules/gtop15.pl
modules/headlines.pl
modules/horoscope
modules/horrorscope
modules/ideone.pl
modules/insult.pl
modules/love_quote.pl
modules/man.pl
modules/map.pl
modules/math.pl
modules/prototype.pl
modules/qalc.pl
modules/random_quote.pl
modules/seen.pl
modules/urban
modules/weather.pl
modules/wikipedia.pl
pbot.pl
pbot.sh

It is highly recommended that this list of files is reviewed to ensure
that all files are the copyright of the sole maintainer of the
repository. If any files with license headers contain the intellectual
property of anyone else, it is recommended that a request is made to
revise this patch or that the explicit permission of the co-author is
gained to allow for the license of the work to be changed.

I (Tomasz Kramkowski), the contributor, take no responsibility for any
legal action taken against the maintainer of this repository for
incorrectly claiming copyright to any work not owned by the maintainer
of this repository.
2017-03-06 00:31:15 +00:00
Pragmatic Software
f3b3e90cdc Add factoid effective-level metadata and ability to kick from such factoids
Factoids can now have an effective-level metadata field. When set, certain
functionality requiring an effective-level will be enabled.

For now, that is currently only the /kick command, which has an effective-level
of 10.

Factoids with an effective-level set will also have the locked metadata
attribute set as well to prevent people from changing the factoid.  The
locked and/or effective-level attributes will be removable only by admins
whose level is equal to or greater than the effective-level.
2016-11-16 19:07:01 -08:00
Pragmatic Software
170dac5776 Improve !cmd and nick: !cmd processing 2016-10-23 03:51:59 -07:00
Pragmatic Software
8addeb5d49 Allow "nick: !command" to address to nick; minor improvements 2016-10-14 05:56:54 -07:00
Pragmatic Software
f34854fcec Add nick similarity completion
Previously, the bot wouldn't address people by nick if the provided nick
argument doesn't exist in the channel.

Now, the bot's nick list is searched for a nick with a certain similarity
percentage in the order of most recently spoken nicks first. This allows
the bot to address nicks when somebody may have forgotten to add a trailing
underscore/punctuation or may have typoed the nick.

The similarity percentage can be set via the interpreter->nick_similiarty
registry key.  A value of 0 should disable the behavior.
2016-09-25 00:03:37 -07:00
Pragmatic Software
949dc14525 Command queue no longer delays commands relative to each other 2016-07-01 13:29:26 -07:00
Pragmatic Software
b215dfe9de Add command queue for delayed command processing 2016-07-01 13:00:20 -07:00
Pragmatic Software
dcacec18c6 Totally not a bug
Extremely minor rearrangement of interpreter logic so that `!commands` are
parsed before `command, botnick`. Totally not a bug at all. Pay no attention.
2016-06-25 18:09:47 -07:00
Pragmatic Software
14124da3ac Embedded triggers now work at beginning of message 2016-01-19 06:51:40 -08:00
Pragmatic Software
2962a44c12 No longer remove trailing punctuation from embedded factoid commands 2015-11-26 12:36:36 -08:00
Pragmatic Software
43418c1bc6 Require curly braces or backticks around embedded commands 2015-10-10 06:07:24 -07:00
Pragmatic Software
43c0361354 Add botnick to "Why would I want to do that to myself?" condition 2015-09-19 20:02:11 -07:00
Pragmatic Software
70f091545b Replace "me" in factoid arguments only during first interpretation pass 2015-09-10 01:51:24 -07:00
Pragmatic Software
e5097eee69 Move URL titles to UrlTitles.pm plugin
Add $event->{interpreted} field to events to notify other handlers
whether an event was successfully interpreted by the interpreter.

An $event->{interpreted} that is equal to or greater than 100 means the entire
message was consumed and handlers shouldn't do any further processing of it
that would generate any output to channels or users.

Otherwise, $event->{interpreted} is incremented by 1 for each referenced
command that was processed.
2015-09-08 01:37:34 -07:00
Pragmatic Software
d51d2367a1 Correct logic of login command ignore check 2015-09-07 05:04:54 -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
499d91e07d Do not exempt bot-admins lower than level 10 from ignore list 2015-08-08 12:39:17 -07:00
Pragmatic Software
dbfb8a6add Remove unnecessary printing of ignored messages 2015-07-23 17:47:16 -07:00
Pragmatic Software
7cc8b9c34d Allow chat-flood antiflood settings to be overridable on a per-channel basis 2015-07-08 14:05:55 -07:00
Pragmatic Software
0c1e573ef8 Do not invoke compilation for compile-blocks if nick-prefix is specified and does not exist in channel 2015-06-19 16:16:23 -07:00
Pragmatic Software
3012297183 Do not require whitespace next to nick when triggering by bot-nick 2015-05-27 10:44:26 -07:00
Pragmatic Software
0b1d5c29bf Fall back to codepad if sprunge fails to paste
Refactor rate-ratelimiting.
2015-05-15 17:53:13 -07:00
Pragmatic Software
a997705ea4 Correct sprunge error message 2015-05-06 21:22:22 -07:00
Pragmatic Software
898aa18783 Add rate-limit to paste_sprunge function
Improve formatting of truncate/paste output when an error has occurred.
2015-05-06 21:15:25 -07:00
Pragmatic Software
715ff8ee78 Find factoids in proper channel namespace 2015-04-26 16:05:03 -07:00
Pragmatic Software
f20932b442 Allow setting channel-specific registry item no_url_titles and no_compile_blocks to prevent invoking these in those channels
Rename $mynick to $botnick throughout
2015-04-19 01:55:52 -07:00
Pragmatic Software
9ff76ad500 Reduce pseudo-AI typing delay 2015-04-13 15:41:11 -07:00
Pragmatic Software
17afac5908 Check commands table for keyword before searching regexs 2015-04-03 15:33:19 -07:00
Pragmatic Software
383c194966 Don't remove trailing punctuation from arguments
Rename $count to $depth to reflect recursion
2015-04-03 12:32:35 -07:00
Pragmatic Software
c73f8b6a01 Minor refactor 2015-03-30 15:04:08 -07:00