sopel/modules/announce.py
2018-03-16 12:08:02 -04:00

20 lines
527 B
Python
Executable File

#!/usr/bin/env python3
"""
Sends a message to all channels the bot is currently in.
"""
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:
bot.say('[ANNOUNCEMENT] %s' % trigger.group(2), channel)
bot.reply('Announce complete.')