Commit Graph

707 Commits

Author SHA1 Message Date
Brian S. Stephan ed63e027d4 dr.botzo.py: optionally connect via ipv6, ssl 2013-01-22 17:12:37 -06:00
Brian S. Stephan 89847a6e58 IrcAdmin: sleep a configured time before autojoin
this is to let any sort of autosend commands apply before joining
channels. for example, i have my bot set to turn on its hostserv cloak,
which was sometimes happening after channel joins, making its hostname
appear different in various channels. this solves that

as a total aside, this module is becoming really poorly named, i should
probably do something about that
2013-01-13 11:45:01 -06:00
Brian S. Stephan 64341b4fb2 Merge branch 'master' of git.incorporeal.org:dr.botzo 2013-01-12 10:11:20 -06:00
Brian S. Stephan 475fa73bf3 Dispatch: encode('utf-8') XML-RPC input 2013-01-12 10:10:32 -06:00
Brian S. Stephan 9ea3e9d688 procmail-to-dispatch.py: send email notifications
this is a python3 example of how one might use Dispatch to send
notifications on events. it's nothing robust but it gets the job done,
generally
2013-01-04 13:13:38 -06:00
Brian S. Stephan 947e82b78f Dispatch: send messages to channels via XML-RPC
keep a collection of key-channel pairs that, when receiving an XML-RPC
dispatch message with a key and message, sends the message to the
associated channel. this allows for various notification bus style stuff

this is the barebones version, there's no IRC admin interaction yet, so
all key-channel pairs need to be managed by direct database access. it
is possible i won't bother changing this. there are also some
not-so-clever assumptions, like that the bot is already in the channel
it is trying to speak in
2013-01-04 10:17:07 -06:00
Brian S. Stephan 30a395bc05 Module: new_sendmsg, embrace one-connection idiom
since we've been saying that the rule is one bot, one connection, we
don't need to pass said connections around as much. this new_sendmsg(),
which should eventually become sendmsg(), uses that, and leans on
irc.server instead
2013-01-04 10:14:37 -06:00
Brian S. Stephan 77ada246c7 Module: stub out xmlrpc_init()
similar to db_init(), create a stub xmlrpc_init() that's called during
module initialization, for doing XML-RPC setup stuff
2013-01-04 10:13:57 -06:00
Brian S. Stephan f7f40fc070 Pi: comment cleanups 2012-12-21 11:24:16 -06:00
Brian S. Stephan 315869de4d TODO: thinking we probably don't need a cron thing 2012-12-21 11:20:54 -06:00
Brian S. Stephan 5ca200900f BUGS: document twitter bug to fix when i'm not lazy 2012-12-21 11:20:30 -06:00
Brian S. Stephan fe2358462a Countdown: remove unused import re 2012-12-20 18:06:09 -06:00
Brian S. Stephan 180cc6dacd TODO: use priority sensibly
probably, once all of the modules are using regex handlers, there won't
need to be a method for member for it at all, since the only thing that
will need to refer to it will be the module itself
2012-12-20 14:30:56 -06:00
Brian S. Stephan ecf295314d Echo: fix comment, groups is a tuple, not a list 2012-12-20 14:29:52 -06:00
Brian S. Stephan d0900452bc Countdown: total rewrite. regex handlers, mysql
this is a pretty decent example of how to do new modules now, i think,
and of decent size while showing most of what one would want to do
2012-12-20 14:27:43 -06:00
Brian S. Stephan 455abc0b8a Module: suggest register_handlers() for XML-RPC 2012-12-20 10:41:31 -06:00
Brian S. Stephan 08d08d537e Echo: wrap echo() for the XML-RPC server
this serves as a good example of how to reuse code for the XML-RPC
interface. we wrap it for convenience, so that all that needs to be
supplied to the web service method is the message to echo. of course,
other modules can wrap things how they feel the need to, even adding
authentication, i guess, if they wanted

note that it doesn't unregister the XML-RPC method. for starters, i
didn't add an unregister to DrBotIRC, so it can't, and secondly, it
looks like reregistering overwrites the old one. this hasn't been
extensively tested but that's what i'm seeing
2012-12-20 10:36:53 -06:00
Brian S. Stephan 4baf0a70e9 DrBotIRC: remove XML-RPC echo
the server idea seems to work, let's have Echo implement this as a
test/example
2012-12-20 10:34:38 -06:00
Brian S. Stephan f09bc06634 Echo: rewrite to do regex handlers
this is the first implementer of the new regex handler code, by all
accounts it's working fine, hopefully the underlying code in DrBotIRC
won't need to change as i go forward, but it might
2012-12-20 10:20:33 -06:00
Brian S. Stephan 7391e28b9b TODO: document an ancient shortcut to remove
this probably dates back to the beginning of the bot, a lot of things
that are handling irc events use event.arguments()[0] because it was
observed that that always had the entire message body, but i don't know
if that's actually the case --- in any event, we should probably loop
over it and try to find a way to handle everything

putting this off because the previous commit refactoring will obsolete
some methods, and because those that remain probably need to be reworked
to not return, and instead do something else to handle looping
2012-12-20 10:01:37 -06:00
Brian S. Stephan 52970894a9 DrBotIRC: add regex-matching global handlers
add_global_regex_handler and remove_global_regex_handler are new methods
that work the same as irclib's non-regex versions, but check patterns
before adding/removing. this allows for a more direct link between event
loop and module methods

i'm hoping that one day it will allow for the removal of ancient
shortcuts that just get in the way now, like do() and
on_pub_or_privmsg()

lightly tested, if anything is still brittle it's recursion, no doubt
2012-12-20 09:58:25 -06:00
Brian S. Stephan 53a3c40102 DrBotIRC: clean up event handlers a bit
this brings them more in line with the code in irclib, which will be
nice since i'm using that code as basis f or additions in a later commit
2012-12-20 09:50:20 -06:00
Brian S. Stephan 891b2bcab8 remove all of the help stuff
sorry, mikeb. it never really caught on and seemed kind of janky. i
intend to have something that uses docstrings in the future, with the
helping baked into Module or maybe even DrBotIRC
2012-12-19 21:12:49 -06:00
Brian S. Stephan 8d6d66333b Module: don't pass DrBotServerConnection to init
another "this is unnecessary" change, obviously impacting all the
modules that override __init__ as well as the base class. again, they
can use the DrBotIRC instance for anything, which is (with one
exception) only for add/remove_global_handler, which i'm planning on
working my way off of anyway
2012-12-19 21:06:53 -06:00
Brian S. Stephan 3e76f75bba Module: remove reply(), use DrBotIRC's
obviously this means all of the modules changed to accomodate. this is
one of many steps to reduce the number of times we pass connections and
servers and other such info around, when it's mostly unnecessary because
modules have a reference to DrBotIRC
2012-12-19 20:51:35 -06:00
Brian S. Stephan e4225abba4 DrBotIRC: remove connection argument from reply()
we only have one connection, we don't need to be told what to reply to
2012-12-19 20:32:18 -06:00
Brian S. Stephan 456671615b DrBotIRC: document irclib.IRC.connections
this is before i stupidly remove it again
2012-12-19 20:22:48 -06:00
Brian S. Stephan 885076c1b8 Module: remove some unused imports 2012-12-19 19:54:17 -06:00
Brian S. Stephan a440bf395c Module: documentation and whitespace cleanups
i've marked some stuff as deprecated, and there's even more of that kind
of thing coming up within the next dozen or so commits
2012-12-19 19:53:41 -06:00
Brian S. Stephan 582328973e DrBotIRC: use config nick/user to guess nickhost
we still override the nickhost guess with what comes out of the ircd's
welcome message, if it is a full nick!user@host (although now i'm
doubting if we should expect such a thing or if it was just unrealircd
being nice), but this produces more accurate guesses for the cases where
we don't do that override. this was affecting splitting
2012-12-19 15:12:57 -06:00
Brian S. Stephan a10e54bcc8 DrBotIRC: properly debug log welcome events
my git surgery failed me
2012-12-19 00:09:28 -06:00
Brian S. Stephan 2d98804823 TODO: bunch of updates/additions/clarifications 2012-12-19 00:02:47 -06:00
Brian S. Stephan 9fd8eeb504 remove GoogleTranslate
the API is no longer free. not that i've made Babelfish be at all
reliable yet, but let's prune the tree a bit while we're doing this kind
of thing
2012-12-19 00:00:20 -06:00
Brian S. Stephan 1ec2747f3e dr.botzo.py: whitespace/string cleanups
shockingly minor, it's a small file but i was expecting more egregious
code than there actually was
2012-12-18 23:40:54 -06:00
Brian S. Stephan bf6a5c5352 EXTERNALS: document python-twitter 2012-12-18 22:41:10 -06:00
Brian S. Stephan ebfeafe87b DrBotIRC: use format() rather than string concat
a couple other generic ' vs. " show up here too
2012-12-18 22:32:11 -06:00
Brian S. Stephan bf8a7e6453 DrBotIRC: module-wide logger rather than per-class
a couple formatting changes are caught in the wake of this change, and
NASFWG
2012-12-18 22:30:31 -06:00
Brian S. Stephan f30e1fd308 DrBotIRC: remove some unused imports 2012-12-18 22:17:04 -06:00
Brian S. Stephan da430981be DrBotIRC: docstring/comment cleanups
this is some of the oldest code in the bot, there's probably a lot more
that could be cleaned up (and, indeed, some upcoming commits do some of
that)
2012-12-18 22:15:52 -06:00
Brian S. Stephan 8a5e6b9130 IrcAdmin: note limitation with automsg and vhosts
i feel as if i should fix this eventually, but it's pretty low on the
priority list, to be honest
2012-12-18 20:56:30 -06:00
Brian S. Stephan b51b8b521d IrcAdmin: option for sending privmsgs on connect
nickserv/hostserv stuff are the obvious uses for this. i guess you could
have some sort of "hi i connected" type thing to the admin if you wanted
2012-12-18 20:15:32 -06:00
Brian S. Stephan f54e209c2f Pi: "unit circle" in the output message 2012-12-18 20:12:26 -06:00
Brian S. Stephan 7627af5d5b Radio: get mpd status and such
very rough, just committing because what few things it does do work
2012-11-07 18:15:56 -06:00
Brian S. Stephan fdc7a3d9a9 gross TODO: fix this later 2012-11-07 18:14:59 -06:00
Brian S. Stephan 9ec74d0e35 Markov: off by one while counting up to min_size 2012-10-05 17:09:04 -05:00
Brian S. Stephan 7b2e3fa9aa Weather: refer to the right object in prev. commit 2012-10-05 10:43:41 -05:00
Brian S. Stephan e69766e71e Weather: do ambiguous results prompt for forecast 2012-10-05 10:42:21 -05:00
Brian S. Stephan 0da81ca31e Weather: more verbose zmw codes in ambig. results
when printing zmw codes because the query was ambiguous, print
city, country rather than just city
2012-10-05 10:30:03 -05:00
Brian S. Stephan 49e83f18de Weather: do wunderground forecasts 2012-10-05 10:23:59 -05:00
Brian S. Stephan 425db7be81 Weather: weather conditions readability fixes
* bold (^B) city name, condition elements
* replace 32F and 32 F with 32°F
2012-10-05 10:22:35 -05:00