2017-11-22 19:26:40 -05:00
|
|
|
# coding=utf-8
|
|
|
|
"""
|
|
|
|
announce.py - Send a message to all channels
|
|
|
|
Copyright © 2013, Elad Alfassa, <elad@fedoraproject.org>
|
|
|
|
Licensed under the Eiffel Forum License 2.
|
|
|
|
|
|
|
|
"""
|
|
|
|
from module import commands, example
|
|
|
|
|
|
|
|
|
|
|
|
@commands('announce')
|
|
|
|
@example('.announce Some important message here')
|
|
|
|
def announce(bot, trigger):
|
|
|
|
"""
|
|
|
|
Send an announcement to all channels the bot is in
|
|
|
|
"""
|
|
|
|
if not trigger.admin:
|
|
|
|
bot.reply('Sorry, I can\'t let you do that')
|
|
|
|
return
|
|
|
|
for channel in bot.channels:
|
2018-01-05 08:46:52 -05:00
|
|
|
bot.say('[ANNOUNCEMENT] %s' % trigger.group(2), channel)
|
2017-11-22 19:26:40 -05:00
|
|
|
bot.reply('Announce complete.')
|