Commit Graph

28 Commits

Author SHA1 Message Date
Brian S. Stephan 10071f9094 ircbot: add load/unload plugin documentation 2016-01-17 09:49:30 -06:00
Brian S. Stephan 676f479d52 ircbot: add some debug logging in plugin (un)load 2016-01-17 09:21:29 -06:00
Brian S. Stephan 4c949ee6f3 ircbot: don't unload just one plugin of path
if we somehow got multiple plugins of the same path loaded, unload them
all when unloading, not just the first one we find
2016-01-17 09:20:06 -06:00
Brian S. Stephan cdde966733 ircbot: properly output exception msg to string 2016-01-16 19:34:06 -06:00
Brian S. Stephan 9112ad0ae7 convert the project via 2to3 2016-01-16 18:02:17 -06:00
Brian S. Stephan e8d57b29b2 irclib.bot: don't del sys.modules[badname]
this makes no sense to do on ImportError since that's probably why we
got here. testing, not 100% sure this is right
2015-09-17 22:23:36 -05:00
Brian S. Stephan e2d4e29750 use LenientDecodingLineBuffer in bot guts
should make the bot more resilient to clients that send non-unicode text
2015-06-22 17:43:45 -05:00
Brian S. Stephan 772df777ba ircbot: tie bot users to django auth user, part 3
get rid of is_admin(), instead check for django permissions. a couple
things were using is_admin(), so now there's an example of the
permission adding and usage, as those were ported
2015-06-20 10:08:51 -05:00
Brian S. Stephan 397ae2243c ircbot: recurse if we had an alias hit
the idea is that there may be two aliases in the string, or the alias
may have created another alias
2015-06-19 21:40:35 -05:00
Brian S. Stephan bef66e3427 ircbot: specify commands after connecting
happens before the sleep and the autojoins
2015-06-16 19:02:00 -05:00
Brian S. Stephan f0072fb633 ircbot: configure a sleep before autojoin channels 2015-06-16 19:01:41 -05:00
Brian S. Stephan 56b495e8fb add an XML-RPC interface to the irc bot
this allows plugins to register methods that can be called over XML-RPC

the old bot used this interface behind apache for a web service, but i
think in this version it will only be for django -> ircbot, and django
will have a rest API for other things
2015-06-13 13:06:10 -05:00
Brian S. Stephan ed5f164092 ircbot: guess at nickmask in __init__()
some ircds don't lead to a welcome signal, so our attempts to set the
nickmask there may never happen. guess at one first, in the event that
_on_welcome() never fires
2015-05-21 18:45:01 -05:00
Brian S. Stephan 903a8f5c80 ircbot: list to remove_global_regex_handler
same as previous commit, inverse of add_, for convenience
2015-05-15 22:15:43 -05:00
Brian S. Stephan 134c02dc59 ircbot: list of events to add_global_regex_handler
for convenience, pass a list of events to add_global_regex_handler if
you want to have multiple things fire the same handler. common case is
pubmsg and privmsg
2015-05-15 22:08:00 -05:00
Brian S. Stephan fd85d37474 ircbot: use unicode_literals
desperate attempt to make unicode handling in this code better
2015-05-15 21:20:10 -05:00
Brian S. Stephan 5716e285b6 ircbot: attempt to bring recursion back
so initial tests suggest this is working well, but it's not exactly the
clearest code, so let's call this a rough proof of concept of recursion
in the bot
2015-05-15 18:20:59 -05:00
Brian S. Stephan 07ca50dfb6 ircbot: reply() method that supports recursion
undecided if i'll bother to bring recursion back, but if it works out,
provide this method to either reply or give text to the thing recursing.
either way this is a bit clearer than using privmsg() directly, usually
2015-05-15 17:35:03 -05:00
Brian S. Stephan bf68099f2f ircbot: handle more plugin load failures
possibly handle them a bit more cleanly, too, by deleting sys.modules
entries
2015-05-15 17:01:25 -05:00
Brian S. Stephan 7b93c7d63c provide reason for failure to load plugin 2015-05-14 21:43:35 -05:00
Brian S. Stephan 0428c30faf add Alias support
allows stuff like ^!die$ -> !quit

no recursion (yet? or maybe i'll never bother), but this should allow
the basic aliases
2015-05-14 21:39:20 -05:00
Brian S. Stephan e7de9f840d minor comment cleanup so pycharm highlights it 2015-05-14 10:34:20 -05:00
Brian S. Stephan 438ab414ff use bot.die() over bot.disconnect() 2015-05-12 22:34:27 -05:00
Brian S. Stephan 14e5fb4d6f ircbotlib.reply_destination_for_event
common idiom that'll only get used more and more, so might as well make
a library method of it
2015-05-12 22:33:09 -05:00
Brian S. Stephan 8c39b017d3 better _handle_event debug message 2015-05-12 22:30:32 -05:00
Brian S. Stephan c4bfcf3e1b add BotAdmin, IrcPlugin models
a lot of stuff in here around support for loading plugins from arbitrary
files. plugins have a basic amount of initialization and then hook into
the core IRC event system

it makes sense to have modules respond to regexes, so there's some
handler stuff for that --- it was the most popular way to do stuff in
the old version of the bot

we need to check that people trying to load plugins are admins, so
there's some stuff for that, too

the expectation is that many features from here are happen in plugins,
rather than modifying the core bot
2015-05-12 20:45:18 -05:00
Brian S. Stephan bd3ffd4067 add channel model, support autojoining
known channels in the database can be set to autojoin when the bot
starts (when it gets the MOTD, because i couldn't find an "on_connect"
event)
2015-05-10 10:02:25 -05:00
Brian S. Stephan 0ea9c3a164 rename ircbot.py to bot.py
ircbot/ircbot.py confused the importer
2015-05-09 20:03:55 -05:00