Permalink
Browse files

Print out the words "Hi there!" if a person uses the trigger phrase `…

…!hn`
  • Loading branch information...
marvinpinto committed Mar 17, 2016
1 parent 9449257 commit 5376927171d9cf397516b8f7584fa5bd3b77acd8
Showing with 11 additions and 0 deletions.
  1. +11 −0 charlesbot_hello_world/helloworld.py
@@ -1,5 +1,7 @@
from charlesbot.base_plugin import BasePlugin
from charlesbot.config import configuration
from charlesbot.slack.slack_message import SlackMessage
from charlesbot.util.parse import does_msg_contain_prefix
import asyncio
@@ -21,3 +23,12 @@ def get_help_message(self):
@asyncio.coroutine
def process_message(self, message):
self.log.info("Processing message %s" % message)
if not type(message) is SlackMessage:
return
if not does_msg_contain_prefix("!hn", message.text):
return
return_msg = "Hi there!"
yield from self.slack.send_channel_message(message.channel, return_msg)

0 comments on commit 5376927

Please sign in to comment.