Commit Graph

14 Commits

Author SHA1 Message Date
649e183337 allow for newlines in DrBotIRC.reply(), split on them for multiple lines of output 2011-01-08 14:40:01 -06:00
a6c7b6b0b2 list loaded modules in DrBotIRC, display it via IrcAdmin 2011-01-08 01:22:31 -06:00
3e533890a1 IrcAdmin: following the last change to saving, have !save also call a new save_modules() 2011-01-08 00:49:10 -06:00
faf37447cf make the module saving a bit more consistent 2011-01-08 00:44:37 -06:00
015fe87e1a implement priority in calling do().
store module.do instead of module, making this an awful lot like
an internal command bus. steal a trick from irclib and sort based
on priority, while we're at it. we added priority a while ago, and
this means that low prio (high value) items are called later, meaning
we can do things like

!join #botname

and have the IrcAdmin handler handle it before MegaHAL gets to it
2011-01-08 00:32:46 -06:00
c23b59d705 improve upon the splitting (which was excessive following the last commit).
clarify the terminology a bit, too
2011-01-08 00:05:00 -06:00
bf7074b76e use a welcome handler to capture the bot's nickmask.
we do this deep in the server in order to have the split functionality
use it properly. i still don't know if it handles server privacy
masks properly (which would only be noticed if that cloak is sent
when you connect).

actually, on that note, this only works if the ircd sends the
nickmask in 001. but hey, it works on one server at least
2011-01-07 23:56:51 -06:00
359ca24856 remove replypath and all the places it was used.
with alias calling do() internally, there is no need for all this
replypath nonsense, and if there's ever a module that needs to reply
to stuff on its own outside of do(), it'd have to be implementing
all of this anyway, so it was pretty irrelevant.

this makes DrBotIRC alias/recursion stuff a bit cleaner.
2011-01-07 23:09:07 -06:00
a234807335 move !alias manipulation commands out of try_alias and into the pubmsg/privmsg handler 2011-01-07 22:34:27 -06:00
4cac5f1a93 fixes and improvements to recursion and alias support 2011-01-07 22:31:30 -06:00
516940630c hack the replypath to the sender, if we're handling a privmsg 2011-01-07 21:14:14 -06:00
6b2af47552 don't display 'debug' in the alias list 2011-01-07 20:36:42 -06:00
01d3c7c80c migrate some code that became pivotal to the bot into DrBotIRC.
this is a big change. DrBotIrc is now in charge of module loading
and unloading, aliases, and recursion. the Alias module is no more,
and a bunch of functionality was moved out of IrcAdmin, including
also config file saving, the sigint handler, and quitting the bot.

additionally, a lot of stuff got caught in the wake. dr.botzo.py
is simpler now, and lets DrBotIRC do the dynamic loading stuff.
Module.__init__ changed, modules no longer get modlist and instead
get a reference to the DrBotIRC object. IrcAdmin still has the same
exposed methods, but now calls out to DrBotIRC to achieve some of
them.

naturally, a recursion/alias rewrite was included with this change.
it is clearer now (i think), but probably brittle somewhere.
additionally, currently any module that has registered a pubmsg
handler can potentially fire more than once on one input (without
recursion). this may be the next thing to fix. do() may need to
be split, or maybe it's time to stop having modules deal with
pubmsg/privmsg entirely. need to decide.

WEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
2011-01-07 17:38:26 -06:00
4d6228b93a move DrBotIRC into a separate file, since we will probably be hacking more on it soon 2011-01-07 09:54:51 -06:00