mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-30 14:59:34 +01:00
Added announce command.
This commit is contained in:
parent
e7f6aa884f
commit
069d48b269
17
src/Owner.py
17
src/Owner.py
@ -330,8 +330,7 @@ class Owner(privmsgs.CapabilityCheckingPrivmsg):
|
|||||||
except Exception, e:
|
except Exception, e:
|
||||||
irc.reply(utils.exnToString(e))
|
irc.reply(utils.exnToString(e))
|
||||||
else:
|
else:
|
||||||
# This should never happen, so I haven't bothered updating
|
# This should never happen.
|
||||||
# this error string to say --allow-eval.
|
|
||||||
irc.error('You must run supybot with the --allow-eval '
|
irc.error('You must run supybot with the --allow-eval '
|
||||||
'option for this command to be enabled.')
|
'option for this command to be enabled.')
|
||||||
else:
|
else:
|
||||||
@ -341,6 +340,20 @@ class Owner(privmsgs.CapabilityCheckingPrivmsg):
|
|||||||
'this command to be enabled.')
|
'this command to be enabled.')
|
||||||
_exec = eval
|
_exec = eval
|
||||||
|
|
||||||
|
def announce(self, irc, msg, args):
|
||||||
|
"""<text>
|
||||||
|
|
||||||
|
Sends <text> to all channels the bot is currently on and not
|
||||||
|
lobotomized in.
|
||||||
|
"""
|
||||||
|
text = privmsgs.getArgs(args)
|
||||||
|
u = ircdb.users.getUser(msg.prefix)
|
||||||
|
text = 'Announcement from my owner (%s): %s' % (u.name, text)
|
||||||
|
for channel in irc.state.channels:
|
||||||
|
c = ircdb.channels.getChannel(channel)
|
||||||
|
if not c.lobotomized:
|
||||||
|
irc.queueMsg(ircmsgs.privmsg(channel, text))
|
||||||
|
|
||||||
def defaultplugin(self, irc, msg, args):
|
def defaultplugin(self, irc, msg, args):
|
||||||
"""[--remove] <command> [<plugin>]
|
"""[--remove] <command> [<plugin>]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user