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
This commit is contained in:
Brian S. Stephan 2012-12-18 20:15:32 -06:00
parent f54e209c2f
commit b51b8b521d
2 changed files with 9 additions and 0 deletions

View File

@ -14,6 +14,7 @@ dbname = dr_botzo
[IrcAdmin]
autojoin = #bss
automsg = nickserv identify foo
[Karma]
meta.pubmsg_needs_bot_prefix = false

View File

@ -46,6 +46,14 @@ class IrcAdmin(Module):
connection.mode(nick, usermode)
except NoOptionError: pass
# run automsg commands
try:
automsgs = self.config.get(self.__class__.__name__, 'automsg').split(',')
for command in automsgs:
connection.privmsg(command.split(' ')[0],
' '.join(command.split(' ')[1:]))
except NoOptionError: pass
# join the specified channels
try:
autojoins = self.config.get(self.__class__.__name__, 'autojoin').split(',')