sopel/modules/announce.py

20 lines
527 B
Python
Raw Permalink Normal View History

2018-03-16 12:08:02 -04:00
#!/usr/bin/env python3
2017-11-22 19:26:40 -05:00
"""
2018-03-16 12:08:02 -04:00
Sends a message to all channels the bot is currently in.
2017-11-22 19:26:40 -05:00
"""
from module import commands, example
@commands('announce')
@example('.announce Some important message here')
def announce(bot, trigger):
"""
2018-03-16 12:08:02 -04:00
Send an announcement to all channels the bot is in.
2017-11-22 19:26:40 -05:00
"""
if not trigger.admin:
bot.reply('Sorry, I can\'t let you do that')
return
for channel in bot.channels:
bot.say('[ANNOUNCEMENT] %s' % trigger.group(2), channel)
2017-11-22 19:26:40 -05:00
bot.reply('Announce complete.')