Skip to content

Commit

Permalink
[announce] Add an announce module
Browse files Browse the repository at this point in the history
This module allows bot owners to send announcements to all channels the bot is currently in
  • Loading branch information
Elad Alfassa committed May 3, 2013
1 parent 133b292 commit d932017
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions announce.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# -*- coding: utf8 -*-
"""
announce.py - Send a message to all channels
Copyright © 2013, Elad Alfassa, <[email protected]>
Licensed under the Eiffel Forum License 2.
"""
def announce(willie, 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')
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'

0 comments on commit d932017

Please sign in to comment.