From f841e3ae18a2831f3ebcc1428d0fcaf661a22442 Mon Sep 17 00:00:00 2001 From: Elad Alfassa Date: Sat, 1 Jun 2013 00:46:28 +0300 Subject: [PATCH] [announce] Update to 4.0 standard Issue #276 Also removed useless print --- announce.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/announce.py b/announce.py index 58733890a2..ae99aec944 100644 --- a/announce.py +++ b/announce.py @@ -5,15 +5,16 @@ Licensed under the Eiffel Forum License 2. """ -def announce(willie, trigger): +from willie.module import command, example + +@command('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: - willie.reply('Sorry, I can\'t let you do that') + bot.reply('Sorry, I can\'t let you do that') return - print willie.channels - for channel in willie.channels: - willie.msg(channel, '[ANNOUNCMENT] %s' % trigger.group(2)) -announce.commands = ['announce'] -announce.example = '.announce Some important message here' + for channel in bot.channels: + bot.msg(channel, '[ANNOUNCMENT] %s' % trigger.group(2))