From b51b8b521db00d373b478512f37f34843e753497 Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Tue, 18 Dec 2012 20:15:32 -0600 Subject: [PATCH] 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 --- dr.botzo.cfg.example | 1 + modules/IrcAdmin.py | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/dr.botzo.cfg.example b/dr.botzo.cfg.example index d9ade37..8d5c024 100644 --- a/dr.botzo.cfg.example +++ b/dr.botzo.cfg.example @@ -14,6 +14,7 @@ dbname = dr_botzo [IrcAdmin] autojoin = #bss +automsg = nickserv identify foo [Karma] meta.pubmsg_needs_bot_prefix = false diff --git a/modules/IrcAdmin.py b/modules/IrcAdmin.py index 459b746..a91425c 100644 --- a/modules/IrcAdmin.py +++ b/modules/IrcAdmin.py @@ -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(',')