forked from skoczen/will
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Help and Announce Improvements (#13)
* Improved help commands * Announcements.py has some (inactive) examples * UNSURE replies now append specific help instructions for Slack in that backend's IO
- Loading branch information
Showing
5 changed files
with
31 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,26 @@ | ||
from will.plugin import WillPlugin | ||
from will.decorators import respond_to, periodic, hear, randomly, route, rendered_template, require_settings | ||
from plugins.pco import birthday, address, phone_numbers, checkins, msg_attachment, authenticate | ||
from plugins.pco import birthday, address, phone_numbers, checkins, msg_attachment, authenticate, pcoservices | ||
|
||
|
||
class SchedulePlugin(WillPlugin): | ||
# @hear("announce") | ||
def announce_banana(self, message, channel="general"): | ||
self.say("announcing in: %s" % channel, channel=channel) | ||
AnnouncementPlugin.banana(self, message, channel=channel) | ||
|
||
|
||
class AnnouncementPlugin(WillPlugin): | ||
# @periodic(hour='14', minute='10') # at a certain time | ||
# @periodic(second=0) # every minute at 0 seconds | ||
def announcetime(self): | ||
self.say("Announcement!", channel="general") | ||
|
||
# @hear("banana") | ||
def banana(self, message, channel=None): | ||
self.say("Bananaaaaa! %s" % channel, channel=channel) | ||
|
||
# @hear("this channel") | ||
def this_channel(self, message, channel=None): | ||
self.say("This channel's name is %s" % self.message.data.channel.name, channel=channel) | ||
self.say("This channel's id is %s" % self.message.data.channel.id, channel=channel) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters