2018-03-16 03:13:43 -04:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
"""
|
|
|
|
Sends a message to all channels the bot is currently in.
|
|
|
|
"""
|
2020-01-07 18:58:19 -05:00
|
|
|
from module import commands, example, require_admin
|
2018-03-16 03:13:43 -04:00
|
|
|
|
|
|
|
|
2020-01-07 18:58:19 -05:00
|
|
|
@require_admin
|
2018-03-16 03:13:43 -04:00
|
|
|
@commands('announce')
|
|
|
|
@example('.announce Some important message here')
|
|
|
|
def announce(bot, trigger):
|
|
|
|
"""
|
|
|
|
Send an announcement to all channels the bot is in.
|
|
|
|
"""
|
2020-01-07 18:58:19 -05:00
|
|
|
if len(trigger.args) < 2:
|
|
|
|
return bot.reply("What message?")
|
2019-10-08 11:45:21 -04:00
|
|
|
for channel in bot.channels.keys():
|
2020-01-07 18:58:19 -05:00
|
|
|
bot.msg(channel, f"[ANNOUNCEMENT] {trigger.args[1]}")
|
2018-03-16 03:13:43 -04:00
|
|
|
bot.reply('Announce complete.')
|