Skip to content

Commit

Permalink
made a generic post function
Browse files Browse the repository at this point in the history
  • Loading branch information
Noxet committed Oct 16, 2016
1 parent ca1d0a2 commit 7cb3fd6
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions geoffrey.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,8 @@ def post_lunch(dow, channel):
#print (resp)
slackc.api_call('chat.postMessage', channel=channel, text=resp, as_user=True)

def post_what(channel):
resp = "\"What\" ain't no country I've ever heard of. They speak English in What?"
slackc.api_call('chat.postMessage', channel=channel, text=resp, as_user=True)
def post_msg(msg, channel):
slackc.api_call('chat.postMessage', channel=channel, text=msg, as_user=True)

def handle_command(command, channel):
""" Handles mentions in channels """
Expand All @@ -85,10 +84,8 @@ def handle_command(command, channel):
elif command.startswith('friday'):
post_lunch(4, channel)
elif command.startswith('what'):
post_what(channel)

#resp = 'I am here and ready to serve!'
#slackc.api_call('chat.postMessage', channel=channel, text=resp, as_user=True)
msg = "\"What\" ain't no country I've ever heard of. They speak English in What?"
post_msg(msg, channel)

def parse_slack_output(slack_rtm_output):
""" Parses slack output """
Expand Down

0 comments on commit 7cb3fd6

Please sign in to comment.