use GenericAPIView rather than APIView in order to get some common idiom
stuff done for us. we continue to support GET and POST in
DispatchMessage, now it's just a bit cleaner. i think.
anyway if we were doing this stuff more we could/should probably create
mixins for them, but at the moment this is pretty sane i think
this moves the dispatcher functionality that used to be in the old
ircbot directly to django REST framework, which is more robust and
allows for cooler stuff down the road. this still retains the ability to
have the bot privmsg, that still happens over the XML-RPC interface,
this is just a more convenient frontend to that
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
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
this is a djangoification of the old (really old, actually) karma stuff
written by mike bloy. functionality should be the same, and might be a
bit faster through the ORM now
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
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
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
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
this is just a basic port of the tables into django models right now.
there's some serious slowness in the state creation that i need to fix
before this does anything, but i want to get this in a real database on
a real linode before i go too much further, so here it is